Skip to content

XXTEA Encryption & Decryption

Encrypt and decrypt with XXTEA (Corrected Block TEA) — tiny enough to fit in a few lines, and common in game and embedded code.

Input

Output (Base64)

XXTEA is broken or obsolete. It is here to read data that already exists — never use it to protect anything new. Use AES-GCM instead.
Everything is processed locally in your browser. Your data never leaves this device.

Small ciphers for small devices

XXTEA and SPECK exist because AES is large: a full implementation needs S-box tables and a key schedule that a microcontroller with a few kilobytes of memory cannot spare. Both fit in a handful of lines.

XXTEA is the third revision of TEA and operates on a whole message rather than fixed blocks, embedding the length in its output — which is why a wrong key is usually detected rather than producing plausible garbage.

SPECK was published by the NSA. No break is known, but ISO declined to standardise it after members raised trust concerns, and that is the reason it is uncommon outside firmware.

Frequently asked questions

Are these safe to use?

Neither has a published break, but neither has AES's two decades of scrutiny either. On anything that can run AES — which is any browser, phone or server — use AES-GCM.

Why does XXTEA reject my key?

It does not reject keys; it rejects output whose embedded length does not match, which is what a wrong key produces. Check the key and that the ciphertext was produced by XXTEA.

What key length does SPECK need?

This page implements SPECK 64/128, so the key is 16 bytes. Shorter input is zero-extended, which weakens it — supply a full 16 bytes.

Related tools