Skip to content

Country pack

Canada PII detection: SIN

Updated 6 detectorsPack code ca

Short answer

Maskflare's Canada pack has 6 detectors. 2 validate a check digit or letter, 1 tests layout or an embedded date, 3 match on pattern alone.

What the Canada pack covers

The Canada pack holds 6 detectors: Bank transit and institution number, Passport number, Phone number, Postal code, Social insurance number (SIN) and Social insurance number (SIN), unformatted. 2 of them recompute a check digit or letter, 1 tests layout or an embedded date only, 3 are pattern-only, and 3 wait for a keyword before they match.

Examples are synthetic and were run through Maskflare's validators. Click a detector name for its own page where one exists.
DetectorCategoryValidationValid example
Bank transit and institution numberbank account number (IBAN)Pattern only12345-678
Passport numberID document numberPattern onlyAB123456
Phone numberphone numberLayout rules(613) 555-0199
Postal codepostal codePattern onlyK1A 0B1
Social insurance number (SIN)social security numberChecksum130 692 544
Social insurance number (SIN), unformattedsocial security numberChecksum130692544

Every Canada detector in detail

Bank transit and institution number

A bank account identifier. Validation: the pattern only, with no checksum or structural validator. It needs one of 5 keywords within 48 characters before the value, such as account number, bank account, institution, routing. Valid example: 12345-678.

Passport number

An identity document number. Validation: the pattern only, with no checksum or structural validator. It needs one of 8 keywords within 48 characters before the value, such as document number, id card, id no, id number. Valid example: AB123456.

Phone number

A telephone number in the national format. Validation: between 7 and 15 digits, the range an international number can have. Valid example: (613) 555-0199.

Postal code

A postal code, which identifies a place rather than a person on its own. Validation: the pattern only, with no checksum or structural validator. Valid example: K1A 0B1.

Social insurance number (SIN)

A social security or social insurance number. Validation: nine digits that pass the Luhn check, not starting with 0 or 8. Valid example: 130 692 544; the same shape that fails is 130 692 540. Full guide: Canadian SIN.

Social insurance number (SIN), unformatted

A social security or social insurance number. Validation: nine digits that pass the Luhn check, not starting with 0 or 8. It needs one of 5 keywords within 48 characters before the value, such as nas, numero d'assurance sociale, numéro d'assurance sociale, sin. Valid example: 130692544; the same shape that fails is 130692540.

Local-language context words for Canada

These are the words in the catalogue that confirm a value as belonging to this country's detector. Shared English words such as ID number or tax id are left out here because many packs use them; a word below points at this pack even when other packs are on.

  • Bank transit and institution number: account number, bank account, institution, routing, transit
  • Passport number: document number, id card, id no, id number, identity card, identity number, passeport, passport
  • Social insurance number (SIN), unformatted: nas, numero d'assurance sociale, numéro d'assurance sociale, sin, social insurance

How Maskflare masks Canada identifiers

Detections are replaced with a token such as mf_mask_d7e0 before the request goes to the AI provider, and with response restoration turned on the real value is put back in the answer. The other actions are redact, partial, hash, format-preserving encryption, generalize, alert and block.

  • Protect now, Finance - Protect now, Healthcare and Developer: mask (a reversible token) when Canada is a primary country.
  • Monitor first: alert (counted, forwarded unchanged) when Canada is a primary country.

None of the compliance profiles (HIPAA Safe Harbor, GDPR (EU/EEA), UK GDPR, PCI DSS v4.0, US PII (CCPA/CPRA) and Swiss nDSG health data) includes the Canada pack. Its detectors run when Canada is chosen as a primary country or the pack is enabled directly.

Limits worth knowing

  • A passing checksum shows that a value is well formed, not that it was issued to a real person. The examples on this page pass for that reason and are not real.
  • 3 of the 6 detectors here match on pattern alone (Bank transit and institution number, Passport number and Postal code), so they can match text that merely has the same shape.
  • Detectors read the text of the request. A value inside an image is found only after OCR, and a value split across lines is not one match.
  • Names, addresses and free-text details are handled by other packs. This page is limited to the Canada identifiers.

Frequently asked questions

What does Maskflare detect for Canada?

6 detectors: Bank transit and institution number, Passport number, Phone number, Postal code, Social insurance number (SIN) and Social insurance number (SIN), unformatted.

Are Canada identifiers masked by default?

They are masked when Canada is chosen as a primary country (the default Protect now template uses the action mask), or when the pack is turned on directly. A country pack is not on for organisations that did not choose the country.

Which Canada identifiers have a checksum?

Social insurance number (SIN) and Social insurance number (SIN), unformatted.

Do the Canada detectors need keywords?

3 of them do: Bank transit and institution number, Passport number and Social insurance number (SIN), unformatted.

Rules on this page describe what Maskflare's detectors and validators check. They are read from the detection catalogue and are not the specification of the body that issues the identifier. Examples are synthetic.

Related pages

See it on your own data

Try Maskflare free.
Bring your hardest prompts.

28-day free trial or 10,000 requests, whichever comes first. Point one app at the gateway or enroll a few laptops,
and watch what gets masked. Or talk to us first.