🐍 Serpent-256
AES Finalist — 32 Rounds of Conservative Security
Designed by Eli Biham (Technion, Israel) · Ross Anderson (Cambridge) · Lars Knudsen (DTU)
Encrypt
Argon2id Parameters
- Time cost: 3 iterations
- Memory cost: 65,536 KiB (64 MiB)
- Parallelism: 1
- Output: 32 bytes (256-bit key)
- Salt: 16 bytes (random per operation)
Decrypt
Security Margin Visualization
Avalanche Effect
Strict Avalanche Criterion: a single-bit change to the input of a strong block cipher should flip about half of the output bits. Encrypt one 128-bit block below, flip a single input bit, and watch how many of Serpent-256's 128 output bits change. A result near 50% is exactly what good diffusion looks like.
CTR Mode: Block Cipher → Stream Cipher
How does a cipher that can only encrypt 16-byte blocks handle a message of any length? In CTR (Counter) mode, Serpent never encrypts your message at all. It encrypts a counter block — the nonce, then nonce+1, then nonce+2… — to produce a keystream, and the plaintext is simply XORed against it. Edit the message or nonce below and watch the keystream change. This is the exact construction the Encrypt panel above uses.
Performance Comparison
Note: Both ciphers execute every round of their full specification — Serpent-256-CTR runs all 32 rounds per block, AES-256-GCM runs all 14. AES-256-GCM benefits from hardware acceleration (AES-NI) via the Web Crypto API. Serpent-256-CTR runs in WebAssembly without hardware acceleration. This comparison reflects real-world browser throughput, not algorithmic speed.
"This performance gap is the price of Serpent's 2.7× security margin. The AES committee chose speed. Serpent chose to survive."
About Serpent
The Designers
- Eli Biham — Technion, Israel Institute of Technology, Israel. Co-inventor of differential cryptanalysis (with Adi Shamir). Pioneer of block cipher analysis.
- Ross Anderson — University of Cambridge, UK. Security engineering researcher. Contributed the overall architecture and design philosophy.
- Lars Knudsen — Technical University of Denmark (DTU). Expert in integral and impossible differential cryptanalysis. Key contributor to the S-box design.
Israeli Cryptographic Lineage
Eli Biham studied under Adi Shamir (the "S" in RSA) at the Weizmann Institute. Together they developed differential cryptanalysis — the technique that broke DES and reshaped how every modern block cipher is designed. Biham brought this deep understanding of attack mechanisms to Serpent's design, building a cipher specifically resistant to the techniques he himself had pioneered.
AES Competition Outcome
In the AES competition (1997–2000), Serpent placed second to Rijndael. Rijndael received 86 votes to Serpent's 59. NIST's selection criteria weighted performance alongside security. Rijndael was faster with fewer rounds (10/12/14 vs 32), while Serpent prioritized a conservative security margin — using twice as many rounds as needed to block all known shortcut attacks at the time.