Skip to Content
oxcrypto

Rabbit

Encrypt with the Rabbit stream cipher from RFC 4503.

from oxcrypto.stream.rabbit import RABBIT

key = bytes(16)
ciphertext = RABBIT.RABBIT.apply_keystream(key, bytes(8), b"hello")
key_only = RABBIT.RABBIT_KEY_ONLY.apply_keystream(key, b"", b"hello")

RABBIT takes a 16-byte key and an 8-byte IV. RABBIT_KEY_ONLY skips IV setup, as in RFC 4503 appendix A.1, and requires an empty nonce. RFC 4503 is an Informational RFC, and Rabbit is in the eSTREAM software portfolio. The upstream crate cannot seek, so the cipher object has position but no seek.