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.0.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.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: page_encryptor-0.6.0.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.0.tar.gz
Algorithm Hash digest
SHA256 eb85acf6c2b4e3c7a48cdeb8c30a05ca86e0c430fa286507db8127a723fd2e13
MD5 008f722e256e8c6f1d173d054ec4b57b
BLAKE2b-256 b6fc0677ce1ab1be4873dad78a0b24708ba858a8a84d5024a4c975f4e4930ae5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: page_encryptor-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cba2fc93f4ed9840ce9bec13746ab6172b9e0c90bb56100fdfaa5288b16c4d63
MD5 2ff4a451226ff29fb7be3dcf7aba7b08
BLAKE2b-256 88503dbb2c2c931680139d7fdb863a7ab6ef466f930a723b70260701e7ac5eb6

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