Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

4.5.1. Cryptographic Foundations: Symmetric and Asymmetric

💡 First Principle: Symmetric encryption uses the same key to encrypt and decrypt — it is fast and efficient but requires a secure channel to share the key before any encrypted communication can begin. Asymmetric encryption uses a mathematically linked key pair (public and private) — it solves the key distribution problem but is orders of magnitude slower than symmetric. In practice, both are used together: asymmetric to securely exchange a symmetric key, symmetric to encrypt the bulk data.

Kerckhoffs's principle: a cryptosystem must stay secure even if everything about it except the key is public. Security must rest on keeping the key secret, not the algorithm — a home-grown "secret" algorithm has not survived the public cryptanalysis that vetted standards such as AES have, and once reverse-engineered it offers no protection at all.

Symmetric Encryption:
AlgorithmKey SizeStatusNotes
DES56-bit❌ DeprecatedBrute-forced in 22 hours (1999); never use
3DES (TDEA)112-bit effective⚠️ LegacyDeprecated by NIST 2023; still in some legacy systems; much slower than AES; 64-bit block exposes long sessions to birthday collisions (Sweet32)
AES-128128-bit✅ ApprovedNIST standard; sufficient for most commercial use. AES always uses a 128-bit block — only the key length varies
AES-192192-bit✅ ApprovedAdditional margin; FIPS 140-3 approved
AES-256256-bit✅ ApprovedRecommended for highly sensitive data and quantum resistance
ChaCha20256-bit✅ ModernTLS 1.3 alternative to AES; hardware-efficient on mobile
Blowfish/TwofishVariable⚠️ NicheTwofish was AES finalist; still used in some applications
RC4Variable❌ DeprecatedMultiple vulnerabilities; prohibited in TLS

AES modes of operation — the mode determines how AES processes data blocks:

ModeDescriptionUseIssue
ECBEach block encrypted independently❌ AvoidIdentical plaintext blocks produce identical ciphertext — patterns preserved
CBCEach block XORed with previous ciphertext before encryptionLegacy file encryptionIV must be random; parallelization difficult
CTRTurns block cipher into stream cipher; counter encrypted then XORed with plaintextHigh-performance, parallelizableCounter must never repeat
GCMCTR mode + GHASH authenticationTLS 1.2/1.3, disk encryptionProvides authenticated encryption (confidentiality + integrity); the nonce (IV) must never repeat under the same key — reuse breaks both confidentiality and the authentication tag

GCM is the preferred mode for most modern symmetric encryption because it provides both confidentiality and integrity authentication in a single, efficient operation.

Asymmetric Encryption:
AlgorithmKey SizeStatusPrimary Use
RSA2048-bit minimum; 3072+ recommended✅ Approved (with adequate key size)Key exchange, digital signatures, certificate signing
DSA2048-bit✅ ApprovedDigital signatures only (not encryption)
ECDSA256-bit (equivalent to RSA-3072)✅ Modern preferredDigital signatures in TLS certificates, code signing
ECDH256-bit✅ Modern preferredKey exchange in TLS 1.3; forward secrecy
ElGamal2048-bit⚠️ LegacyBasis for DSA; key exchange and encryption
Diffie-Hellman2048-bit minimum✅ ApprovedKey exchange; DHE/ECDHE provide forward secrecy

Hard problems behind each: RSA — factoring large integers; Diffie-Hellman, DSA and ElGamal — the discrete logarithm problem; ECC (ECDH, ECDSA) — the elliptic-curve discrete logarithm problem, which is why a 256-bit ECC key matches roughly 3072-bit RSA.

Key transport vs. key agreement: with RSA key transport, one side generates the session key and sends it encrypted under the other's public key; with Diffie-Hellman key agreement, each side combines its own private value with the other's public value and both compute the same secret, which never crosses the network. Unauthenticated Diffie-Hellman is open to man-in-the-middle, so in practice it is authenticated with certificates and signatures.

Hybrid encryption — how TLS and most practical systems work:

Forward secrecy — a property of key exchange where compromise of the long-term private key does not allow decryption of past sessions. Achieved through ephemeral key exchange (DHE or ECDHE) where a new key pair is generated for each session and discarded afterward. TLS 1.3 mandates forward secrecy; TLS 1.2 supports but doesn't require it.

⚠️ Exam Trap: RSA-1024 is no longer considered secure and has been deprecated. The current minimum for RSA is 2048 bits; 3072 bits is recommended for longer-term security. An exam question specifying RSA-1024 as a choice should be treated as a deprecated, insecure option — the same way DES is obviously wrong for symmetric encryption.

Reflection Question: A legacy application uses 3DES in CBC mode to encrypt database records. A new system is being designed. Which algorithm and mode should replace it, why is 3DES being retired, and what is CBC mode's specific weakness compared to the recommended replacement?

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•20 professional certifications