Glossary. Data protection terms.
What is data masking, and which methods can’t be reversed?
Data masking replaces real values so a copy can be used without them. What separates it from tokens, hashes and encryption is who holds a key back.
By Dipal Panchal, co-founder and CEO · Updated November 8, 2026
Who can get the original back
Data masking is the replacement of real sensitive values with altered or fictitious ones, so data can be used without exposing the originals. Unlike encryption, which anyone with the key can reverse, static masking by redaction or random substitution leaves no way back to the original in the masked copy. Masking that keeps joins working uses a key or a mapping, and whoever holds it can re-link the values.
One test card number, five outputs
The published Visa test number 4111 1111 1111 1111, as 16 unspaced digits, run through each method by script on November 7, 2026 (OpenSSL 3.6.5). The lab keys are test keys, and AES-256-CBC uses an all-zero key and IV, for this example only.
| Method | Output | Who can get the original back | Still personal data? |
|---|---|---|---|
| Static masking (no key exists) | **** **** **** 1111 | No one can recover the other twelve digits from the copy | Yes, if a name or account number sits beside it |
| Vault tokenization (the vault is the key) | 9837 2205 6614 1111, a token that fails Luhn on purpose | Systems allowed to ask the token vault | Yes: pseudonymized data, linkable through the vault key |
| Unkeyed hash (SHA-256) | 9bbef194…befe8f6e | It can’t be reversed, but anyone can hash every candidate and compare | Yes: with the first six and last four digits known, about 100,000 valid numbers remain |
| Keyed hash (HMAC-SHA-256) | 4596a491…6c80f7b3 | Nobody without the key; key holders can match values | Yes, for whoever holds the key |
| Encryption (AES-256-CBC, demo key and IV) | zg3rlN8D…0zhSWz8= | Anyone holding the key | Yes; an unintelligible copy can change breach duties, as below |
What the five rows show
The unkeyed hash looks safe and isn’t. A card number has so few unknown digits once the bank prefix and the last four are known that anyone, without any key, can hash every candidate and find the match. PCI DSS v4.0.1 requirement 3.5.1.1 closes that gap: a hash that renders a card number unreadable must be a keyed hash of the whole number, with its key managed.
The token was chosen to fail the Luhn check, so nobody can mistake it for a live card. A format-preserving token that passes Luhn reads exactly like the real value to anyone, and to any tool, that checks only the format.
Static and dynamic: when the value changes
Static masking makes a new copy in which the real values no longer exist, such as a test database refreshed from production. Dynamic masking doesn’t change the stored data; it hides values at query time, depending on who asks, though ad hoc queries can still filter on a masked column and infer its values.
That difference decides what you can claim. A masked view over plain tables doesn’t mean the data at rest is masked, and anyone with rights on the underlying table still reads the real values.
When the output is still personal data
GDPR Article 4(5) defines pseudonymization as processing data so it can’t be attributed to a person without additional information kept separately and protected. Recital 26 treats such data as personal where the person can be identified by means reasonably likely to be used, and UK GDPR has the same text. Under California’s Cal. Civ. Code § 1798.140(m), information is “deidentified” only if the business takes reasonable measures against re-identification, publicly commits not to attempt it and binds recipients by contract. For covered entities and business associates, HIPAA’s standard in 45 CFR 164.514(b) takes either an expert determination or removal of 18 listed identifiers with no actual knowledge that what remains could identify a person.
In 2016 Australia’s health department published de-identified Medicare and pharmaceutical claims records for about 2.5 million people, and researchers showed that doctors’ encrypted provider numbers could be decrypted without the department’s key. The department withdrew the data, and the Office of the Australian Information Commissioner’s investigation report of March 23, 2018 records what went wrong.
Under GDPR Article 34(3)(a), the people affected needn’t be told of a breach when the controller had applied protection, such as encryption, that makes the data unintelligible to anyone not authorized. Whether the supervisory authority must be told is a separate test under Article 33, which turns on the risk to people.
Choose the method by who needs the original
Pick the method by asking who downstream needs the real value back.
- No one: static masking, for test copies and extracts
- A system that matches values without seeing them: a keyed hash
- A system that needs the value back, under control: vault tokens
- Authorized people: encryption, with the key held apart from the data
Checks that read the format can be fooled
A check on stored values sees the format, not the history. Format-preserving tokens and format-preserving encryption keep the shape of the real value, so a format check reads them as plain. A real value that happens to look random can read as protected, with no key involved at all.
A policy that says test data is masked needs a check on the test data itself. Compare a sample of the column with the source, and record the date, who ran it, the database, the columns, the query and the refresh it covers, without copying the real values into the record.
IRIS checks sampled values in sensitive columns and flags them as masked, encrypted, hashed or plain, once the protection check is activated on your install.
Plain values in sensitive columns flagged: IRIS produces part of this, on sampled values, once the check is activated on your install.
A check that tells format-preserving tokens from real values; the check reads them as plain: Not produced by IRIS.
A check that tells a random-looking real value from a protected one: Not produced by IRIS.
Re-identification risk, or a ruling that data is anonymous: Not produced by IRIS.
Applying masking, or managing encryption keys: Not produced by IRIS.
Explore protection checksCheck one test copy against production
Pick the test database refreshed most recently from production. Take ten rows that share a key with production and compare their identifying columns, such as email, phone and national ID. A match in the same row means the refresh left that column in plain form. Repeat it after every refresh and keep one record per refresh.
A masked copy still holds a row for every customer; data minimization decides not to hold some fields at all. For the full test-database check, see how to find production personal data in your test databases.
Official sources
- PCI DSS v4.0.1, requirement 3.5.1.1 (keyed cryptographic hashes of PAN), PCI Security Standards Council. Opened November 7, 2026.
- Cal. Civ. Code § 1798.140(m), definition of deidentified, California Legislature. Opened November 7, 2026.
- 45 CFR 164.514(b), implementation specifications for de-identification, US Government Publishing Office (eCFR). Opened November 7, 2026.
Before and after choosing a method
What is PII?
The step before choosing a method: which values your law treats as personal or sensitive in the first place.
What is data minimization?
Deciding not to hold a value at all, field by field and purpose by purpose, before any method is chosen.
What is least privilege?
The next step after a masked view: who still has rights on the table underneath, which no view changes.
What engineers ask before choosing a method
Only if every copy of a value is masked the same way, with the same key or mapping. Otherwise the test copy loses the links between customers, orders and payments that testing relies on.
No. A salt stored beside the hash isn’t a secret, so it only slows the attacker down per value. PCI DSS asks for a keyed hash of the whole number, with the key managed under requirements 3.6 and 3.7; keep the key apart from the hashes.
Not quite. In PCI DSS, masking hides digits on display while the full number may still be stored; truncation removes them from storage, so they can’t be restored. A stored copy that keeps only the last four digits is truncated.
Protect your brand. Start with your data.
Pick a test database refreshed from production. We’ll show which sampled values IRIS flags as plain, once activated.