How it works · 8 of 34 Foundation
How does encryption work with keys?
Scrambling with a shared secret
Encryption & keys: Encryption scrambles data with a key so that only someone holding the same key can unscramble it; the method is public, and all the safety lies in the key being secret and too long to guess.
Loading the animation…
Say it like this Encryption scrambles data with a secret key; the method is public, so all the safety is in keeping the key secret and long enough that nobody can try every setting.
Under the hood — for builders
- Real example: the card's note, really encrypted
- Symmetric encryption: the same key locks and unlocks. Here is "Meet at 6" through AES-128, the standard cipher, and what one wrong key bit gives:
- Why length is everything
- Each extra bit doubles the keys to try. Time to try them all at a billion billion (10¹⁸) a second, on a log scale:
- The method is public
- Kerckhoffs's principle (1883): assume the attacker knows the method. AES itself is a published US standard (FIPS 197).
- Typical sizes
- AES keys are 128, 192 or 256 bits. 56-bit DES was retired; NIST disallows anything under 112-bit strength (SP 800-131A).
- Measure it
- Ask three things: which algorithm, what key length, and who holds the key.
- Watch out
- A key stored beside the data turns encryption into decoration. Where keys live: Data & Cloud E4.
- Modes
- Real systems run AES in a mode such as GCM, which also detects tampering. Never ECB on more than one block.
- Sources
- NIST FIPS 197 (AES) · EFF, Cracking DES (1998) and RSA DES Challenge III (Jan 1999) · NIST SP 800-131A · Kerckhoffs, La cryptographie militaire (1883).
What happens in the encryption & keys animation, step by step?
- Asha wants to send Ravi a note over a wall anyone can watch. Both hold code wheels set to the same secret position: the key.
- Her wheel scrambles it. Over the wall flies confetti: anyone who catches it sees noise.
- Ravi's wheel, set to the same key, unscrambles it. The stranger knows exactly how the wheels work, and still gets noise.
- Your turn: make the key longer. Each extra bit doubles the settings the robot must try.
- A 56-bit key was cracked in 22 hours in 1999. At 128 bits, trying a billion billion keys a second would still take about 10 trillion years.
- One catch: both sides need the same key. How do you share it with a website you have never met? Next: public-key cryptography.
What everyday example explains encryption & keys?
Two friends with matching code wheels. Anyone may know how code wheels work; a message is safe because nobody else knows where the friends set the dial, and the dial has too many positions to try.
Why should a team care about encryption & keys?
You will be asked "is it encrypted?" by an auditor or customer; the follow-up that matters is "with what key length, and who holds the key", because a short or shared key turns encryption into decoration. Where keys are stored: D&C E4.