AEAD Tamper Demo
Encrypt with AES-256-GCM, flip a single byte of the ciphertext, watch decryption fail with "authentication failed". Explains *why* you need authenticated encryption in one click.
aes-gcm · aead · tamper-detection · webcrypto
Encrypt with AES-256-GCM, flip a single byte of the ciphertext, watch decryption fail with "authentication failed". Explains *why* you need authenticated encryption in one click.
aes-gcm · aead · tamper-detection · webcrypto
"Authenticated Encryption with Associated Data" means not just encrypting a message but also verifying it hasn't been modified. Classic AES-CBC doesn't do this: if someone flips a bit of the ciphertext, decryption returns garbage but no error. AEAD modes like AES-GCM produce an authentication tag; decryption checks the tag and throws if it doesn't match.
Ciphertext byte'ına tıkla, LSB'yi çevir, sonra decrypt dene — GCM tag bu değişikliği yakalar.
Click any ciphertext byte — its lowest bit flips, the cell turns red. Press "decrypt"; you'll get "authentication failed". "fresh key" generates new key + nonce.
const key = await crypto.subtle.generateKey({ name: "AES-GCM", length: 256 }, true, ["encrypt", "decrypt"]);
const iv = crypto.getRandomValues(new Uint8Array(12));
const ct = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, plaintext);
// the last 16 bytes of ct are the auth tag — WebCrypto appends it automaticallyIn production, generate a fresh IV per message. Storing it per row gives you uniqueness for free. Don't use a sequential counter where the count is observable — an attacker who can predict it can engineer IV reuse.