Skip to main content

Social Security Number (SSN) masking functions

You can mask French, German, Japanese, UK, US, Chinese, and Indian Social Security Numbers.

These functions generate a unique random social security number related to the input. They only apply on Strings.

If there are duplicates in the input data, you will get the same duplicates in the masked values. In the same way, if there are no duplicates in the input data, there will be no duplicates in the masked values.

These functions check that the check bit is valid for the corresponding country.

When the input value is not valid, the function returns null.

The following table lists the SSN masking functions and which type of masking they use.

List of the SSN masking functions and which type of masking they use.
Function Random masking Consistent masking Format-preserving encryption Input data validation
Mask French SSN number No No Yes Yes
Mask German SSN number No No Yes Yes
Mask Japanese SSN number No No Yes Yes
Mask UK SSN number No No Yes Yes
Mask US SSN number No No Yes Yes
Mask Chinese SSN number No No Yes Yes
Mask Indian SSN number No No Yes Yes

When using those functions, you must select a FPE method.

Option Description
Method The default Basic method uses a proprietary algorithm.
Information noteNote: As the masking methods are stronger, it is recommended to use the FF1 algorithms rather than the Basic method.

This function can encrypt the output masked values in the same format as the input values, using Format-Preserving Encryption (FPE) methods:

  • FF1 with AES relies on the Advanced Encryption Standard in CBC mode.
  • FF1 with SHA-2 relies on the secure hash function HMAC-256.

The FPE methods are bijective methods, except when using tweaks.

The FF1 with AES and FF1 with SHA-2 methods require a password to generate encrypted and repeatable masked values. Those FPE methods do not use a seed.

You can specify this password in the Password or 256-bit key for FF1 methods field, from the Advanced Settings of the component.

Extra parameter This function requires no extra parameter.

The following table shows examples of masked values depending on the function. The input values are valid SSN numbers. The masked values are also valid SSN numbers corresponding to the country.

SSN generation function Input value Method Example of a masked value
Mask French SSN number 171125612301521 FF1 with AES 113056322612896
Mask German SSN number 12123456123 FF1 with AES 04538250629
Mask Japanese SSN number 123456789012 FF1 with AES 283950101162
Mask UK SSN number PP132459A FF1 with AES PC916049A
Mask US SSN number 153654862 FF1 with AES 828521191
Mask Chinese SSN number 130503196704010012 FF1 with AES 510304190708135114
Mask Indian SSN number 186034828209 FF1 with AES 203307371407

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!