How to Mask and Unmask Data With Your Own Key

Most masking is one-way: once the emails are replaced, they are gone. Sometimes you need the way back. You mask a file, send it to a vendor, and later you need to know which real customer a masked row was. This guide shows how to mask a file with a key you hold, and how to unmask it again.

Open the Data Masking

Hashing, masking and encryption: what each one can undo

These three words are mixed up often, and the difference decides whether you can get your data back.

  • **Hashing** turns a value into a fixed code. It cannot be turned back, so there is nothing to "unhash". If the original values are easy to guess, such as short phone numbers, someone can still try them all and compare.
  • **Masking by replacement** (fake data, partial masking, fixed text) removes the real value. If you did not keep a copy, it is gone.
  • **Encryption with a key** scrambles the value so that only the holder of the key can read it. With the key you can reverse it. Without the key, the value is unreadable.

If you want to see the real value later, you need encryption. In Data Utility this is the method called **Encrypt with my key (reversible)**.

When reversible masking is the right choice

  • You send a file to someone who must not see the real names and emails, but you need to match their answers back to real people later.
  • You keep a working copy for analysis, and only one person should be able to restore the originals.
  • You want the same customer to get the same masked value in every file, so joins and counts still work, and you still want a way back.

It is the wrong choice when the person you share with should never be able to identify anyone, even with your help. Then use one-way methods, or generate synthetic data instead.

How to mask a file with a key

The Data Masking tool runs in your browser. The file and the key are not uploaded.

1. Open Data Masking and choose **Mask a file**.

2. Load your CSV, Excel, JSON or Parquet file.

3. For each column to protect, open the **Method** list and choose **Encrypt with my key (reversible)**.

4. A key is made for you the first time you do this. It belongs to this browser: another browser makes a different key.

5. Click **Download key file** and store it somewhere safe, away from the masked file.

6. Check the preview, then download the masked file. Encrypted values start with enc1_.

How to unmask a file

1. Open Data Masking and choose **Unmask a file**. This works in any browser, not only the one that made the file.

2. Load the masked file.

3. Add your key: upload the key file, or paste the key (it starts with dukey1-).

4. The real values appear. Download the unmasked file.

If some values cannot be unlocked, they were made with a different key or were changed after masking. The tool counts them and leaves them as they are. It never shows a wrong value.

Why the same value gets the same result

Encrypted values are consistent: the same email always becomes the same masked text with the same key. That keeps joins and counts working across files. The trade-off is that anyone can see which cells are equal, even without the key. If equal values must not be visible, use a one-way method such as fake data for that column.

Keep the key safe

  • **Lose the key, lose the data.** There is no reset and no copy on a server. Download the key file and store it in a password manager or another safe place.
  • **Anyone with the key can read the values.** Share it only with people who should be able to.
  • **Do not send the key with the file.** Send them by different routes.
  • **Numbers and dates come back as text.** Check them before you use the file.

What this does not do

Encrypting a column does not make a file anonymous. Under privacy laws such as GDPR, data that can be reversed with a key is still personal data in most cases, because someone holds the key. This is general information, not legal advice. Masking also does not hide other columns that can identify a person in combination, such as a birth date with a postcode.

Using it inside a pipeline

The Data Pipeline has the same method in its Mask step. You can load several files, join them, clean the result, then lock the personal columns with your key before you download.

Open the Data Masking

Related tool pages

  • Test Data Masking: Test data masking in your browser: hide emails, phones, names and card numbers in a production export and keep formats and joins. Free, no upload.
  • GDPR Test Data Generator: GDPR test data without real people: generate synthetic rows that follow the patterns of your own file, in your browser. Not legal advice.
  • Mask Emails in a CSV File: Hide email addresses and phone numbers in a CSV file before you share it. Detects personal columns for you. Free, in your browser.
  • Anonymize CSV Data: Anonymize a CSV before sharing it: hide names, emails, phones and card numbers with the method you choose. Free, in your browser.
  • Mask PII in Excel Files: Find and hide personal data in an Excel file before you share it, such as emails, phone numbers and names. Free, in your browser.
  • Mask Phone Numbers in a CSV: Hide phone numbers in a CSV, Excel or JSON file before you share it. Keep the country code or last digits, or replace with fake numbers. Runs in your browser.

Also try

How to use the Data Masking: step by step

  1. Open Data Masking, choose Mask a file and load your file.
  2. Set a column to "Encrypt with my key" and download the key file.
  3. Download the masked file. To restore it, choose Unmask a file, load the file and add the key.

When to use the Data Masking

  • Send a file to a vendor and match their replies later
  • Keep one restricted copy that can be restored
  • Share data across teams with one key holder
  • Mask now and decide later who may see the originals

Example

Input: ada@example.com, +1 555 0100

Output: a**@example.com, +1 *** ****

Frequently asked questions

Can masked data be unmasked?

Only if you used the method "Encrypt with my key (reversible)". Then you can unmask the file with your key. Other methods, such as fake data, partial masking and hashing, cannot be reversed.

Can a hash be reversed?

No. A hash is one-way. Easy-to-guess values can still be matched by trying many guesses, which is why a salt helps. If you need the original back, use encryption with a key.

What if I lose my key?

The original values cannot be recovered. The key is made and kept in your browser and is never sent to a server, so nobody can restore it for you. Download the key file and keep it safe.

Does unmasking work in another browser?

Yes. Open Data Masking, choose Unmask a file, load the masked file and upload or paste your key. The key does not have to be the one made in that browser.

Is my data uploaded when I mask or unmask?

No. Masking and unmasking run in your browser. Neither the file nor the key is sent anywhere.

Tip: Download the key file before you close the page, and keep it away from the masked file.