Security for Engineers/Deep Cuts (Optional)

Cryptography for Engineers

What to use when — AES-GCM, RSA vs ECDSA, hashing vs encryption, password hashing (Argon2/bcrypt) — not implementing primitives.

4/5Overview: 30m

Golden rule

Don't invent crypto. Use platform and vetted libraries.

Quick reference (Latacora-style)

NeedUse
Symmetric encryptionAES-GCM (or ChaCha20-Poly1305)
Asymmetric signEd25519 or RSA-2048+
Key exchangeX25519
Hash (integrity)SHA-256
Password storageArgon2id or bcrypt
Random bytescrypto.randomBytes / secrets module

Hashing ≠ encryption

SHA-256(password) — fast, crackable. Use slow password hashes with salt.

TLS

Handled by platform — Networking topic. Don't terminate TLS yourself in app code.

Encryption at rest

Use KMS envelope encryption; don't hardcode AES keys in source.

Signing vs encryption

JWT signed (integrity) not encrypted (readable). JWE for encrypted tokens — rare complexity.

When interviewer asks "encrypt this field"

Ask: who needs to read it? search required? rotation? → drives KMS vs app-level vs DB TDE.

Cross-reference: Distributed Platform Security → KMS; Networking → TLS.

Further Reading

Hands-On Tasks (Optional)

Security design drills — threat modeling, auth flows, and incident playbooks. Assumes Networking (TLS) fundamentals.

  • Choose password storage scheme

    Compare bcrypt vs Argon2 vs scrypt. What not to use (MD5, SHA256 alone). Pepper + salt role.

    10m