Country pack
Portugal PII detection: NIF, NISS, IBAN
Short answer
Maskflare's Portugal pack has 5 detectors. 3 validate a check digit or letter, 1 tests layout or an embedded date, 1 matches on pattern alone.
What the Portugal pack covers
The Portugal pack holds 5 detectors: IBAN, Tax identification number (NIF), Social security number (NISS), Phone number and Postal code. 3 of them recompute a check digit or letter, 1 tests layout or an embedded date only, 1 is pattern-only, and 3 wait for a keyword before they match.
| Detector | Category | Validation | Valid example |
|---|---|---|---|
| IBAN | bank account number (IBAN) | Checksum | PT50 0002 0123 1234 5678 9015 4 |
| Tax identification number (NIF) | tax ID | Checksum | 123456789 |
| Social security number (NISS) | social security number | Checksum | 12345678902 |
| Phone number | phone number | Layout rules | +351 912 345 678 |
| Postal code | postal code | Pattern only | 1000-001 |
Every Portugal detector in detail
IBAN
A bank account identifier. Validation: the registered length for the country and the ISO 13616 modulus 97 check. Valid example: PT50 0002 0123 1234 5678 9015 4; the same shape that fails is PT50 0002 0123 1234 5678 9015 0.
Tax identification number (NIF)
A tax identifier. Validation: a modulus 11 check digit and an allowed first digit. It needs one of 5 keywords within 48 characters before the value, such as contribuinte, nif, número de identificação fiscal, tax id. Valid example: 123456789; the same shape that fails is 123456780. Full guide: Portuguese NIF.
Social security number (NISS)
A social security or social insurance number. Validation: a weighted check digit and a first digit of 1 or 2. It needs one of 7 keywords within 48 characters before the value, such as insurance number, niss, seguranca social, segurança social. Valid example: 12345678902; the same shape that fails is 12345678900.
Phone number
A telephone number in the national format. Validation: between 7 and 15 digits, the range an international number can have. Valid example: +351 912 345 678.
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. It needs one of 9 keywords within 48 characters before the value, such as c.p., codigo postal, código postal, post code. Valid example: 1000-001.
Local-language context words for Portugal
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.
- Tax identification number (NIF):
contribuinte,nif,número de identificação fiscal,vat - Social security number (NISS):
niss,seguranca social,segurança social - Postal code:
c.p.,codigo postal,código postal
How Maskflare masks Portugal 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 Portugal is a primary country.
- Monitor first: alert (counted, forwarded unchanged) when Portugal is a primary country.
Compliance profiles that include the Portugal pack: GDPR - EU/EEA.
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.
- 1 of the 5 detectors here matches on pattern alone (Postal code), so it 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 Portugal identifiers.
Frequently asked questions
What does Maskflare detect for Portugal?
5 detectors: IBAN, Tax identification number (NIF), Social security number (NISS), Phone number and Postal code.
Are Portugal identifiers masked by default?
They are masked when Portugal 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 Portugal identifiers have a checksum?
IBAN, Tax identification number (NIF) and Social security number (NISS).
Do the Portugal detectors need keywords?
3 of them do: Tax identification number (NIF), Social security number (NISS) and Postal code.
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.