Akelarre Encrypt/Decrypt
Encrypt and decrypt text using the Akelarre block cipher with configurable rounds, key length, and output encoding. Full client-side implementation.
About
Akelarre is a symmetric block cipher proposed in 1996 by researchers at the Spanish National Research Council (CSIC). It operates on 128-bit blocks and combines additive subkeys modulo 232 with data-dependent bitwise rotations across configurable rounds (typically 4). The cipher was designed to merge concepts from IDEA (addition/multiplication mixing) and RC5 (data-dependent rotations) into a single AR (Addition-Rotation) structure. Cryptanalysts later demonstrated structural weaknesses: in 2000, Knudsen and Rijmen showed that the cipher's lack of substitution (S-boxes) permits differential-style attacks that recover the key in fewer than 232 chosen plaintexts for reduced-round variants. This tool implements the full algorithm faithfully for educational and research purposes. It is not suitable for protecting sensitive data in production environments.
The key schedule expands a user-supplied key (minimum 128 bits) into 2R + 4 subkeys of 32 bits each, where R is the number of rounds. Incorrect key entry produces ciphertext that decrypts to garbage without any error signal. There is no authentication or integrity check. If you modify even a single bit of the key or ciphertext, decryption will silently produce incorrect output. Pro tip: always verify a round-trip (encrypt then decrypt) with your exact key before discarding plaintext.
Formulas
Akelarre splits each 128-bit plaintext block into four 32-bit words: A, B, C, D. The input transformation adds subkeys:
B ← B + K1 mod 232
C ← C + K2 mod 232
D ← D + K3 mod 232
Each round r (1 ≤ r ≤ R) performs an AR (Addition-Rotation) operation. The four words are concatenated into a 128-bit value and rotated left by a data-dependent amount derived from the round subkey:
Concatenate: W = A || B || C || D
W ← ROL128(W, rot)
Split back to A, B, C, D
After rotation, additive mixing applies the second round subkey:
C ← C + K2r+3 mod 232
After all R rounds, the output transformation subtracts the final subkeys. The total subkey count is 2R + 4.
Where: Ki = the i-th 32-bit subkey derived from key expansion. ROL128 = left circular rotation of a 128-bit concatenated word. R = number of rounds (default 4). A, B, C, D = the four 32-bit words of each block.
Reference Data
| Property | Akelarre | IDEA | RC5 | AES-128 | Blowfish |
|---|---|---|---|---|---|
| Year | 1996 | 1991 | 1994 | 2001 | 1993 |
| Block Size (bits) | 128 | 64 | 64 | 128 | 64 |
| Key Size (bits) | 128+ | 128 | 0 - 2040 | 128/192/256 | 32 - 448 |
| Default Rounds | 4 | 8.5 | 12 | 10 | 16 |
| Structure | AR network | Lai-Massey | Feistel-like | SPN | Feistel |
| Operations | + mod 232, rotation | +, ×, XOR | +, XOR, rotation | SubBytes, ShiftRows, MixCols, AddKey | XOR, +, S-box |
| S-boxes | None | None (implicit) | None | Yes (8×8) | Yes (key-dependent) |
| Data-Dependent Rotation | Yes | No | Yes | No | No |
| Known Attacks | Differential (Knudsen 2000) | None practical | Differential (reduced) | None practical | None practical (full rounds) |
| Status | Broken (academic) | Legacy | Legacy | Current standard | Legacy but safe |
| Origin | Spain (CSIC) | Switzerland (ETH) | USA (RSA Labs) | Belgium (KU Leuven) | USA (Schneier) |
| Subkeys per Round | 2 | 6 | 2 | 1 (round key) | 2 |
| Total Subkeys (R rounds) | 2R + 4 | 52 | 2R + 2 | R + 1 | R + 2 |