Supported document type
Detect tampered and deepfake DNI (Peru)
The Peruvian Documento Nacional de Identidad (DNI), issued by RENIEC and now only as the electronic DNIe, is the mandatory national ID and the primary document for banking and fintech onboarding. Its number is eight digits with a verification character, and the machine-readable zone carries standard ICAO check digits, so a card edited on the front tends to contradict its own zone.
API slug: peru_dni
Last updated:
What a genuine Peruvian DNI contains
The number is eight digits plus a separate verification character after a hyphen, placed at the upper right on newer DNIe cards and the upper left on earlier ones. The card shows surnames, prenombres, birth date, birth place with a ubigeo code, sex, civil status, signature, registration, emission and expiry dates, and photograph, with a machine-readable zone and a QR code on the DNIe 3.0.
Before May 2007 the verification character was a letter, and after it a digit, so both appear on legitimate cards. Validity differs by generation, and older holders over sixty may have no expiry on older cards. Several DNIe generations coexist, so each is judged against its own layout and rules.
How Peruvian DNI forgeries are made
MRZ check digits
The machine-readable zone repeats the number and dates with ICAO check digits. Digits that fail, or a zone that contradicts the front, point to edited print.
Verification-character rules
A letter is valid on cards from before May 2007 and a digit afterwards. A letter on a card issued after the change contradicts its own date.
Caducidad logic
Expiry must follow from the issue date and the generation's age rule. A date that breaks the rule is an internal inconsistency.
Generation conformance
The DNIe 3.0 carries a QR code on the reverse and the placement of the verification digit differs between generations. A missing code or wrong placement signals assembly.
Photograph and field patching
Portrait swaps and edited names or birth dates leave cut-line edges, font passes, and resolution steps that differ from uniform issued print.
What TamperCheck checks on a Peruvian DNI
TamperCheck runs 200+ forensic checks across three layers and returns a risk score from 0 to 100 with plain-English findings tied to specific regions of the document. These three carry the most weight on this document class.
Machine-readable zone validation
Check digits across every MRZ field are recomputed, and the encoded name, number, and dates are compared against the values printed on the face of the document. Forgers routinely update one and forget the other.
Portrait substitution and face-swap analysis
The document is isolated from whatever it was photographed on, then the portrait region is assessed against the card surface around it. A pasted or generated face rarely matches the substrate it was placed onto.
Barcode and QR payload comparison
Encoded payloads are decoded and compared against the human-readable values printed alongside them. Editing the visible text without re-encoding the barcode is a common and highly detectable mistake.
And many more checks
The three above are the layers that carry the most weight on a Peruvian DNI. Every upload runs the full suite of 200+ checks regardless of document class, spanning file structure and metadata, pixel-level forensics, font and text rendering, optical and print characteristics, provenance signals, AI-generation signatures, and many more checks.
Who verifies a Peruvian DNI, and why
Peruvian banks, fintechs, and telcos. In each case the document is being used to unlock money, access, or a legal status, which is exactly what makes it worth forging.
How to verify a Peruvian DNI in 4 steps
Capture both sides
Photograph front and back flat at full resolution so the number, machine-readable zone, and QR region survive close analysis.
Check the number
Confirm the eight digits and the verification character, and that its type fits the issue date.
Verify the zone
Recompute the MRZ check digits and compare the zone with the front for number, birth date, and sex.
Run a forensic check on the file
The zone carries the structural story, and the print carries the edit history. TamperCheck runs 200+ forensic checks including MRZ and number checks and patch detection, returning a risk score from 0 to 100 with findings tied to specific regions of the image.
Frequently asked questions
How long is a Peruvian DNI number?
It is eight digits followed by a separate verification character. The verification character is not part of the number itself.
Why do some DNIs show a letter and others a digit?
Before 23 May 2007 the verification character was a letter, and since then it has been a digit. Both appear on legitimate cards.
Does the Peruvian DNI have a check-digit algorithm I can recompute?
The verification character is not publicly specified, so it is not used for rejection. The MRZ uses standard ICAO check digits, which can be recomputed.
How does TamperCheck verify a Peruvian DNI?
TamperCheck recomputes the MRZ check digits, compares the zone with the printed fields, tests caducidad and verification-character rules, and inspects the portrait region for patching. Uploads run through a single REST endpoint, are processed ephemerally and not stored, and findings tie to specific regions.
TamperCheck analyses dni (peru) uploads with a hybrid forensic and AI pipeline tuned for this document class. Upload endpoints accept PDF and common image formats; class is inferred automatically. See the API documentation for authentication, async jobs, and webhooks.