Symmetric Cryptography
Cheat sheet · https://pcornel.dk/topic.php?topic=4683
Answer
Symmetric cryptography uses the same secret key to encrypt and decrypt. Algorithms like AES and ChaCha20 are fast and protect bulk data, while key exchange is usually done with asymmetric cryptography.
Remember
- AES-GCM and ChaCha20-Poly1305 give encryption plus integrity.
- Never reuse a nonce with the same key.
- Key management is harder than the cipher.
First checks
openssl speed -evp aes-256-gcm chacha20-poly1305— throughputgrep -o aes /proc/cpuinfo | head -1— AES-NI- Approved modes (GCM, ChaCha20-Poly1305) — policy
Verify in this order
key + nonce → AEAD → ciphertext + tag
Where it usually breaks
First mismatch in key/secret generation → storage/rotation → trust/certificate validation → protocol negotiation → cryptographic operation → peer/application verification; preserve identity/policy/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=4683