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

📁 Template Format

The decryptor_template.html should contain the following placeholder:

/*{{ENCRYPTED_PAYLOAD}}*/""

This will be replaced with the actual encrypted payload in Base64.

🧠 Credits & Inspiration

This project is inspired by the excellent PageCrypt by Max Laumeister

🛠️ 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 -r requirements.txt

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.1.0.tar.gz (4.1 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.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: page_encryptor-0.1.0.tar.gz
  • Upload date:
  • Size: 4.1 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.1.0.tar.gz
Algorithm Hash digest
SHA256 39ab66b9cf4c85cbc75e8a2957b822b62e94a6f471bda9f6ed6dd9908dd4074c
MD5 1aedbd2e994ee2f1f1442b16d50b4407
BLAKE2b-256 dfd3adc628e3e1683b11dfde2d653fbb02dfdc91a4dca0c0f058e80842818235

See more details on using hashes here.

File details

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

File metadata

  • Download URL: page_encryptor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fc4bd8335cd0b5b96a876e48e585cba63352d4dfe13c87002cee6c9983018f13
MD5 bfcdaa8274fa17608655f17d682e23fc
BLAKE2b-256 6912d78f89d93e078d4e472d99a43d9fc818a1120462d181020c2d2e603fb003

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