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

Uploaded Python 3

File details

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

File metadata

  • Download URL: page_encryptor-0.2.0.tar.gz
  • Upload date:
  • Size: 4.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 6bd5395571d2920ecf5b161ee4508458a228d3335b7ec40608d75ddea31fd7ce
MD5 057e9354ea3affbfe62ef1bc0b8c5634
BLAKE2b-256 cc77bda29643304480e45fe5258872454c37436dff6a46b9740054c0f6a7a50a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: page_encryptor-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59fcf92f734c416325858499cef528090c143ecfdc159677e2f40698f27a4933
MD5 ea40657f2dee0feac2f0dff48b3fb9cd
BLAKE2b-256 2e95c462f519da70899683d5abff6fb4f7f5b0ae36063657a45f91c7ac999248

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