SPECK Encryption & Decryption
Encrypt and decrypt with SPECK 64/128, the NSA lightweight block cipher that ISO declined to standardise.
Input
Output (Base64)
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.