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
  • 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.

🧩 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.4.0.tar.gz (6.5 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.4.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: page_encryptor-0.4.0.tar.gz
  • Upload date:
  • Size: 6.5 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.4.0.tar.gz
Algorithm Hash digest
SHA256 b0d235d3d1df98d98ab91d362e3021784bb0f45a0365d9729b2dd3f6e07c547e
MD5 879f68f00ca5393b8167156d2fd4c755
BLAKE2b-256 86af412378fd450e395173d0bce8df8684c861df4d9376495e28632c4bc0ea93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: page_encryptor-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 192ae06b2ba9f5d022a4c896ea3a85ef2c9b19c49c8a9e38ec6b3de2ae52047e
MD5 08ea0caa9b0dd62382c809218258904d
BLAKE2b-256 97319d60674d566158f5cf6fe7811e769efce06756488d02814f27bf0adfbce1

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