Learn why encryption alone isn't enough. Master AEAD modes like AES-GCM and ChaCha20-Poly1305 that protect both confidentiality AND integrity. Understand how TLS 1.3, Signal, and modern security protocols prevent tampering attacks.
🎯 Hook
💡 Intuition
📚 Theory
🎮 Playground
💻 Code
🔧 Debug
✏️ Practice
How Did the Attacker Steal $900 Without Breaking Encryption?
The bank used AES-256 encryption on all wire transfers...
...but somehow an attacker changed a $100 transfer to $1000 without ever knowing the encryption key! The encrypted message was modified in transit, and the bank had no way to detect it.
The Bit-Flipping Attack
In CTR mode (and similar stream-cipher-like modes), flipping a bit in the ciphertext flips the corresponding bit in the plaintext. The attacker doesn't need to know what the plaintext is - they just need to know where the interesting data is!
Original Transaction
Plaintext:
$
1
0
0
.
0
0
Ciphertext:
0x7A
0x3F
0xB2
0xC1
0x05
0x9E
Amount: $100.00
After Attacker Flips Bits
Decrypted:
$
1
0
0
0
.
0
0
Modified Ciphertext:
0x7A
0x3F
0xB2
0xC1
0x55
0x9E
Amount: $1000.00
The attacker changed ONE byte in the ciphertext (0x05 to 0x55), and it changed $100 to $1000! The bank's decryption worked perfectly - it just decrypted the wrong message.
How was this possible? What's missing from the encryption?