Cryptographic use cases
SecurityX CAS-005 · Lesson 20 of 24 · 2:58:00
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: protecting data at rest, in transit, and in use, symmetric and asymmetric cryptography, hashing, and digital signatures, code signing and immutable records, certificate-based and passwordless authentication, lightweight cryptography, tokenization, anonymization, and data sanitization. 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.
A platform with every need
Thornbury Biotech's new trial platform must protect patient data in the database, on the wire, and during analysis, prove who approved each result, and let developers test with realistic data that is not real. When the trial ends, the data must be destroyed in a way that auditors accept. Each of these needs is a cryptographic use case, with a technique that fits it.
Data in every state
Data at rest is protected by full disk, database, or file encryption, with keys stored apart from the data, ideally in a KMS or an HSM. Data in transit is protected by TLS for applications, and by encrypted tunnels, like IPsec or WireGuard VPNs, or SSH, when whole networks or admin sessions cross untrusted links. Data in use, while it is being processed, is the hardest state: confidential computing runs workloads inside hardware enclaves, and homomorphic techniques compute on encrypted values. Secure email combines TLS between mail servers, which protects each hop, with S/MIME or PGP, which protect the message itself from end to end. Map each data flow through these states, so no copy, cache, or backup is left without protection.
The core techniques
Symmetric cryptography uses one shared key, so it is fast and suited to bulk data, but the key must reach both sides safely. Asymmetric cryptography uses a key pair, so it solves key exchange and signatures, but it is slow, which is why protocols use it to agree on a symmetric key, then switch. Hashing turns any input into a fixed-length value that cannot be reversed, and any change produces a different value, which makes it the basis of integrity checks, and of password storage with salts and stretching. A digital signature is computed over a hash with the signer's private key, so anyone with the public key can verify origin and integrity, and because only the signer holds that key, it supports non-repudiation. A one-time pad, a truly random key as long as the message and never reused, is mathematically unbreakable, but distributing such keys makes it impractical outside special cases.
Integrity and provenance
Code signing lets developers sign software with a certificate, so systems can check the publisher and refuse code that was changed after signing. Software provenance goes further: signed build attestations show which source, which pipeline, and which dependencies produced each artifact, as in frameworks like SLSA. Code integrity checks at run time, like application control with publisher rules or hash allow lists, make sure that only signed, unchanged code executes. Immutable databases and blockchains chain each entry to the previous one with hashes, so any later change breaks the chain, which suits audit trails, but they cannot fix wrong data entered at the start, and they complicate deletion. Serialization turns objects into bytes for storage, transport, or signing, so sign a single canonical form, and never deserialize data that arrives without a valid signature.
Identity and keys
Certificate-based authentication replaces shared secrets with certificates on users, devices, or services, as in smart cards, 802.1X, and mutual TLS, so nothing reusable crosses the network. Passwordless authentication with passkeys keeps a private key on the device, unlocked by a biometric or a PIN, and signs a challenge bound to the site, which resists phishing. Centralized key management in a KMS or HSM gives one place for policies, rotation, and audit, but it becomes a high-value target, while decentralized management, with keys held by each team or device, scales and limits the damage, but drifts without strong standards. Lightweight cryptography, like the Ascon algorithms chosen by NIST, protects sensors and tags that cannot afford the full overhead of AES. Resource considerations shape every choice: battery, memory, processing power, and bandwidth limit which algorithms, key sizes, and protocols a system can run.
Privacy techniques
Tokenization replaces a sensitive value, like a card number, with a random token, and keeps the mapping in a secured vault, so systems that only hold tokens fall out of scope for many controls. Unlike encryption, a token has no mathematical link to the original, so it cannot be decrypted, only looked up in the vault. Anonymization removes or generalizes identifiers so people cannot be identified, while pseudonymization replaces them with codes that a key kept elsewhere can reverse, so pseudonymized data is still personal data under laws like the GDPR. Obfuscation makes code or data hard to understand, like renaming functions or masking all but the last digits of a number, but it slows attackers rather than stopping them. Privacy and legal requirements drive these choices: regulations may require encryption, data residency, breach notification, or export controls on strong cryptography, so involve legal teams early.
Sanitization and cryptographic erase
Data sanitization makes data unrecoverable when media is reused or retired, and NIST SP 800-88 defines three levels: clear, purge, and destroy. Clearing overwrites data so normal tools cannot recover it, purging defeats laboratory recovery, for example with a secure erase command, and destroying makes the media unusable, by shredding or incineration. Cryptographic erase purges data by destroying the key that encrypted it, which takes seconds on self-encrypting drives, and works in the cloud, where nobody can touch the disks. It only works if all the data was encrypted from the start, and if every copy of the key, including backups and escrow, is destroyed. Keep a certificate of sanitization for each device or data set, with the method, the date, and who verified it, because auditors and regulators will ask for it.
Recap
Let's recap. Data at rest, in transit, and in use each need their own protection, and secure email protects both each hop and the message. Symmetric encryption carries bulk data, asymmetric keys exchange keys and sign, hashing proves integrity, signatures give non-repudiation, and the one-time pad stays impractical. Code signing, provenance, code integrity, immutable ledgers, and signed serialization protect software and evidence. Certificates and passkeys replace passwords, key management can be centralized or decentralized, and lightweight cryptography fits constrained devices. And tokenization, anonymization, and obfuscation protect privacy, while sanitization and cryptographic erase end the data's life.
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.
A Thornbury scientist approves trial results electronically, and regulators require proof that the approval came from that scientist and was not changed afterward. Which technique provides this?
- Symmetric encryption with a shared key
- A plain hash stored with the results
- The scientist’s digital signature
- Tokenization of the scientist’s name
Show the answer
The scientist’s digital signature
A signature made with a private key that only the scientist holds proves origin and integrity, and supports non-repudiation. “Symmetric encryption with a shared key” would not prove who approved, because both sides share the same key. “A plain hash stored with the results” only detects changes, and anyone who alters the results can compute a new hash. And “Tokenization of the scientist’s name” only replaces a value with a token, and it proves nothing.
Thornbury wants staff to sign in without passwords, in a way that a fake sign-in page cannot capture. Which approach fits?
- Passkeys bound to each site
- SMS codes sent to each phone
- Longer passwords that change monthly
- Security questions as a second factor
Show the answer
Passkeys bound to each site
A passkey signs a challenge bound to the real site, so a fake page receives nothing it can replay. “SMS codes sent to each phone” can be captured by a fake page and replayed, or redirected through SIM swapping. “Longer passwords that change monthly” still sends a password that a fake page can capture. And “Security questions as a second factor” adds answers that are often guessable, and just as easy to phish.
Thornbury’s trial data sits in a cloud database whose disks Thornbury can never touch, and the contract ends next month. The data was encrypted from the start with keys that Thornbury manages. How can Thornbury make the data unrecoverable?
- Delete the tables and trust the provider’s process
- Ask for the physical disks to be shipped back
- Tokenize the data before leaving
- Destroy the encryption keys it controls
Show the answer
Destroy the encryption keys it controls
Destroying every copy of the keys Thornbury controls is a cryptographic erase, and it leaves the data unreadable on every disk and backup. “Delete the tables and trust the provider’s process” would leave data recoverable on media and in backups. “Ask for the physical disks to be shipped back” is not possible with shared cloud storage. And “Tokenize the data before leaving” only creates tokens, while the original data stays in the database.