Skip to content

Releases: rojohyd/cryptpdf

v0.1.1 — Initial Release

Choose a tag to compare

@rojohyd rojohyd released this 23 Feb 13:54

Minimal PDF encrypt/decrypt library with AES-256 (PDF Rev 5).

Features
encryptPDF — Encrypt any PDF buffer with user and/or owner password
decryptPDF — Decrypt with either password
AES-256-CBC per stream and string with random IVs
Spec-compliant Rev 5 security handler (Adobe Supplement to ISO 32000)
SHA-256 key derivation with embedded salts in U/O
Crypt filters (AESV3), Perms validation block
Zero external crypto dependencies — uses Web Crypto (Node 18+)
Ships ESM + CJS + TypeScript declarations
Peer dependency: pdf-lib
Usage
import { encryptPDF, decryptPDF } from 'cryptpdf';

const encrypted = await encryptPDF(pdfBytes, 'user-pass', 'owner-pass');
const decrypted = await decryptPDF(encrypted, 'user-pass');

v0.1.0 — Initial Release

Choose a tag to compare

@rojohyd rojohyd released this 23 Feb 13:51

Minimal PDF encrypt/decrypt library with AES-256 (PDF Rev 5).

Features

  • encryptPDF — Encrypt any PDF buffer with user and/or owner password
  • decryptPDF — Decrypt with either password
  • AES-256-CBC per stream and string with random IVs
  • Spec-compliant Rev 5 security handler (Adobe Supplement to ISO 32000)
  • SHA-256 key derivation with embedded salts in U/O
  • Crypt filters (AESV3), Perms validation block
  • Zero external crypto dependencies — uses Web Crypto (Node 18+)
  • Ships ESM + CJS + TypeScript declarations
  • Peer dependency: pdf-lib

Usage

import { encryptPDF, decryptPDF } from 'cryptpdf';

const encrypted = await encryptPDF(pdfBytes, 'user-pass', 'owner-pass');
const decrypted = await decryptPDF(encrypted, 'user-pass');