Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Why ECB Mode Leaks Penguins and Why AEAD (AES-GCM) Matters for API Payloads

If you have ever seen the famous "ECB penguin" picture in a cryptography textbook, you already know why block cipher modes matter. When you encrypt data with AES in Electronic Codebook (ECB) mode, identical 16-byte plaintext blocks produce identical 16-byte ciphertext blocks. That means patterns in structured data, JSON keys, or bitmap pixels survive encryption completely intact. Why Shannon's…

Block cipher modes like Electronic Codebook (ECB) expose sensitive information due to their lack of diffusion. In ECB mode, identical plaintext blocks yield identical ciphertext blocks, enabling attackers to discern patterns in structured data and transport layer security headers. Claude Shannon's diffusion principle dictates that a single-bit change in plaintext should profoundly alter the ciphertext.

ECB and older modes like CBC fail to achieve this, leaving APIs vulnerable to tampering and padding oracle attacks. Authenticated Encryption with Associated Data (AEAD) addresses these issues by incorporating a random initialization vector, ensuring that identical plaintexts generate unique ciphertexts each time. An authentication tag, also 128 bits, detects any single-bit modification to the ciphertext or additional data, preventing decryption before failure.

Incorporating additionalData in TypeScript Web Crypto enables secure encryption of routing metadata alongside encrypted payloads. By passing tenantId as additionalData, developers can safeguard encrypted blobs from unauthorized transfer between tenants. Furthermore, AEAD's integration with cryptographic protocols like Dual DKIM and DMARC alignment fortifies email communication, fortifying infrastructure defenses against data leakage and unauthorized access.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

More from Dev.to on urgent.news

Get the news by email. Yesterday's most-covered stories, every morning.

See today's edition · More options

More in Tech

More from Sunday, 6 December 2026 →