Habr•September 7, 2026•🇷🇺Translated from Russian

Engineer Details Six Weeks Spent Training and Testing Signature Redaction Models for Closed-Loop Document Anonymization

A developer working on automated document sanitization spent six weeks attempting to reliably locate and redact handwritten signatures inside PDFs that must leave a closed network. The goal was to remove surnames, telephone numbers, addresses and signatures while preserving document usability, all on a single air-gapped workstation equipped with one consumer GPU.

Documents arrive in two forms. Text-layer PDFs allow direct removal of recognized words. Scanned pages require the system to detect text via Tesseract, then draw black rectangles over the corresponding image regions. Four parallel detection methods—dictionary lookup, regular expressions, natasha NER and an ink gate—successfully handled printed names but found zero signatures because signatures contain no machine-readable text.

Initial experiments with a color-saturation gate worked on blue-ink signatures yet failed completely on black-ink signatures and on any grayscale scan. An alternative heuristic that painted any dark region ignored by OCR erased entire table columns when text was printed in small fonts, violating the rule that only recognized text may be redacted.

Three off-the-shelf object detectors were benchmarked on 1,254 pages. YOLOS produced excessive false positives on engineering drawings and was discarded. A seal detector returned high-confidence false positives on documents containing no seals. A custom YOLO11s model trained on 600 synthetically augmented signature images plus 40 real pages reached 88 % coverage on isolated strokes but dropped sharply when adjacent signatures merged into large blobs.

Two rotation-related bugs repeatedly caused missed redactions. PDF /Rotate attributes produced coordinate mismatches between detection and drawing layers. Pages scanned sideways defeated Tesseract’s orientation detection when run with --psm 0, leaving the entire page unprocessed until OSD was re-enabled for low-confidence cases.

After switching the vision model from proactive detection to post-redaction verification, expensive GPU calls fell from roughly 50 pages per batch to 18. On the final corpus of 492 pages only 3.7 % of documents required the vision stage, all of them empty forms with vertical table headers.

Image-preprocessing tests showed that the classical OpenCV pipeline (deskew, illumination normalization, denoising, 2× upscaling) raised OCR to 92/103 pages while RealESRGAN reduced the same metric to 76/103 and increased runtime dramatically. Preprocessing is therefore applied only when the first-pass score falls below 70.

Comparison of twelve OCR engines on a two-page test document revealed that PaddleOCR detection combined with Tesseract recognition produced 16 correctly grouped name cells in 3.7 seconds. Full replacement by any single vision-language model either missed names entirely or required 12–20 seconds per page.

Redaction implementation errors were discovered only after the author added a verification step that extracts text from beneath every black rectangle. Using PyMuPDF draw_rect left recoverable text; switching to apply_redactions eliminated all leaks across 3,029 redactions in production files. White rectangles drawn for stamps and signatures occasionally overwrote already-redacted black areas, reopening rows of names—an issue caught only by the same under-rectangle text check.

The final pipeline therefore combines rule-based text removal, a lightweight YOLO signature detector, selective classical preprocessing, Tesseract augmented by PaddleOCR cell detection, and mandatory post-redaction text verification, achieving reliable signature removal inside the required closed environment.

Related articles

Habr•Privacy & Surveillance

WebRTC IP Leaks Explained: Why Disabling the Protocol Harms Anonymity in Anti-Detect Browsers

The article from Aurorium details how WebRTC technology can leak real IP addresses even when users route traffic through proxies. It explains the peer-to-peer mechanics of WebRTC, the role of STUN servers in generating ICE candidates, and why standard TCP proxies fail to handle UDP traffic. Disabling WebRTC via flags or JavaScript extensions creates detectable anomalies that anti-fraud systems flag as non-standard environments. The recommended approach involves native emulation inside the browser kernel so that STUN requests return proxy IPs while preserving full API integrity across workers. Additional leaks through local network addresses, mDNS candidates, and IPv6 are also covered with practical verification methods using tools like BrowserLeaks and CreepJS.

Habr•Privacy & Surveillance

Docx Anonymizer: Open-Source Chrome Extension Uses Fine-Tuned rubert-tiny2 to Anonymize Personal Data Before AI Uploads

A Russian developer has released Docx Anonymizer, a browser extension that automatically detects and replaces personal data in documents using a lightweight NER model before they reach public AI services such as ChatGPT. The tool was created to help organizations comply with Russia’s 152-FZ personal data protection law while avoiding the risks of uploading contracts and other sensitive files to cloud-based LLMs. It runs entirely locally via ONNX Runtime and WebAssembly, requires no network calls, and supports any AI chat interface. The underlying model, rubert-tiny2, was further trained through knowledge distillation on WikiANN, factRuEval, and synthetic business documents, reaching strong F1 scores for person and organization entities after int8 quantization. The extension intercepts text on the fly, performs named-entity recognition in under two seconds for typical contracts, and replaces detected entities with placeholders. The project is fully open source and designed for minimal user friction, addressing the growing problem of employees inadvertently leaking corporate and personal data to public AI platforms.

Habr•Privacy & Surveillance

Hybrid Post-Quantum Message Sealing: X25519 + ML-KEM-1024 in Umbera Messenger with Public Rust Tests

Umbera messenger has open-sourced its cryptographic core and published seven Rust tests that anyone can run to verify its hybrid post-quantum message sealing scheme. The design combines X25519 with ML-KEM-1024 so that an attacker must break both algorithms to decrypt a message. Messages are protected by Double Ratchet for forward secrecy, sealed sender packaging, and per-message ephemeral keys derived via HKDF-SHA256 into AES-256-GCM. The relay server stores only an opaque box identifier and encrypted blob with no sender or recipient fields visible. Media calls use DTLS-SRTP end-to-end while TURN servers see only encrypted datagrams. Addresses for message boxes rotate weekly and are derived solely from the shared secret between the two parties.

Habr•Privacy & Surveillance

Free Ad Blocker for iPhone, Android, and Desktop Uses DNS Parsing Without Libraries and Skips YouTube Influencer Ads From the First Second

A new free ad-blocking solution has been released for iPhone, Android, and desktop platforms. The tool relies on a lightweight DNS parser that operates without external libraries. It includes a dedicated mode for users who already run VPN connections. An accompanying browser extension automatically skips sponsored segments in YouTube videos, even when the advertisement begins at the zero-second mark. The developer describes the technical challenges encountered after launch and the fixes applied to maintain compatibility across operating systems. The project emphasizes user privacy by avoiding unnecessary data collection and third-party dependencies.