Skip to main content

Offline HTML encryption with in-browser decryption, inspired by PageCrypt

Project description

🔐 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

page_encryptor-0.6.1.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

page_encryptor-0.6.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file page_encryptor-0.6.1.tar.gz.

File metadata

  • Download URL: page_encryptor-0.6.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for page_encryptor-0.6.1.tar.gz
Algorithm Hash digest
SHA256 dba2664e4745853169bd02051b942c7c9c92bb0afd2f53d3c6d80bd113cbc17b
MD5 acd567f4d64056ccd56c334b440ac4b4
BLAKE2b-256 e7712e96b0fdbfb8da6faa299dbef8b56db9cf239d2ce0ca72cc8315fa51da5f

See more details on using hashes here.

File details

Details for the file page_encryptor-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: page_encryptor-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for page_encryptor-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4331d78b72cc3b71fee146e4414262ebb973ed57072bd328d6f2beede19f6791
MD5 cd14983e55a5aabfa56cfeb3192fc3d8
BLAKE2b-256 a7f44a38b98815398fe4335829815ba0d9afffe739557af102fa6e54605a0e6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page