XTEA, XXTEA and Rabbit: Lightweight Ciphers Explained
What XTEA, XXTEA and the Rabbit stream cipher are, why byte order and padding make implementations disagree, and why AES-GCM is the better choice today.

XTEA, XXTEA and Rabbit: Lightweight Ciphers Explained
Not every device can run a full cryptographic library. Microcontrollers in sensors, remote controls and game hardware have a few kilobytes of memory, so engineers in the 1990s and 2000s turned to ciphers that fit in a few lines of code. Three of them, XTEA, XXTEA and Rabbit, still appear in firmware, game save files, older mobile apps and IoT protocols. The free XTEA, XXTEA and Rabbit Cipher Tool lets developers and researchers reproduce exactly what such systems do.
XTEA
The Tiny Encryption Algorithm, TEA, was published by David Wheeler and Roger Needham of Cambridge in 1994. It encrypts 64-bit blocks with a 128-bit key using only additions, shifts and exclusive-or operations, repeated over 32 cycles. Weaknesses in its key schedule led to the extended version, XTEA, in 1997. XTEA has no known practical attack on the full cipher, which is why it lasted so long in embedded code.
Like any block cipher, XTEA needs a mode of operation. ECB encrypts each block on its own and reveals repeated patterns, so it should be avoided. CBC chains each block to the previous one using an initialisation vector, and CTR turns the cipher into a stream by encrypting a counter, which removes the need for padding.
XXTEA
Corrected Block TEA, known as XXTEA, came in 1998. Instead of fixed 64-bit blocks, it encrypts a whole buffer of 32-bit words at once, so every output word depends on every input word. It is compact and fast but has published weaknesses, including a chosen-plaintext attack, and should be treated as legacy.
Rabbit
Rabbit is a stream cipher designed in 2003 and selected for the eSTREAM portfolio of software-oriented stream ciphers. It is described in RFC 4503. Rabbit takes a 128-bit key and an optional 64-bit IV and generates a keystream that is combined with the data by exclusive-or, so encryption and decryption are the same operation. Never encrypt two messages with the same key and IV, because their keystreams would cancel out.
Why implementations disagree
Most problems with these ciphers come not from the algorithms but from the details around them:
- Byte order. XTEA reference code and libraries such as Go and Botan read words big-endian. Most XXTEA libraries read little-endian. Rabbit follows RFC 4503's little-endian layout.
- Padding. Some libraries use PKCS#7, some pad with zeros and some prepend a length. Turn padding off to match a system that requires exact block multiples.
- Keys. Some systems take a text password and pad it with zeros to 16 bytes. This works but is weak; a real key should be random.
The tool's results match published test vectors: the XTEA vector from Go and Botan, the all-zero XXTEA vector from the original paper and the Rabbit zero-key keystream from eSTREAM. If your output differs from a device, try the other byte layout, padding or mode before suspecting the algorithm.
What to use for new systems
None of these ciphers authenticates data, so an attacker can change ciphertext without detection, and XTEA's 64-bit block becomes unsafe after a few gigabytes under one key. For anything new, use authenticated encryption such as AES-GCM or ChaCha20-Poly1305. Even small microcontrollers now often include AES hardware, and the Web Crypto API offers AES-GCM in every browser.
Step by step
- Choose XTEA, XXTEA or Rabbit and the direction.
- Enter a 128-bit key, ideally as 32 hex digits.
- For XTEA choose a mode and IV; for Rabbit an optional IV.
- Enter the data as text, hex or Base64.
- Copy the output in the format you need.
Privacy
Keys and data stay in your browser and are never saved, even when you store other settings.



