Key
Also known as : Secret key · Cryptographic key
The key of a cipher is the private piece of information that lets you encipher a message — and decipher it. Without it, the algorithm alone is useless: it doesn’t know what to produce or what to recover. The key is what makes the difference between two recipients reading the same ciphertext: one sees meaning, the other sees noise.
A nature that changes with the cipher
A key’s form depends on the procedure:
- An integer for Caesar (the shift: N = 3 for Julius Caesar). Key space: 25 useful values (0 and 26 are the identity). Crackable by hand in five minutes.
- A word or phrase for Vigenère, Playfair, Beaufort (“SECRET”, “CITADEL”). Space: 26^L where L is the key length. An 8-letter key → 200 billion combinations.
- A permutation of the 26 letters for general monoalphabetic substitution. Space: 26! ≈ 4×10²⁶ combinations. Astronomical in theory; crackable in minutes by frequency analysis.
- A square n×n matrix for the Hill cipher. The key must be invertible modulo 26 — not every matrix qualifies.
- A random bit sequence as long as the message for the one-time pad. The only key that produces a mathematically unbreakable cipher, on condition that it’s used once and drawn from genuine randomness.
- Rotor configuration + scrambler + reflector + plugboard for Enigma: roughly 10²² combinations. Immune to pure brute-force. Yet operator usage (predictable procedures, human errors) is what brought it down.
- Public/private key pair in asymmetric cryptography (RSA, ECDSA). The public one is broadcast; the private one never leaves its owner. They’re mathematically linked by a hard problem (factoring for RSA, discrete log for ECDSA).
Kerckhoffs’s principle
The Kerckhoffs principle (1883) states that the security of a cipher must rest only on the secrecy of the key, never on the secrecy of the procedure. Anyone may know how Vigenère works; as long as the key stays secret, the messages stay protected.
Practical consequence: a good cipher publishes its workings and source code. A homemade “secret” cipher that holds only because nobody knows how it works falls at the first leak — taken apart by any competent cryptanalyst. That’s why modern ciphers (AES, RSA, ChaCha20) are public, standardized (NIST FIPS 197 for AES), and have been studied for decades. Trust comes precisely from public exposure: people tried, people failed, the design holds.
Key length and key space
The key space is the set of possible values. It’s what dictates how hard a brute-force attack is:
- 2⁵⁶ (DES) → cracked in 22 hours by the EFF DES Cracker in 1998. Today, minutes on a GPU.
- 2¹²⁸ (AES-128) → estimated unbreakable even by every computer on Earth running for the age of the universe.
- 2²⁵⁶ (AES-256) → extra margin for military contexts and partial resistance to quantum cryptanalysis.
A key that is too short invites brute-force. A key that is too long or poorly managed creates practical problems (memorization, transmission, rotation). The trade-off depends on the context: 128 bits for standard AES, 256 for military or post-quantum use. For CipherChronicle’s historical ciphers, you’re in much smaller spaces (25 to 10²² depending on the cipher) — that’s what makes them pedagogically attackable with a pencil.
Key management
A solid key isn’t enough — you also have to manage it:
- Generation: the key must come from a quality randomness source. A “key” derived from the encrypter’s dog name and birth year is a crackable key.
- Distribution: how do you share the key without transmitting it in the clear? That’s the great historical problem, solved by asymmetric cryptography (Diffie-Hellman, 1976).
- Storage: never write a key as plaintext in a versioned configuration file. Secret managers (AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault) exist for that.
- Rotation: periodically changing the key limits the impact of a silent compromise. Standard practice is yearly or quarterly rotation of sensitive keys.
- Revocation: ability to invalidate a compromised key. That’s what a certificate revocation list does in TLS.
Key takeaways:
- The key is what turns a public algorithm into private encryption. The algorithm gets published, the key stays hidden.
- Key spaces: Caesar 25, Vigenère 26^L, Substitution 26!, AES-128 2¹²⁸. Practical size matters more than theoretical size (frequency analysis vs brute-force).
- Kerckhoffs: security rests on the secrecy of the key, not the procedure. A “homemade secret” cipher is almost always worse than public AES.
- Key management (generation, distribution, storage, rotation) matters as much as the choice of algorithm. A good cipher with bad management makes a bad system.