Advanced cryptography
SecurityX CAS-005 · Lesson 19 of 24 · 2:48:39
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the CompTIA SecurityX (CAS-005) exam. In this lesson: post-quantum cryptography (ML-KEM, ML-DSA, and SLH-DSA), crypto agility, key stretching and key splitting, envelope encryption, homomorphic encryption and secure multiparty computation, hardware acceleration, forward secrecy, AEAD, and mutual authentication. Includes three original practice questions, with Thornbury Biotech, a fictional biotech company whose security architect designs and runs its security, as the example.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
Secrets for twenty-five years
Thornbury Biotech keeps clinical trial data for twenty-five years, and its security board asks a blunt question: will today's encryption still protect it when quantum computers mature? The same review asks why one stolen key could unlock everything, and whether partners can analyze data without seeing it. Each question points to an advanced cryptographic concept.
The quantum threat
A large enough quantum computer running Shor's algorithm would break RSA, Diffie-Hellman, and elliptic curve cryptography, which protect almost every key exchange and signature today. Symmetric encryption and hashing are far less affected: Grover's algorithm only halves their effective strength, so AES with 256-bit keys remains strong. The urgent threat is harvest now, decrypt later: attackers collect encrypted traffic today and wait, so data that must stay secret for years needs quantum-resistant protection now. NIST has standardized ML-KEM for key establishment, and ML-DSA and SLH-DSA for signatures, selected HQC as a backup to ML-KEM, and plans to deprecate quantum-vulnerable algorithms after 2030 and disallow them after 2035. Emerging implementations often run in hybrid mode, combining a classical and a post-quantum algorithm, so the connection stays secure if either one holds.
Post-quantum versus classical
Classical Diffie-Hellman and elliptic curve exchanges are compact and fast, while ML-KEM keys and ciphertexts are larger, around a kilobyte or more, yet still fast enough for most connections. Post-quantum signatures are larger too, especially hash-based SLH-DSA, so certificates, firmware images, and constrained devices feel the difference most. Their resistance comes from different math, like lattice problems or hash functions, for which no efficient quantum attack is known. Browsers and major services already pair an elliptic curve exchange with ML-KEM, and libraries and HSMs are adding the new algorithms. Crypto agility, the ability to swap algorithms through configuration instead of rewriting code, starts with an inventory of where cryptography is used, and it makes this transition, and the next one, manageable.
Protecting and dividing keys
Key stretching turns a weak secret, like a password, into a strong key, by running it through a deliberately slow function many times, with a unique salt. Functions like PBKDF2, bcrypt, scrypt, and Argon2 make each guess expensive, and memory hard ones like Argon2 also resist attacks on graphics cards. Key splitting divides a key into shares held by different people, so no single person can use it, and secret sharing schemes can require any three of five shares, for example. Envelope encryption encrypts data with a data key, then encrypts that data key with a key encryption key kept in a KMS or an HSM, and stores the wrapped data key next to the data. Only small data keys ever travel to the key service, and revoking the key encryption key cuts access to everything wrapped under it.
Computing on protected data
Homomorphic encryption lets a system compute on encrypted data without decrypting it, so a cloud service can process values it never sees, and only the key holder can decrypt the result. Fully homomorphic schemes support any computation but remain slow, so partially homomorphic schemes, which support only addition or only multiplication, are used where they fit. Secure multiparty computation lets several parties compute a shared result, like a combined statistic, while each keeps its own inputs private from the others. Hardware acceleration, like AES instructions built into processors and dedicated cryptographic chips, makes strong encryption nearly free, so performance is rarely a reason to skip it. Performance and security still trade off: larger keys, slower key stretching, and bigger post-quantum keys cost time and bandwidth, so choose settings that match the risk, and measure them.
Forward secrecy and AEAD
Forward secrecy uses a new, temporary key exchange for every session, so a server's long-term private key, if stolen later, cannot decrypt traffic that was captured earlier. TLS version 1.3 requires it, through ephemeral Diffie-Hellman exchanges, which is one reason to retire older configurations that used static RSA key exchange. Authenticated encryption with associated data, or AEAD, encrypts and authenticates in one step, so any change to the ciphertext, or to associated data like a header, makes decryption fail. AES-GCM and ChaCha20-Poly1305 are the common AEAD ciphers, and reusing a nonce with the same key breaks their security, so implementations must guarantee unique nonces. Older designs that encrypted first and checked integrity separately, or not at all, caused many attacks, which is why modern protocols allow only AEAD ciphers.
Mutual authentication
Most TLS connections authenticate only the server: the client checks the server's certificate, and the user signs in later, inside the session. Mutual authentication means both sides prove their identity, like mutual TLS, where the client also sends a certificate, and the server checks it against a trusted authority. It is common between services and APIs, for devices joining a network, and in zero trust designs, where every connection must prove who is calling. Its costs are certificate management at scale: issuing, renewing, and revoking client certificates, ideally automated, with short lifetimes. Combined with forward secrecy and AEAD, mutual authentication gives a connection that is private, tamper evident, and tied to known identities on both ends.
Recap
Let's recap. Quantum computers threaten RSA, Diffie-Hellman, and elliptic curves, so NIST's ML-KEM, ML-DSA, and SLH-DSA, deployed in hybrid mode, answer harvest now, decrypt later. Post-quantum keys and signatures are larger, and crypto agility starts with an inventory. Key stretching strengthens passwords, key splitting shares control, and envelope encryption wraps data keys under a key encryption key. Homomorphic encryption and secure multiparty computation compute on protected data, and hardware acceleration keeps strong encryption fast. And forward secrecy, AEAD, and mutual authentication make connections private, tamper evident, and tied to identities.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Thornbury’s research archive must stay confidential for twenty-five years, and the security board worries that adversaries are collecting its encrypted traffic today. What should Thornbury do first?
- Double the RSA key length on every system
- Switch from AES-256 to AES-128
- Wait until quantum computers exist
- Plan a hybrid post-quantum migration
Show the answer
Plan a hybrid post-quantum migration
Harvest now, decrypt later threatens long-lived data, so inventory cryptography and move key exchange to hybrid post-quantum algorithms. “Double the RSA key length on every system” would only delay a quantum attack slightly, because Shor's algorithm breaks RSA at any practical size. “Switch from AES-256 to AES-128” would weaken symmetric protection instead of strengthening it. And “Wait until quantum computers exist” would be too late, because the traffic collected today is already at risk.
Thornbury and two partner hospitals want the average response to a treatment across all their patients, but none of them may reveal its own patient data to the others. Which technique fits?
- Key stretching with a unique salt
- Secure multiparty computation
- Envelope encryption of each data set
- Mutual TLS between the three sites
Show the answer
Secure multiparty computation
Secure multiparty computation produces the combined result while each party's inputs stay private. “Key stretching with a unique salt” only protects a key, not a joint computation. “Envelope encryption of each data set” only protects data at rest, and someone would still decrypt it to compute. And “Mutual TLS between the three sites” only proves who is on each side of a connection.
After a server’s private key was stolen, Thornbury learns that an attacker also captured months of that server’s TLS traffic. Under which condition is the old traffic still safe?
- Every session used ephemeral key exchange
- The certificate was revoked after the theft
- The server used static RSA key exchange
- The traffic was compressed before encryption
Show the answer
Every session used ephemeral key exchange
With forward secrecy, each session key came from a temporary exchange, so the stolen long-term key cannot recover it. “The certificate was revoked after the theft” only stops future use of the certificate, and it does nothing for traffic captured earlier. “The server used static RSA key exchange” is exactly what makes old traffic decryptable with the stolen key. And “The traffic was compressed before encryption” does not protect anything, and compression can even leak information.