pdf2john
A modern refactoring of the legacy pdf2john.py library, aimed at making the code easier to read and maintain.
Install
Install dependencies using Homebrew
brew bundle
Create a virtual environment and install Python dependencies
pyenv virtualenv 3.11.4 pdf2john
pyenv shell pdf2john
poetry install --only main
Usage
To pass the hash to john:
pdf2john example.pdf >> .hash
john .hash
john --show --format=PDF .hash
If you don't want to use poetry, you can run pdf2john as a standalone script:
git clone https://github.com/benjamin-awd/pdf2john.git
cd pdf2john && pip install -r requirements.txt
./src/pdf2john/pdf2john.py example.pdf >> .hash
Features
- Responsibility for PDF parsing and handling has been delegated to pyHanko (a crytography focused fork of PyPDF2)
- CICD workflow that tests pdf2john against PDFs ranging from Security Handler Revision 2 -> 6
- Removal of legacy Python 2.x support
- An optional debugging flag that shows the encryption dictionary of a PDF
- Readability improvements (a general attempt to be more Pythonic)
Troubleshooting
To access the encryption dictionary:
./pdf2john.py tests/pdf/pypdf/r6-user-password.pdf --debug
Acknowledgement
This repository was based on the original pdf2john.py by Shane Quigley
Metadata
Release files for pdf2john 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pdf2john-0.2.0.tar.gz | 4.5 kB | Without provenance | Details for pdf2john-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pdf2john-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for pdf2john-0.2.0-py3-none-any.whl |
Total release size: 9.7 kB
Release files / pdf2john-0.2.0.tar.gz
| Download URL | pdf2john-0.2.0.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f13595aece0f29bc9418b2761f37e89cd1ac297f5c0f0f0820b7be575c38b48d
|
|
BLAKE2b-256 checksum How to use checksums |
d61bf4c81177b5dc6b9cbe86e44bb46d18958fd3565fd6e89dd50944ab63c9f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.1 Linux/5.15.146.1-microsoft-standard-WSL2
|
Release files / pdf2john-0.2.0-py3-none-any.whl
| Download URL | pdf2john-0.2.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48de4ee6c68d5ee3f1f3cbd3dac7a21c71ec833d18bb8f109446eeccb2d37756
|
|
BLAKE2b-256 checksum How to use checksums |
03c45ad14c9b390427d6509d99b249e753289adc72717af5746e6261d4a79c25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.12.1 Linux/5.15.146.1-microsoft-standard-WSL2
|
Security for pdf2john 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.