Inspiration
Most redaction tools are English-only. In Arabic-speaking contexts, sensitive documents — contracts, IDs, medical and bank records — routinely mix Arabic and English, and existing tools miss Arabic names, national IDs, and Arabic-Indic digits. And once a document is "redacted," the recipient has no way to prove it wasn't altered afterward. SafeDocs closes both gaps: bilingual redaction plus a verifiable proof of exactly what was removed.
What it does
- Detects personal data (PII) in Arabic and English: names, national/civil IDs, phones, emails, addresses, IBANs, and card numbers — each with a confidence score.
- Puts a human in the loop: you review every detected item and approve or keep it before anything is removed.
- Produces a clean, redacted copy of the document.
- Issues a cryptographically signed, tamper-evident proof of exactly what was removed and when — with a one-click Verify / Tamper demo showing any change breaks the signature.
Where Nutrient DWS does the core work
Nutrient DWS carries the core pipeline end-to-end: it parses the PDF for review, stages the approved redactions with create_redactions_text / create_redactions_ai / create_redactions_preset, apply_redactions burns them permanently into the file, and sign applies a CAdES/PAdES tamper-evident digital signature. The redaction and signing that make the output trustworthy are performed by DWS.
How I built it
- Backend: Python + FastAPI with a clean upload → extract → review → redact → sign pipeline.
- Bilingual detection layer: a regex + Arabic/English label engine that handles reversed and glued Arabic PDF text and normalizes Arabic-Indic digits.
- Trust layer: an RSA-signed proof (hashes + timestamp + what was removed) for offline verification, with Nutrient DWS CAdES signing on the production path.
- Frontend: a single-page, RTL-aware bilingual UI.
- Tested with pytest, containerized with Docker, deployable on Render.
Challenges I ran into
Arabic PDF text layers are unpredictable — labels can come before or after their value, words can be reversed, and bidi/zero-width marks break exact matching. Detecting AND redacting the Arabic name and address reliably took a dedicated order-agnostic, per-line pass plus careful value cleaning so DWS could align its redaction boxes.
Accomplishments that I'm proud of
A working end-to-end product that redacts real Arabic + English documents and returns a verifiable proof — with a graceful local fallback so it runs even without an API key, and a live tamper demo that makes the trust story tangible.
What I learned
How much of "redaction" is really about the text layer and language handling — and how a verifiable signature turns a redacted file into something a recipient can actually trust.
What's next for SafeDocs
Batch processing, more document types, a persistent datastore, and an authenticated multi-user mode for teams.
Built by Arif Alsuhaimi.
Built With
- cryptography
- css
- docker
- fastapi
- html
- javascript
- nutrient-dws
- pydantic
- pypdf
- python
- uvicorn
Log in or sign up for Devpost to join the conversation.