Skip to main content

🔐 page-encryptor

page-encryptor is a simple Python utility to encrypt static HTML pages offline and embed a JavaScript-based decryptor for in-browser access. It's inspired by PageCrypt by Max Laumeister, but is independently developed and substantially refactored for modern Python workflows and packaging.

✨ Features

  • AES-GCM encryption with PBKDF2 key derivation
  • Fully static: No server required
  • Runs offline — ideal for sensitive or private HTML content
  • Decrypts in-browser using an embeddable JavaScript template
  • Optional auto-unlock via ?pass=... in the URL
  • Designed for automation and integration into static site generators (e.g., 11ty)
  • Lightweight and dependency-minimal

📦 Installation

pip install page-encryptor

🚀 Usage

page-encryptor \
  --input path/to/file.html \
  --password your-secret-password \
  --template decryptor_template.html \
  --output protected-file.html

The template file must contain the placeholder /*__PAYLOAD__*/"" which will be replaced with the encrypted data payload in Base64. See decryptor_template.html.

Once encrypted, open the resulting HTML in any modern browser. You can enter the password manually, or append ?pass=your-secret-password to the URL to attempt automatic decryption.

🧩 Example

page-encryptor \
  --input index.html \
  --template decryptor_template.html \
  --output index-protected.html \
  --password hunter2

You can now open index-protected.html in a browser and enter your password to decrypt it in place.

🛠️ Development

To set up the project locally:

git clone https://github.com/yourname/page-encryptor.git
cd page-encryptor
python3 -m venv venv
source venv/bin/activate.fish
pip install .
pip install .[dev]

Run script:

cd page_encryptor
./encryptor.py --help

Run formatting and hooks:

pre-commit install
pre-commit run --all-files

Metadata

Release files for page-encryptor 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for page-encryptor 0.6.1
File Size Uploaded
page_encryptor-0.6.1.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for page-encryptor 0.6.1
File Interpreter ABI Platform
page_encryptor-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / page_encryptor-0.6.1.tar.gz

Download URL page_encryptor-0.6.1.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
dba2664e4745853169bd02051b942c7c9c92bb0afd2f53d3c6d80bd113cbc17b
BLAKE2b-256 checksum
How to use checksums
e7712e96b0fdbfb8da6faa299dbef8b56db9cf239d2ce0ca72cc8315fa51da5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / page_encryptor-0.6.1-py3-none-any.whl

Download URL page_encryptor-0.6.1-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4331d78b72cc3b71fee146e4414262ebb973ed57072bd328d6f2beede19f6791
BLAKE2b-256 checksum
How to use checksums
a7f44a38b98815398fe4335829815ba0d9afffe739557af102fa6e54605a0e6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page