Module 5 · Symmetric Cryptography in Practice

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 27, 2026
1 min read
Read as

Last updated: April 29, 2026

100% Free

No signup. No paywall. No catch. One of our 10 most-requested practitioner modules — published in full so anyone can learn for free. We earn through consulting, not by gating knowledge.

See all 10 free modules →

Symmetric crypto is fast, ubiquitous, and routinely misused.

Symmetric crypto is fast, ubiquitous, and routinely misused.

Modes that matter

  • AES-256-GCM — authenticated encryption with associated data; default choice
  • ChaCha20-Poly1305 — alternative AEAD; faster on devices without AES-NI
  • AES-CBC — legacy; no built-in auth (vulnerable to padding-oracle if MAC absent)
  • AES-CTR — fast; needs separate MAC; nonce reuse catastrophic
  • AES-ECB — never use; reveals patterns

Common pitfalls

  • Nonce reuse with same key in GCM = key extraction
  • Padding oracle attacks against CBC
  • Hardcoded IVs / nonces
  • Missing authentication (encrypt without HMAC)

The right pattern

# Python (cryptography library)
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
import os

key = AESGCM.generate_key(bit_length=256)
aesgcm = AESGCM(key)
nonce = os.urandom(12)  # 96 bits, never reused with this key
ciphertext = aesgcm.encrypt(nonce, plaintext, associated_data)
plaintext = aesgcm.decrypt(nonce, ciphertext, associated_data)
🧠
Check your understanding

Module Quiz · 6 questions

Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.

Want this for your team?

Custom team training + practitioner advisory

Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.

Book team training call Replies in 4 working hrs · India-only · Senior consultants