Skip to content
The engine

Find it, prove it, cover exactly enough

A detector finds candidates; reading and the Verhoeff checksum prove them; a full read of the page catches what detection missed, in Hindi as well as English; the cover ends in the gap after the eighth digit and the last four stay readable. QR codes are covered whole.

A sample Aadhaar card, unmasked: the twelve-digit number and the QR code are readableThe same card after masking: the first eight digits and the QR code are covered, the last four digits are readableBeforeAfter
Drag the handle. A sample card, not a real one.XXXX XXXX 0123
Eight steps

What happens to every page

The same steps for a card photo, a 400-page loan file and a sale deed. The detector is the first opinion, never the last.

  1. 01

    Render

    PDF pages are rendered at 200 dpi and every page is cleaned to even lighting, so a shaded phone photo and a flat scan look alike to the next steps.

    Very large photos are worked on at 8 megapixels and the covers painted back on the original at full size.

  2. 02

    Detect

    A detector trained on Indian KYC documents boxes Aadhaar numbers and QR codes, looking at the page four ways round so a sideways or upside-down card is still found.

    The detector is the first opinion, not the last: a PAN, a date of birth and an amount grid can all look like a printed number strip.

  3. 03

    Read each box

    Every candidate box is read with OCR and the digits grouped the way a card prints them.

    A box that reads as fewer than twelve digits is read again from the raw page, enlarged.

  4. 04

    Verify

    A number must prove itself: twelve digits, printed 4-4-4 or run together, never opening with 0 or 1, and a valid Verhoeff checksum; or printed as a card prints it on a page that says Aadhaar.

    Bank statements, credit reports and tables of figures are recognised as pages of numbers, so a reference that happens to pass the checksum is left alone.

  5. 05

    Read the page

    Every line of the page is read for numbers the detector missed: a number written into a form, a deed's "Aadhaar No." in running text, the small second copy under a card's photo, a number split across two lines.

    Labels in Hindi are read by a Devanagari recogniser, so "आधार संख्या" in a sale deed is as good a label as "Aadhaar No." in English.

  6. 06

    Decode QR codes

    Every QR code on the page is decoded. One that carries UIDAI's record is covered wherever it is, whether the detector boxed it or not; a payment code, an e-stamp or a link is left alone.

    Older Aadhaar letters carry the full number in a plain-text QR; the newer secure QR carries the last four digits. Both are covered whole.

  7. 07

    Look across the file

    A card photographed front and back, or copied twice into one PDF, often reads cleanly on one page and a digit wrong on the other. A number confirmed on one page covers its misread copy on the others.

    The numbers are held in memory for the one document and never logged.

  8. 08

    Cover

    The first eight digits are painted over and the last four stay readable, UIDAI's own masked form. The cover ends in the gap after the eighth digit, not inside it. QR codes are covered whole.

    Where the digits cannot be placed exactly, the whole number is covered rather than risk a digit showing.

What it masks

Everything an Aadhaar number hides in

Aadhaar cards and e-Aadhaar

Card fronts and backs, PVC cards and their small second copy, e-Aadhaar letters, UIDAI verification screenshots, photocopies of photocopies.

Numbers inside documents

Written into application forms, printed in the running text of sale and gift deeds and loan agreements in English and Hindi, split across two lines, or in a table row labelled Aadhaar.

Aadhaar QR codes

The secure QR on cards and the plain-text QR on older letters, covered whole, wherever they are on the page.

Excel sheets

Twelve-digit Aadhaar numbers in cells are replaced with XXXXXXXXXXXX; other numbers in the sheet are left as they are.

Whole archives

ZIP files of up to 500 MB through the API, with the folder structure kept and a per-file report; or a folder run on your own servers.

Hard photos

Rotated, sideways, blurred, in a plastic sleeve, under glare, inside a collage: the page is looked at four ways round and read twice.

What it leaves alone

Covering too much is also a failure

A reviewer still needs the dates, the amounts and the last four digits. These are left as they are, by design.

  • The last four digits

    UIDAI's masked form keeps them readable so a file can still be reconciled against its paperwork.

  • PAN, dates, amounts, phone and account numbers

    Only a number that passes the Aadhaar checksum and the page's evidence is covered; a page of figures is never masked on a lucky match.

  • Virtual IDs

    A 16-digit VID is left as printed, by decision: it is UIDAI's revocable substitute for the number.

  • Already-masked numbers

    A number with a painted block beside its last four digits is recognised as masked and not covered a second time.

  • Other QR codes

    Payment codes, e-stamps and links decode as not Aadhaar's and stay readable.

  • Driving licences and other identifiers

    A licence number whose twelve middle digits happen to pass the checksum is refused before the checksum is even asked.

Architecture

Where the engine runs

The hosted service and the AWS Marketplace edition share one design; the on-premises edition runs the engine band alone, on your machine.

YOUR SIDETHE SERVICE (AWS MUMBAI, OR YOUR OWN AWS ACCOUNT)Your systemsPOST /aadhaar-maskingLOS, DMS, onboarding app, scriptYour archiveZIPs, folders, S3 linksAPIWAF · TLS · API keyChecks the key, type and sizeAnswers at once, or startsa background task you pollDeletes uploads after a dayMasking engineserverless · 10 GB · GravitonUp to 40 running at once by defaultLong PDFs fan out in 8-page chunksBackground workerZIPs, Excel, very long PDFssame engine imagenowlaterPrivate storageuploads/ · masked-output/Encrypted, no public access,deleted after a dayTask recordsStatus only, no document content, 2 daysmasked file back by signed link · per-page record in the JSONINSIDE THE ENGINE, EVERY PAGE01Render200 dpi, even light02Detect4 turns of the page03Readdigits in each box04VerifyVerhoeff + evidence05Read pageHindi labels too06Decode QRUIDAI's XML07Whole filemisread copies08Coverfirst 8, last 4 stay1234
The hosted service and the AWS Marketplace edition are the same stack; in the Marketplace edition everything under "the service" runs in your own account.XXXX XXXX 1234
Get started

Judge it on one of your own files

Send a card photo, a scan or a short PDF and get it back masked by the production engine, with a per-page record of what was covered. Or book thirty minutes with a HabileLabs engineer to see it on your document types and plan a deployment in your AWS account.

Or email support@habilelabs.io · Monday to Friday, 10:00–19:00 IST (excluding public holidays)