Remove protection from Office (.pptx, .docx, .xlsx) and .pdf files —
no passwords needed. Runs on Linux, headless, no GUI required.
| Format | Protection | Method |
|---|---|---|
.pptx .docx .xlsx |
Password to modify (Restrict Editing) | Strips XML protection tags |
.pdf |
Owner password (no edit/print/copy) | Removes via pikepdf |
.pptx .docx .xlsx .pdf |
Password to open (encryption) | Brute-force (--bruteforce) |
- Scans source folder recursively
- Strips protection from Office and PDF files
- Preserves subfolder structure in output
- Optional brute-force for encrypted files
- Parallel processing with configurable workers
Linux / macOS
./scripts/setup.sh
./scripts/run_decryptor.shWindows
scripts\setup.bat
scripts\run_decryptor.batOptional: configure folders in config/.env
UNLOCKER_SOURCE_DIR=file_input
UNLOCKER_DEST_DIR=file_output
UNLOCKER_OUTPUT_PREFIX=unlocked_- Python 3.8+
- Linux, macOS, Windows
Dependencies (auto-installed by setup.sh / setup.bat):
msoffcrypto-tool— Office brute-forcepikepdf— PDF owner password removal
Usage: office-and-pdf-unlocker [OPTIONS]
Options:
-s, --source DIR Source folder (default: file_input)
-d, --dest DIR Destination folder (default: file_output)
--prefix PREFIX Output filename prefix (default: unlocked_)
--dry-run Simulate without writing files
-v, --verbose Verbose output (DEBUG)
--no-recursive Don't scan subfolders
-w, --workers N Parallel workers (default: 4)
--log-dir DIR Log directory (default: logs)
Brute-force:
--bruteforce Crack encryption password if protection removal fails
--bruteforce-min N Min password length (default: 1)
--bruteforce-max N Max password length (default: 4)
--bruteforce-charset S Characters to use (default: 0123456789)
# Default
./scripts/run_decryptor.sh
# Dry-run
./scripts/run_decryptor.sh --dry-run --verbose
# With brute-force (4-digit PIN)
./scripts/run_decryptor.sh --bruteforce
# Brute-force with letters, max 3 chars
./scripts/run_decryptor.sh --bruteforce --bruteforce-charset "abcdefghijklmnopqrstuvwxyz" --bruteforce-max 3office_unlocker/
├── src/
│ ├── main.py # CLI entry point
│ ├── config.py # Configuration & argument parsing
│ ├── decryptor.py # Protection removal + brute-force
│ ├── file_handler.py # File system operations
│ └── logger.py # Logging setup
├── config/
│ ├── .env # Environment configuration
│ └── .env.example # Configuration template
├── scripts/
│ ├── setup.sh # One-shot setup
│ └── run_decryptor.sh # Launch script
├── tests/ # Unit tests (pytest)
├── avvia.sh # Quick launcher
├── requirements.txt # Python dependencies
└── README.md
These are ZIP archives. Modify protection lives as XML tags inside the archive. The tool opens the ZIP, strips the tags with regex, and writes a clean copy.
PDF owner passwords are removed via pikepdf (libqpdf). The PDF is opened
and re-saved without restrictions.
source venv/bin/activate
pytest tests/ -vMIT — see LICENSE