---
title: "Cross Referencing - Consistent Data Masking"
slug: "cross-referencing-for-consistent-data-masking"
updated: 2025-07-31T13:27:32Z
published: 2025-07-31T13:27:32Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.curiositysoftware.ie/llms.txt
> Use this file to discover all available pages before exploring further.

# Cross Referencing - Consistent Data Masking

Cross-referencing allows you to use a reference database to apply consistent data masking across multiple datasets or environments. This ensures that sensitive information such as names or addresses is masked uniformly, maintaining consistency and accuracy throughout your databases. By using this method, you can ensure that data remains protected in a standardized way across different tables and systems.

**Cross Reference**: Utilize a reference database to store data for consistent masking across multiple databases/environments.

- The cross-reference database comprises a table featuring columns for a cross-reference identifier, a pre-masked value (hashed), and a post-masked value.

> [!NOTE]
> To complete this task you need the xrefhash schema
> 
> This schema should be held in the **database**that you are looking to mask

```pgsql
CREATE SCHEMA xrefhash;

CREATE TABLE xrefhash.changes (
    name VARCHAR,
    oldvaluehash VARCHAR,
    newvalue VARCHAR
);
```

### Data Dictionary

Navigate to the **Data Dictionary** and copy/create a connection profile.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-J1RUY4NC.png)

Provide a **Name**& **Description**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-0J4Q0RRX.png)

As part of the connection, we will use regular expression to include the schemas & tables we want to work with. In this case the **xrefhash**schema and **changes**tables.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-MNEZFNSS.png)

One you test the connection works - Click **OK**.

Navigate to the new **Data Definition** and open the newly created **XRef**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-ITVTEXHI.png)

We will run a **Native Scan**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-WEGP0J0F.png)

Once completed a new scan should show here:

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-6P3IJIKZ.png)

### Data Masking

We will now build a new Data Activity. This activity will configure & control the cross referencing data masking job.

Navigate to the**Data Actives → Activity Explorer.** Choose to **+Add Activity** **→ Mask Database.**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-1GND1CJ5.png)

Provide a **Name**& **Description** then click **Next Step** when ready.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-S3BV0WGC.png)

When completed click Go to**Data Activity.**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-I3BE47AR.png)

First **Attach Definition Version**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-B61DD15C.png)

Choose the **Definition & Version**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-A7Y32R9I.png)

Then we **Attach Default Database Connection**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-H1BQIHJ7.png)

In this case the Curiosity Bank

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-GRXENL64.png)

We now have some basic building blocks in place.

> The **configuration**is an extremely important part of this process.

Navigate to the **Configuration** tab.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-E3LOO7J7.png)

Choose the **Xref**Database Connection you previously created. Click **OK** when ready.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-3AKW31XW.png)

We now are in a position to **Create a New Rule Set**. From the **Components**tab click the play icon.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-GYDGM6OW.png)

In the details tab provide a **Name & Description**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-J5LPKKRF.png)

From the **Tables** tab pick the tables you are looking to mask.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-9GF5IFMY.png)

I have chosen **Customers & Transactions.**When selected, click **+ Add Tables.** This will add the tables into the Ruleset so we can build rules to define against them. Click **OK** when ready.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-ICEU5DAY.png)

Your **Components**should look like this. With a Rule Set, Connection & Definition. Navigate to the **Version #1**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-WU3U8BHV.png)

Inside this example i have 4 columns that need consistent masking. **FirstNames & LastNames.**

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-DJIRBS15.png)

> [!TIP]
> **Hint**: I have toggled the **Active** column to Yes / No for other columns. It’s why only a few currently show.

We will now **+Add**our masking rules. Click **+Add**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-G09MF2HQ.png)

Choose the **Type**, **Function & Cross Reference**.

In this case, **Name, Masking.FirstName & FirstName**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-E96BQS58.png)

Repeat this for each column that you need to mask consistently. Click **Ok**to continue.

When ready you should have something similar to below with the **Masking Function** and **Cross Reference’s** filled out.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-TW2TN97J.png)

We now need to create the **Data Masking Submit Form**. From the Data Activity, click **Data Masking Submit Form**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-D4TZYBW1.png)

Provide the **Name & Group** to store the job.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-Z5KS5IW5.png)

The **Data Activity**should now hold all the below details. When you are ready to run the mask, Click the **Play**icon.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-UXJOFFU0.png)

If you had additional configurations such as a audit report request or just to validate the database, select those options. Otherwise, just click **Execute**.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-JE9PUIYL.png)

When the job runs you should see the records that have been masked.

> Note: Depending on the database type your definition scan/ruleset and database structure for the XREFHASH table need to be case sensitive.

![](https://cdn.document360.io/77f722a6-2d0a-49fa-8074-572515a6c4b8/Images/Documentation/image-86KS7TUB.png)
