mcpField
P
protect-with-password

protect-with-password

github.com/transilienceaiDocuments598102 installsUpdated 13w ago
Repository

About protect-with-password

Protect With Password generates or accepts one password and creates protected copies of referenced files without altering the originals. It uses native AES-256 for PDFs and AES-256 7-Zip archives for other files, and reports failures rather than using weaker encryption.

Key features

  1. 01Generate or reuse one password
  2. 02Protect PDFs with native AES-256
  3. 03Wrap other files in AES-256 7-Zip archives
  4. 04Write copies without changing originals
  5. 05Save password with restricted file permissions
  6. 06Report failures without weaker encryption fallback

Use cases

  1. 01Protect a set of referenced files with one password
  2. 02Create password-protected PDF copies
  3. 03Package Office documents or other files in encrypted archives

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/transilienceai/communitytools --skill protect-with-password

After installing, type/protect-with-passwordin Claude Code to confirm it loaded.

Details

From the project README

Protect With Password

Mint a single strong password and password-protect every referenced file with it, "accordingly" per file type. Deterministic, non-destructive (originals are never touched), AES-256 or nothing.

Run it

python3 tools/protect_with_password.py FILE [FILE ...] \
    [--password PW] [--length 24] [--out-dir DIR] \
    [--password-file PATH | --no-password-file]
  • Pass every file the user referenced as positional arguments.
  • By default a strong password is generated (--password overrides to reuse one).
  • Protected copies are written alongside each input, or into --out-dir.
  • The tool prints a JSON summary on stdout and a password banner on stderr, and (unless --no-password-file) writes the password to a chmod-600 PROTECT-PASSWORD.txt.

How each type is protected

FileProtectionResult
.pdfNative AES-256 (qpdf → pypdf fallback)<name>-protected.pdf — recipient is prompted for the password on open
.docx/.xlsx/.pptx, .doc/.xls/.ppt, images, anything elseAES-256 7-Zip archive (-mhe=on, filenames encrypted)<name>.7z — recipient extracts with the password (7-Zip / Keka / WinRAR)

Native in-file Office (MS-OFFCRYPTO "agile") encryption needs LibreOffice or a dedicated encryptor that is not bundled here, so Office files are wrapped in a strong AES-256 archive instead. If no AES-256 tool is available for a file, it is reported as a failure — never downgraded to weak ZipCrypto/RC4 (no false assurance).

After running

Relay the password to the user and remind them to share it OUT-OF-BAND — never in the same channel/email as the protected files — and to delete PROTECT-PASSWORD.txt once handed over. Exit code is 0 only if every file was protected; 1 if any failed (check results[].reason).

Related: tools/protect_deliverable.py does the engagement-wide variant (one protected PDF + an AES-256 deliverable zip); this skill protects an arbitrary set of individual files.

Comments

Markdown supported