How the number is built and checked
An EGN (единен граждански номер) has ten digits: YYMMDD, three digits unique for that day (the ninth digit is even for men, odd for women) and a check digit. GRAO, the civil registration directorate, forms the numbers for each calendar year. [1]
The century is in the month: 20 is added for people born up to 31 December 1899 and 40 for those born from 2000 to 2099. So 12 April 1990 starts 900412 and 1 February 2005 starts 054201. [1]
The check digit: multiply the first nine digits by 2 4 8 5 10 9 7 3 6, add, and divide by 11; the remainder is the check digit, written 0 when it is 0 or 10. For the made-up 900412345: 18 + 0 + 0 + 20 + 10 + 18 + 21 + 12 + 30 = 129, and 129 mod 11 = 8, so the number is 9004123458. [1]
A random ten-digit number with a plausible date has the right check digit about one time in ten, so nullcipher masks an EGN only when ЕГН, EGN or единен граждански номер stands within 40 characters before it.
How nullcipher recognises it
Ten digits YYMMDDSSSC with a real date, where 20 is added to the month for people born before 1900 and 40 for those born from 2000, and C is the check digit: the first nine digits times 2 4 8 5 10 9 7 3 6, summed, mod 11, with 10 written as 0. Masked with a context word — ЕГН, EGN, единен граждански номер — within 40 characters before it.
This is the rule text of the “Bulgarian EGN (единен граждански номер)” detector in the masking engine, copied from the engine when this page was built. Detectors run in a fixed order and, where two overlap, the earlier one wins.
Example (fake)
ЕГН 9004123458
nullcipher replaces it with [EGN_1]. Constructed for illustration: a man born on 12 April 1990, check digit computed by the rule above. The regulation publishes no specimen.
Why it matters in an AI chat
Bulgaria's Commission for Personal Data Protection (КЗЛД) names the EGN, with ID-document numbers, bank cards and passwords, among the especially sensitive data you should never give to someone you have not verified.
It gives away the exact birth date and the sex, so next to a masked name it still points at one person.
Masked, the AI sees [EGN_1] and can still help with the rest of the text.
If it already leaked
- Work out calmly what you disclosed, when, how and to whom, and keep every message, e-mail, phone number and document number as evidence. [2]
- If you sent it to the wrong or a fake address, contact the real recipient or organisation; if you can reach whoever received it by mistake, ask them to erase it, and if they refuse you can appeal to the КЗЛД or a court. [2]
- Watch your bank accounts and online profiles for unusual activity; if identity documents were lost or stolen tell the Ministry of Interior (МВР), and if there are signs of a crime such as fraud, report it to the МВР at once. [2]
- If it only went into an AI chat and there is no sign of misuse, delete the conversation — how, for each major assistant, is on the page listing every type. The EGN itself does not change.
Sources
- Наредба № РД-02-20-9 от 21 май 2012 г. за функциониране на Единната система за гражданска регистрация, чл. 104 — ГД „ГРАО“ — checked 2026-10-03.
- Съвети при неволно или необмислено разкриване на лични данни — Комисия за защита на личните данни — checked 2026-10-03.
Open the full masking tool to mask a whole log, .env file or e-mail — every type at once — and restore the values in the AI's answer. Or see all 242 detectors, with a page for 59 secret types, and how to delete a chat you already sent.