Encryption masking and tokenization
Choose the protection for the task
Encryption protects confidentiality against parties without the appropriate key; authenticated encryption can also detect unauthorized changes. Use reviewed libraries and key management from earlier chapters. Disk encryption protects stored media, but an authorized running application may still read plaintext. TLS protects transport between its endpoints, not all subsequent copies. Combine encryption with access control and minimization.
Mask only what the viewer needs
Masking changes what a viewer receives, for example showing only the final two characters of classroom code DEMO-42 as **42. Implement the projection on the server; hiding text visually while sending the full field to a browser is not access control. A masked export can still reveal identity through other attributes. Restrict full-value access and check API responses, logs and downloads as well as the UI.
Tokens and pseudonyms
Tokenization substitutes an identifier with a surrogate. A design may keep the mapping in a separately protected vault, allowing authorized reversal; some systems use cryptographic constructions instead. A report might use classroom token T7 instead of reader code R7. Protect mapping access, audit authorized lookup and define deletion across both stores. Pseudonymization reduces direct identifiability but does not automatically make data anonymous.
Evaluate residual identification risk
Hashing an identifier is not proof of anonymity. Equal inputs may yield equal digests and support linkage; predictable identifier spaces may be guessable. Even after removing identifiers, unusual combinations of attributes can single out records. Assess likely auxiliary information, recipient capabilities, intended use and release context. Prefer aggregates and suppression of small groups where appropriate; no single threshold guarantees anonymity.
Practice protection selection
A support agent needs a masked reference; billing needs an authorized lookup; the backup operator needs encrypted backup media without ordinary plaintext access; planning needs counts only. Propose separate views and roles for these four purposes. Identify where keys, mappings and restored plaintext could be exposed. A token is not automatically an encryption key or permission to view the original.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Encryption masking and tokenization — knowledge check
Review classification, privacy protection, transfer decisions and lifecycle evidence.
What can disk encryption fail to protect against?
Where should restricted fields be removed from a response?
What needs separate protection in vault-based tokenization?
Does hashing identifiers guarantee anonymity?
Which view best meets a count-only planning need?