Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Encrypted PDF Support & Security Refinements v1.4

Choose a tag to compare

@M1ck4 M1ck4 released this 17 Nov 06:05
· 41 commits to main since this release
c5ef85e

🔐 Encrypted PDF Support & Security Refinements v1.4

Version 1.4 introduces full, security‑aware support for password‑protected PDFs, along with internal refinements that strengthen the reliability, safety, and professional use‑cases of pdf_to_md.

This release builds on the formatting stability of v1.3.1 and expands the tool’s capabilities for legal, medical, research, and confidential document workflows.


✨ New in v1.4

🔐 Full Support for Password‑Protected PDFs

Encrypted PDFs are now fully supported across the entire application stack:

Core Engine:

  • Unified password handling inside the extraction layer
  • Clean detection of locked PDFs before processing begins
  • Dedicated validation path for incorrect passwords
  • Smooth integration with both native text extraction and OCR workflows

GUI:

  • Automatic password prompt when opening an encrypted file
  • Masked password entry for privacy
  • Clear feedback for incorrect passwords
  • Ability to retry or cancel conversion at any point

CLI:

  • Secure password prompt using getpass
  • Password input hidden (no echo)
  • Supported in both interactive and batch workflows
  • Graceful failure in non‑interactive shells

This makes encrypted document conversion seamless for end users while maintaining strong security boundaries.


🛡️ Security First Implementation

Password handling has been designed explicitly for sensitive and confidential workflows.

✔ Memory‑Only Handling

  • Passwords are never stored in configuration files
  • Passwords are never logged to console or output files
  • Passwords exist only in short‑lived variables
  • Variables are cleared (password = None) after use

✔ No Command‑Line Exposure

  • Passwords are never passed as arguments to external tools
  • Prevents exposure through ps, Task Manager, or system monitors

✔ Safe OCR Integration

  • Encrypted PDFs are decrypted in‑process using PyMuPDF
  • OCR tools receive a temporary decrypted copy, not the password
  • Temporary files are placed in OS‑protected temp directories
  • Temporary decrypted files are deleted immediately after use

⚠ Output Is Not Encrypted

The resulting Markdown file is saved unencrypted. Users handling highly sensitive content should store results in encrypted directories or secure volumes.


🎨 UX Improvements for Encrypted Documents

GUI Enhancements

  • Automatic password dialog when selecting a locked PDF
  • Masked characters for password input
  • Helpful error dialog on invalid passwords
  • Retry or cancel anytime

CLI Enhancements

  • Secure hidden password input
  • Works identically on Windows, macOS, and Linux
  • Clean error messages for wrong passwords or locked files in scripts

These improvements ensure encrypted PDFs become a natural part of the workflow, without breaking automation or batch processing.


🧩 Internal Improvements

Even beyond password support, several internal upgrades were introduced:

  • More stable extraction flow when dealing with mixed encrypted/unencrypted pages
  • Safer error handling around early document validation
  • Unified password API across GUI, CLI, and pipeline

These refinements keep the system predictable, debuggable, and easier to extend in future releases.


🗂 Updated Files in This Release

The following files were updated to support password‑protected PDFs:

  • extract.py — central password detection, authentication, and decrypted temporary file creation
  • pipeline.py — password propagation through the full flow
  • app_gui.py — GUI password dialog and retry UX
  • cli.py — secure interactive password prompt
  • utils.py — safety helpers and temporary‑file handling

🔒 Privacy First, Offline Forever

No uploads. No telemetry. No cloud services.

Every operation — including password validation, decryption, OCR, and rendering — happens entirely on your machine.

Your documents remain yours.


📌 Summary

v1.4 is a major privacy and capability milestone:

  • Full encrypted‑PDF support
  • Secure, memory‑only password handling
  • Clean GUI + CLI workflows
  • Safe OCR integration
  • Strengthened internal architecture

Recommended for all users, especially those handling sensitive or protected documents.