I want to mask a Unique Identifier column and which is the best algorithm for this?

  • 0
  • 1
  • Question
  • Updated 3 weeks ago
  • Answered
I want to mask a column whose datatype is Unique Identifier (Not Null) but have repeatable values and the data is in the format of "586A3557-2243-4C06-BABE-004F2810BD2C" . I thought of trying SM algo but maximum length of each segment is only 4 in this algo. Any suggestions please!

Kind Regards,
Rajesh
Photo of Rajesh Dadi

Rajesh Dadi

  • 402 Points 250 badge 2x thumb

Posted 4 weeks ago

  • 0
  • 1
Photo of Mayank Ahluwalia

Mayank Ahluwalia

  • 646 Points 500 badge 2x thumb
Hi Rajesh,

The Segmented Mapping would fit perfectly for you as long as the total length of data never exceeds 36 characters.

Looking at the example you gave, you can create 8 segments of length 4 each, alphanumeric and ignore the character '-'.

Regards,
Mayank
Photo of Mayank Ahluwalia

Mayank Ahluwalia

  • 646 Points 500 badge 2x thumb
Thank you for the explanation :)
Photo of Jayashree Iyer

Jayashree Iyer

  • 150 Points 100 badge 2x thumb
Thanks for detailed explanation Mouhssine. But i am facing the below issues.

1) I have a varbinary column varbinary(256). I tried secure Lookup but it is failing with the error
Implicit conversion from nvarchar to varbinary is not allowed, use the convert function.

2) I decided to try using Binary Lookup as mentioned, for which the lookup file has to be of the format xml, jpg or pdf. I created the lookup with a pdf lookup file. But this too is failing with the error. I even tried increasing the column width to varbinary(500) 

Data Truncation.

Data sample: 0x01000000FFFDFB622D17E4F4891B97D2785F79EA6D22B96FA45C9E07D5AFF3A2D25E6497


Please suggest.

Thanks,
Jayashree
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 5,846 Points 5k badge 2x thumb
Hi Jayashree,

I'm not masterd on SQL Server, but got the same behavior on postgres where i created an implicite cast that converts my PK colum of type uuid to varchar in order to be masked.

You may have to look on (CAST / CONVERT) you colum to allow the masking process.

P.S : what is the content of this colum is it a pic, pdf ....?

Regards,

Mouhssine
Photo of Jayashree Iyer

Jayashree Iyer

  • 150 Points 100 badge 2x thumb
Hi Mouhssine,

It is not pic or pdf. It contains a binary data sample data below. DataType is varbinary(256)

0x01000000FFFDFB622D17E4F4891B97D2785F79EA6D22B96FA45C9E07D5AFF3A2D25E6497

Thanks,
Jayashree
Photo of Mouhssine SAIDI

Mouhssine SAIDI

  • 5,846 Points 5k badge 2x thumb
Hi,


OK, so you have to look on (CAST / CONVERT) between varbinary and nvarchar to get the column masked using the SL algorithm.

Regards,

Mouhssine