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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file page_encryptor-0.3.0.tar.gz.
File metadata
- Download URL: page_encryptor-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25bdf1acf5226f98538917ba795418f2b07d9661f2fb2dd7ef0323ca5d5fa7b2
|
|
| MD5 |
d5ede2d1694a4f507274b0c6ae5e7e23
|
|
| BLAKE2b-256 |
2beff72855f2bd401838e2676a3133f2e8696cf835e1a97f90cf30485c12f12e
|
File details
Details for the file page_encryptor-0.3.0-py3-none-any.whl.
File metadata
- Download URL: page_encryptor-0.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41cf9270dbf3ec972179a1f88393b4a031a730c654ac696a58db7dec5b8301c5
|
|
| MD5 |
ee736393fd69a9876c0d5129ae0c38ad
|
|
| BLAKE2b-256 |
c15498c05b1dc691cd4fae861275ecbc5c59c8001b146e11d6ea1ebf20350a0d
|