Codex skill for decrypting known-password PDF files with qpdf.
This skill is intended for PDFs where the user already knows the password and is authorized to remove password protection. It does not support password cracking, brute forcing, guessing, or bypassing unknown access controls.
- Uses
qpdf --decryptto remove password protection from a PDF. - Defaults to in-place replacement: the final PDF keeps the original filename and original folder.
- Writes to a temporary file first, verifies the decrypted result, then replaces the original PDF.
- Verifies the final file with
qpdf --show-encryptionandqpdf --check. - Avoids leaving
_decrypted.pdf,_unlocked.pdf, numbered copies, or other final duplicate files unless explicitly requested.
The skill metadata includes English and Chinese triggers such as:
PDF解密pdf解密解密PDF去除PDF密码移除PDF密码已知密码的PDF原地解密覆盖原PDFqpdf --decryptpassword-protected PDFencrypted PDFdecrypt PDF with password
You can also invoke it explicitly:
Use $pdf-decrypt to decrypt this known-password PDF.
Install qpdf and make sure it is available on PATH.
Verify:
qpdf --versionCopy this folder into your Codex skills directory:
$CODEX_HOME/skills/pdf-decrypt
The installed folder should contain:
pdf-decrypt/
SKILL.md
agents/
openai.yaml
Restart Codex after installing or updating the skill so it can be picked up.
For an input file such as:
input.pdf
The skill uses a temporary file:
input.qpdf-decrypt.tmp.pdf
Then verifies it and replaces the original:
qpdf --password=<password> --decrypt "input.pdf" "input.qpdf-decrypt.tmp.pdf"
qpdf --show-encryption "input.qpdf-decrypt.tmp.pdf"
qpdf --check "input.qpdf-decrypt.tmp.pdf"
Move-Item -LiteralPath "input.qpdf-decrypt.tmp.pdf" -Destination "input.pdf" -Force
qpdf --show-encryption "input.pdf"
qpdf --check "input.pdf"Expected verification output includes:
File is not encrypted
- The default behavior overwrites the original PDF only after the temporary decrypted file passes verification.
- If the temporary file already exists before the run, the skill should stop instead of silently overwriting it.
- If a failed run leaves the one explicit temporary file created by the workflow, remove only that exact file path or ask the user before cleanup.
- Do not use this skill for unknown-password PDFs.