Symmetric Encryption and Authenticated Encryption

Symmetric encryption is the workhorse of confidentiality — the same fast primitive protecting your disk, your database fields, and every byte inside a TLS connection. But "encrypt this" is a trap: raw encryption alone doesn't stop tampering, block ciphers need a mode of operation, and modes need nonces that must never repeat. The single right answer for almost every case is authenticated encryption, and this post explains why.

The previous post established that confidentiality comes from encryption. This post covers symmetric encryption — one shared key both encrypts and decrypts — which is fast, handles bulk data, and underlies nearly all practical confidentiality. But using it correctly means understanding block ciphers, modes of operation, nonces, and above all authenticated encryption (AEAD), the misuse-resistant default. Getting this right (and knowing why the tempting shortcuts are broken) is core applied crypto.

One key, both ways

Symmetric encryption uses a single secret key shared by both parties: encrypt with the key, decrypt with the same key. Its defining properties:

The dominant symmetric cipher is AES (Advanced Encryption Standard) — a public, standardized, heavily-analyzed block cipher, hardware-accelerated, and the default choice. ChaCha20 is a strong modern stream cipher, often preferred on platforms without AES hardware acceleration (some mobile/embedded). Both are excellent; you don’t choose between them by security but by platform. And per “don’t roll your own,” you use these standard ciphers via a library — never invent one.

Block ciphers need a mode

AES is a block cipher: it encrypts fixed-size blocks (16 bytes) at a time. But real data is longer than one block, so you need a mode of operation that defines how to encrypt many blocks. The mode matters enormously — and the naive one is catastrophically broken:

ECB's flaw: same plaintext block → same ciphertext block, always
   plaintext:  [AAAA][BBBB][AAAA]  →  ciphertext: [X][Y][X]   ← repeats visible!
   an attacker sees where the data repeats — structure leaks

The lesson: you never just “AES-encrypt” data — you use AES in a mode, and the mode must randomize output via a nonce so identical plaintext doesn’t reveal itself. And the right mode isn’t a bare confidentiality mode at all — it’s an authenticated one.

Encryption alone is not enough: AEAD

Here’s the crucial insight most “encrypt it” advice misses: confidentiality without integrity is dangerous. Plain encryption stops an attacker from reading the data, but often not from modifying it in meaningful ways. An attacker who flips bits in ciphertext can, with some modes, cause predictable changes in the decrypted plaintext — without ever knowing the key. And unauthenticated decryption can leak information through error behavior (padding oracle attacks). So you almost always need confidentiality and integrity/authenticity together.

The solution is AEAD — Authenticated Encryption with Associated Data — a single primitive that encrypts and authenticates:

The practical rule: for symmetric encryption, use an AEAD cipher (AES-GCM or ChaCha20-Poly1305) by default. Don’t use bare confidentiality-only modes (like AES-CBC) unless you have a specific reason and add a separate MAC correctly — and even then, AEAD is safer because it’s one hard-to-misuse operation. AEAD embodies “prefer misuse-resistant tools”: it makes the safe thing (authenticated encryption) the default thing.

The nonce rule: never repeat

AEAD ciphers have one rule you must not break: never reuse a nonce with the same key. A nonce (“number used once”) makes each encryption unique. Reusing a (key, nonce) pair is catastrophic — for AES-GCM, nonce reuse can leak plaintext relationships and completely break the authentication (allowing forgery). This is one of the most common and damaging real-world crypto mistakes:

The nonce rule is the archetype of applied crypto’s subtlety: a correct algorithm, a correct library, and a single reused number silently destroys everything. Respecting it — and preferring libraries/APIs that manage nonces safely — is essential.

Choosing and using symmetric encryption

Putting it together, the practical guidance:

Symmetric encryption is the fast engine of confidentiality, but “encrypt it” done right means AEAD with unique nonces via a good library — not raw AES, never ECB, never a reused nonce. Next: hashing, MACs, and the special case of storing passwords — where “just hash it” hides its own set of traps.

Key takeaways

Further reading

Sources & References

Encryption via a vetted library