Platform

Platform overview How it works Authorization testing Evidence & reports Private scanning Integrations

Solutions

Security agencies Product teams Regulated industries Partner programme

Learn

Blog Knowledge hub Compare

Resources

Pricing Documentation Help centre FAQ Security & data What we haven’t proved

Company

About Contact Careers Sign in to the platform Start a $199 pilot →

Home / Knowledge hub / Data masking

Knowledge hub

Data masking

Hiding part of a value, such as card digits, so most people only see a safe version.

Illustration explaining Data masking

What it means

Data masking replaces part or all of a sensitive value with a safe stand-in, so most people and systems never see the real thing. A card number shows as ending in 4242, an email as a***@example.com, a phone number with the middle digits hidden. The real value stays stored for the few who need it.

The idea that makes it click: masking is about display and copies, not about protecting the store itself. It limits who sees the full value on a screen, in a log or in a test database. It is a different job from encryption, which protects stored or moving data until someone with a key reads it.

Why it matters

Most exposure of sensitive data is accidental and ordinary. A support agent sees a full card number they do not need. A log file records the whole request. A developer copies production data into staging. Masking removes the full value from places it was never needed.

It is also expected by rules. PCI DSS limits how much of a card number may be shown and requires the full number to be unreadable wherever it is stored. Masked data in non-production systems reduces the damage if a test environment leaks, which counts under data minimisation.

How it shows up

There are two main forms. Display masking hides digits in screens, exports and API responses. Masking for test data replaces real values in a copy of production with realistic fake ones. Related ideas are tokenisation, which swaps a value for a token, and encryption at rest.

Common mistakes: masking only in the web page while the API response still carries the full value, which anyone can read from the network tab. Logs that record raw request bodies. Masks too weak to hide the value, such as hiding one digit. Check the response itself, not only what the screen shows, and look at excessive data exposure.

Questions people ask

Data masking, answered

Is data masking the same as encryption?

No. Encryption scrambles data so only a key holder can read it, and it can be reversed. Masking replaces what is shown or copied with a safe version.

Use encryption to protect stored data and masking to limit who sees the full value.

Can masked data be reversed?

It depends on the method. Simple display masking hides characters while the original is still stored. Irreversible masking for test data replaces values with fake ones that cannot be turned back.

Poor masking, such as a predictable pattern, can be guessed.

Does masking in the UI protect the data?

Only the screen. If the API sends the full value and the page hides part, an attacker can read the whole value from the response.

Mask on the server, before the data leaves it.

Should we mask data in logs?

Yes. Logs are copied widely and kept long. Do not log passwords, tokens, full card numbers or other secrets, and mask personal data where you can.

OWASP's logging guidance lists data that should be removed or masked.

Does PCI DSS require masking?

PCI DSS says the primary account number must be masked when displayed, so only people with a business need can see more than the permitted digits, and unreadable wherever stored.

Check the current version for the exact digit limits.

Cyberlop mark

What does your API really return?

We read the actual API response, not only the screen, so masking that exists only in the interface gets found. Each finding carries the request and response. Ask us to run it on one of your applications.

Or start with a $199 pilot on one application: thirty days, success criteria agreed before day one, credited against the annual if you convert.