Skip to content

feat: add NgBvnRecognizer (Nigerian BVN) and KeNationalIdRecognizer (Kenyan national ID)#2169

Open
kingztech2019 wants to merge 8 commits into
data-privacy-stack:mainfrom
kingztech2019:feat/african-pii-recognizers
Open

feat: add NgBvnRecognizer (Nigerian BVN) and KeNationalIdRecognizer (Kenyan national ID)#2169
kingztech2019 wants to merge 8 commits into
data-privacy-stack:mainfrom
kingztech2019:feat/african-pii-recognizers

Conversation

@kingztech2019

@kingztech2019 kingztech2019 commented Jul 18, 2026

Copy link
Copy Markdown

Change Description

Adds two new country-specific PII recognizers for African identifiers currently absent from Presidio:

NgBvnRecognizer — Nigerian Bank Verification Number (NG_BVN)

The BVN is an 11-digit identifier issued by the Central Bank of Nigeria (CBN) and managed by NIBSS (Nigerian Interbank Settlement System). It links every bank account held by an individual to a single biometric record. Unauthorized disclosure is a criminal offence under the CBN BVN Regulatory Framework (Circular FPR/DIR/GEN/CIR/01/009, 2014).

Design notes:

  • Pattern \b\d{11}\b at score 0.01 — same footprint as the existing NgNinRecognizer
  • BVN has no publicly documented checksum algorithm. validate_result returns None (not True) for structurally valid matches so context-boosted score is preserved rather than unconditionally promoting to MAX_SCORE
  • Context: bvn, bank verification number, bank verification no, nibss, bank identity number

KeNationalIdRecognizer — Kenyan National Identity Card (KE_NATIONAL_ID)

The Kenyan national ID card number is a 7–8-digit sequential identifier issued by the National Registration Bureau under the Registration of Persons Act (Cap. 107). Kenya currently has no recognizers in Presidio — this is the first.

Design notes:

  • Pattern \b\d{7,8}\b at score 0.01 — covers 7-digit (older cards) and 8-digit (current cards)
  • No checksum algorithm is publicly documented; validate_result returns None for structurally valid matches
  • Context: national id, national identity, nid, kenyan id, kenya national id, id card, national registration

Both recognizers are registered in default_recognizers.yaml with enabled: false.

Issue reference

N/A — new recognizer addition for uncovered African PII entities.

Checklist

  • I have reviewed the contribution guidelines
  • I agree to follow this project's Code of Conduct
  • I confirm that I have the right to submit this contribution and that it does not knowingly contain proprietary or confidential code.
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant