This page documents the main functions and classes in the PDF-PyCrack core module.
::: pdf_pycrack.core.crack_pdf_password options: show_source: true show_root_heading: true show_root_toc_entry: false heading_level: 3
::: pdf_pycrack.validator options: show_source: true show_root_heading: true show_root_toc_entry: false heading_level: 4
::: pdf_pycrack.supervisor options: show_source: true show_root_heading: true show_root_toc_entry: false heading_level: 4
::: pdf_pycrack.password_generator options: show_source: true show_root_heading: true show_root_toc_entry: false heading_level: 4
::: pdf_pycrack.worker options: show_source: true show_root_heading: true show_root_toc_entry: false heading_level: 4
from pdf_pycrack import crack_pdf_password
# Simple usage with defaults
result = crack_pdf_password("encrypted.pdf")
print(result)
from pdf_pycrack import crack_pdf_password
# Custom configuration
result = crack_pdf_password(
pdf_path="document.pdf",
min_len=6,
max_len=8,
charset="0123456789abcdef",
num_processes=4,
batch_size_arg=1000,
report_worker_errors_arg=True
)
from pdf_pycrack import (
crack_pdf_password,
PasswordFound,
PasswordNotFound,
FileReadError,
NotEncrypted
)
result = crack_pdf_password("file.pdf")
if isinstance(result, PasswordFound):
print(f"Success! Password: {result.password}")
elif isinstance(result, PasswordNotFound):
print("Password not found with current parameters")
elif isinstance(result, FileReadError):
print(f"File error: {result.error}")
elif isinstance(result, NotEncrypted):
print("PDF is not encrypted")