a simple-to-use script for embedding secret password-encrypted data into static web pages https://iliazeus.github.io/static-secret/encrypt.html
  • JavaScript 70.9%
  • HTML 29.1%
Find a file
2026-05-15 18:43:24 +05:00
.gitignore Initial commit 2024-01-19 17:02:27 +06:00
.prettierrc add first version 2024-01-19 17:03:32 +06:00
encrypt.html allow to get inline base64 encrypted data in the browser tool 2024-01-19 17:43:12 +06:00
example.html add first version 2024-01-19 17:03:32 +06:00
kodim03.png.encrypted add first version 2024-01-19 17:03:32 +06:00
LICENSE Initial commit 2024-01-19 17:02:27 +06:00
README.md change links in readme to not point to github 2026-05-15 18:43:24 +05:00
static-secret.js add license info to script 2024-01-19 17:51:50 +06:00

static-secret.js

static-secret is a simple-to-use script for embedding secret password-encrypted data into static web pages.

Usage

Encryption

There's a browser tool.

Save both the encrypted file and the data-static-secret value.

Embedding with auto-decryption

First, add the script to your web page. You can either reference the version hosted by me:

<script type="module" src="https://iliazeus.lol/static-secret/static-secret.js#decrypt"></script>

Or you can download the script, put it beside your page and reference your copy:

<script type="module" src="./static-secret.js#decrypt"></script>

Do not remove the #decrypt parameter - that's what enables the auto-decryption feature, so you don't have to write any JavaScript yourself.

Then, embed the encrypted data:

embedding images, audios and videos:
<img src="file.png.encrypted" data-static-secret="your-value-here">
<audio src="file.ogg.encrypted" data-static-secret="your-value-here"></audio>
<video src="file.mp4.encrypted" data-static-secret="your-value-here"></video>

embedding downloadable files:
<a download href="file.png.encrypted" data-static-secret="your-value-here">Download!</a>

encrypting the contents themselves:
<div data-static-secret="your-value-here">
base64 encrypted contents here (check the "Get base64-encoded contents" box).
</div>

To view encrypted files, you will need the same password that was used for encryption. By default, you pass it via the #p= parameter, as in this example:

https://iliazeus.lol/static-secret/example.html#p=kodak

Advanced

For advanced usage, consult the source code.