Ake98 Encrypt/Decrypt
Encrypt and decrypt text using the AKE98 Feistel cipher with 16-round S-box substitution, CBC mode, and SHA-256 key derivation. Secure symmetric encryption tool.
About
The AKE98 cipher is a symmetric block cipher built on a 16-round Feistel network operating on 64-bit blocks with a 128-bit key. Each round applies a fixed 8×8 S-box substitution, bitwise rotation by round-dependent offsets, and XOR mixing with a derived round key. The key schedule expands a passphrase-derived 128-bit master key into 16 unique 32-bit subkeys using circular shifts and the GF(28) field constant 0x1B. Cipher Block Chaining (CBC) mode ensures identical plaintext blocks produce distinct ciphertext blocks. A random 8-byte initialization vector (IV) is generated per encryption and prepended to the output. Without CBC, an attacker performing frequency analysis on repeated blocks could extract structural information from the plaintext. The passphrase undergoes SHA-256 hashing to produce the master key, preventing weak-key patterns from short or predictable phrases. This tool approximates academic-grade encryption for educational and light-duty confidentiality purposes. It is not a replacement for AES-256-GCM or NaCl/libsodium in production security contexts.
Formulas
The Feistel round function F for round i operates on the right half R and round key Ki:
Each full round updates the halves as:
CBC encryption chains blocks via the initialization vector:
where C0 = IV. Decryption reverses: Pj = DK(Cj) ⊕ Cj−1.
Variable legend: L, R = left/right 32-bit halves. Ki = round subkey. S = S-box substitution (byte-wise). RotL = circular left rotation. ri = rotation offset for round i. Pj = plaintext block j. Cj = ciphertext block j. IV = initialization vector. ⊕ = bitwise XOR.
Reference Data
| Parameter | Value | Description |
|---|---|---|
| Block Size | 64 bits (8 bytes) | Data processed per cipher operation |
| Key Length | 128 bits (16 bytes) | Derived from SHA-256 of passphrase |
| Rounds | 16 | Feistel network iterations |
| S-box Size | 8×8 (256 entries) | Fixed substitution lookup table |
| Mode | CBC | Cipher Block Chaining with random IV |
| IV Length | 64 bits | Prepended to ciphertext output |
| Padding | PKCS#7 | Pads plaintext to block boundary |
| Key Derivation | SHA-256 | Web Crypto API hash of passphrase |
| Output Encoding | Base64 | Safe for text transport and storage |
| Round Key Size | 32 bits | Extracted from expanded key schedule |
| Rotation Offsets | 3, 5, 7, 11 (cycled) | Left-rotate amounts per round |
| Feistel Function | S-box → Rotate → XOR | Non-linear mixing per half-block |
| Decryption | Reverse round order | Feistel property: same structure, reversed keys |
| Avalanche Target | ≥ 50% bit flip | 1-bit input change → ~half output bits change |
| GF(28) Constant | 0x1B | Irreducible polynomial for key schedule mixing |