AES-256-GCM · Offline · CLI + GUI

Lock any HTML file.

PIN-protect and one-time-view any HTML file with AES-256-GCM. A cross-platform CLI plus a browser-based GUI that runs on any OS — the plaintext never leaves your device.

Free & fully offline — nothing to install. The Android .apk is sideload-only (allow installs from unknown sources).

No server, no accounts, no uploads Works offline as a PWA MIT licensed
GitHub stars License Release Last commit PyPI AES-256-GCM PIN-protected One-time view Cross-platform MIT Offline CLI + GUI
Protected document
Cipher AES-256-GCM
Key derivation Argon2id
View policy One-time
Network None needed
What's inside the vault

Security you can hand to anyone

LockHTML turns an ordinary file into a single self-contained page that asks for a PIN before it reveals anything. Strong cryptography, zero infrastructure.

AES-256-GCM encryption

Files are encrypted with AES-256-GCM — authenticated encryption, so a tampered file fails to open rather than silently decrypting to garbage.

Authenticated · tamper-evident

PIN protection

The key is derived from your PIN with memory-hard Argon2id (or PBKDF2-SHA256), and the PIN can never be recovered — only the right one opens the file.

Argon2id · PBKDF2

One-time view

Set a one-time view, a view limit, a “do not open before” time, or an expiry date. After the conditions are met, the document stops opening.

Views · expiry · not-before

CLI + browser GUI

The same engine, two front doors: a cross-platform command line for scripting and a self-contained HTML GUI you just open. Both speak the same file format.

One format · two interfaces

Runs on any OS — offline

Windows, Linux, macOS, Android and iOS. The GUI is a single HTML file that installs as a PWA and keeps working with no network at all.

Zero runtime for the recipient

Deeper vault tricks

Hidden volume, duress PIN, X25519 recipient mode, Shamir key splitting, keyfiles, Ed25519 signing, watermarking and age interoperability.

Advanced by design
How it works

Five steps, no server in sight

The locked file is a normal web page. Opening it runs a tiny viewer that decrypts in the browser — the plaintext never leaves the device.

1

Encrypt

Your file is encrypted with AES-256-GCM.

2

Derive the key

The key comes from your PIN via Argon2id (or PBKDF2) and a random salt.

3

Embed

Salt, IV and ciphertext are embedded as JSON inside a small viewer page.

4

Share

Email, message or copy the single locked .html file anywhere.

5

Unlock

The viewer asks for the PIN and decrypts in the browser, on the recipient's device.

See it in action

Try the live demo

The full browser GUI is deployed right here — drag in a file, set a PIN, and download a locked copy without installing anything.

The LockHTML browser GUI: drop files, set a PIN, and configure one-time view, keyfiles and advanced options
The GUI — drop a file, set a PIN, and tune every option straight from the browser.
A locked document asking for the PIN before revealing anything
A locked file asks for the PIN before revealing anything.

Open the app

The live GUI runs entirely in your browser. Nothing is uploaded.

  • Lock & Unlock / Verify tabs
  • Works offline after the first load
  • Installable as a PWA
Launch the demo
Get started

Two ways to lock a file

No install for the GUI; one command for the CLI. Both produce the same interoperable locked file.

Browser GUI — no install

Recommended first step

Open the live app, drag in your file, set a PIN and download the locked copy. It keeps working offline once loaded.

CLI — cross-platform

pip install lockhtml

One command on Windows, Linux and macOS. Lock a single file or a whole folder, script it, and unlock reversibly with the PIN.

terminal
# install
pip install lockhtml

# lock a file with a PIN
lockhtml lock report.html --pin 4821

# one-time view, Argon2id, watermark
lockhtml lock report.html --pin 4821 \
  --one-time --watermark "For A. Sharma"

# recover the original
lockhtml unlock report.locked.html --pin 4821
FAQ

Questions, answered

Everything you might want to know before you trust it with a file.

How strong is the encryption?
Files are encrypted with AES-256-GCM, an authenticated cipher. The key is derived from your PIN with memory-hard Argon2id (or PBKDF2-SHA256 as a lighter option) plus a random salt, so brute-forcing the PIN is deliberately expensive. The PIN itself is never stored.
What does “one-time view” actually guarantee?
It's a browser-enforced deterrent, not a server guarantee. Once the view limit or expiry is reached the viewer refuses to open the file — but a recipient can still copy the file or screenshot the decrypted page before that. Treat it as a strong speed-bump, not a DRM system.
What happens if I lose the PIN?
The PIN cannot be recovered — if it's lost, the file cannot be opened. That's the point of real encryption. Keep a copy of the PIN somewhere safe, and remember you can add a keyfile, a recipient public key, or Shamir-split shares as a backup path.
Is anything uploaded to a server?
No. There is no server, no account and no upload. The browser GUI does all its work locally with Web Crypto and a bundled Argon2 WASM module, and the CLI runs entirely on your machine. The GUI even keeps working offline after the first load.
Can I lock something other than HTML?
Yes. HTML renders inline, and any other file type — PDFs, photos, documents — is offered as a download after the PIN is entered. Large files can use a chunked streaming bundle that saves at constant memory.
What does the recipient need to open it?
Nothing but a modern browser. The locked file is a normal web page with a tiny viewer embedded — no install, no account, no runtime. That's what makes it easy to email, message or drop on a USB stick.