2.4.2. Encryption Methods and Algorithms
💡 First Principle: Encryption transforms readable data (plaintext) into unreadable data (ciphertext) using a key and algorithm. Strength depends on the algorithm, key length, and implementation — all three must be sound.
Encryption levels:
| Level | Protects | Use Case |
|---|---|---|
| Full-disk | Entire drive | Laptop theft protection |
| Partition | Specific partition | Separating OS from data |
| File | Individual files | Selective protection |
| Volume | Logical volume | Flexible encrypted storage |
| Database | Entire database | Structured data stores |
| Record | Individual records | Field-level sensitivity |
Transport/communication encryption protects data in transit: TLS (HTTPS), IPSec (VPNs), SSH (remote administration).
Symmetric algorithms use one shared key and are fast: AES (current standard, 128/192/256-bit), DES (deprecated, 56-bit), 3DES (being phased out). Asymmetric algorithms use key pairs and are slower: RSA (2048/4096-bit), ECC (smaller keys, equivalent security), Diffie-Hellman (key exchange).
Key exchange — Diffie-Hellman and ECDHE allow two parties to establish a shared secret over an insecure channel. This is how TLS creates a symmetric session key using asymmetric methods. ECDHE (Elliptic Curve Diffie-Hellman Ephemeral) provides forward secrecy — if the server's long-term key is later compromised, past sessions remain protected because each session used a unique ephemeral key.
Key length directly affects security — longer keys resist brute-force. AES-256 is the standard for sensitive data.
Post-quantum cryptography is emerging as quantum computers threaten current asymmetric algorithms. RSA and ECC are vulnerable to quantum attacks (Shor's algorithm), while symmetric algorithms like AES and hash functions remain relatively safe with doubled key sizes. NIST has standardized new post-quantum algorithms (CRYSTALS-Kyber for key encapsulation, CRYSTALS-Dilithium for signatures). Organizations should begin crypto agility planning — the ability to swap algorithms when needed.
Choosing an encryption level comes down to which threat you are stopping. Full-disk, partition and volume encryption are transparent once the system boots and the volume is unlocked, so they protect a powered-off or stolen device but do nothing against malware, a compromised application, or an administrator on the running system — to them the data reads as plaintext. File, database and record-level encryption keep data encrypted until an application or user holding the right key asks for it, so they still protect data on a running server, in backups, and against over-privileged insiders such as a DBA who can query a table but does not hold its key. Record-level encryption protects individual records (rows), and the closely related field- or column-level encryption protects specific values such as a salary or card-number column. The finer the level, the more keys to manage and the more performance and application-integration cost — which is why organizations layer them: full-disk encryption on every laptop, plus database or record-level encryption for the few data sets that justify it.
Key length is only comparable within the same algorithm family. NIST SP 800-57 rates a 3072-bit RSA key, a 256-bit ECC key and a 128-bit AES key at roughly the same (128-bit) security strength. Asymmetric keys must be far longer than symmetric keys to resist attack, so "longer number = stronger" only holds when comparing keys of the same algorithm.
⚠️ Exam Trap: DES is deprecated (56-bit key). 3DES is being phased out. AES is the current standard. When a question asks which algorithm for sensitive data, AES-256 is almost always correct.