The National Identifier Mask - Canada - Social Insurance Number (SIN)

The SIN consists of 9 digits which are typically grouped as 3 digits separated by hyphens as shown in the example below:

123-456-789

The last digit is a check digit calculated using the Luhn algorithm.

Format

DataVeil masks the digits of a SIN value and preserves the original format of every individual SIN value. All non-numeric characters are preserved.

For example, rows that have hyphen separated SIN numbers are masked using the same hyphen separated format while other rows that are space separated are masked with space separated values.

NULL

NULL values are preserved.

Invalid original SIN values

Invalid SIN values are preserved.

A SIN shall be considered invalid if any of the following are true:

* The original value does not contain exactly 9 digits (plus any other symbols such as hyphens or spaces for formatting).

* The first digit is a 0 or 8 unless the corresponding '0/8 is valid as first digit' mask option is enabled.

* The check digit is not valid.

Deterministic mode

Preserve first digit

If this checkbox is selected then the first digit of the original SIN shall be preserved.

'0' is valid as first digit

If this checkbox is selected then a '0' as the first digit of the original SIN value shall be considered valid. Otherwise the SIN value shall be considered invalid.

'8' is valid as first digit

If this checkbox is selected then an '8' as the first digit of the original SIN value shall be considered valid. Otherwise the SIN value shall be considered invalid.

Non-Deterministic mode

DataVeil shall generate a sequence of SINs composed of 3 parts:

{PrefixDigit} {SequenceNumber} {CheckDigit}

Preserve first digit

If this checkbox is selected then the first digit of the original SIN shall be preserved.

If this checkbox is not selected then the first digit (Prefix) shall be chosen randomly and weighted according to the approximate population distribution of Canada in 2012. This translates to the Prefix selection probability distribution as shown below:

If the '0' is valid as first digit and/or '8' is valid as first digit options are enabled then these prefixes (0, 8) shall share in the 1% probability that is assigned to the Temporary Residents prefix (9).

Default start sequence number

This specifies the first number that shall be used as {SequenceNumber} and shall be incremented by 1.

Although the sequence number is incremented sequentially, the generated SINs are assigned in an unpredictable order to the target rows.