Small and user-friendly tool that enables the creation of AES-256 encrypted data URL bookmarklets. It allows users to input text, optionally formatted in markdown, or a URL, paired with a password. This tool then generates a data URL, which includes the encrypted data and all necessary decryption libraries. The generated URL can be saved as a bookmark and synchronized across devices through your browser's data sync feature.
For efficiency, data is compressed when the overhead of adding the decompression library is lower than the uncompressed state.
Additionally, the tool offers the functionality of opening direct URLs, providing a straightforward way to decrypt individual links.
- Uses AES-256 encryption to create data URL bookmarklets with your encrypted link/text.
- Supports markdown-formatted text, useful for notes.
- Directly opens single encrypted links.
- Embeds all necessary dependencies within the bookmarklet.
- Fully client side, generator runs on a basic webserver.
- Compresses data using deflate if it is smaller with the inflate library included in the bookmarklet.
- Enables editing by copying decrypted data to the clipboard and following the convenient link to the generator within the bookmarklet.
- Offers dark and light mode according to browser preferences, and is responsive.
- Custom tab title if the first line of the data is a heading, useful for tab hoarders and temporary notes.
- Includes a favicon, wow.
You can find a hosted version here. Alternatively, you can self-host or run locally:
- Either clone the repository or download the source files.
- Set up a local web server, or disable CORS in your browser if you plan to run the tool using the
file://
protocol. - Open
index.html
in a web browser. - Input your data (text, markdown, or a single link) and a password, then click "Generate Bookmarklet" to create an encrypted bookmarklet.
- Copy the generated bookmarklet by clicking the "Generated Bookmarklet" button that appears, or right-click and copy manually. Alternatively, drag this button to your bookmarks bar.
- To decrypt your bookmarklet, open it in your browser and input your password.
Since this tool operates in an unsecured context from a data URL, the browser's crypto.subtle
API cannot be used. Instead, aes-lib-js and forge-sha256 are utilized for data encryption and key derivation. These libraries were chosen because they were the smallest (non-gzipped) implementations I could find.
Bookmark size limitations vary across browsers, with Firefox (version 112) having a maximum of 64KB. Chrome and Edge do not appear to have this limitation. The minimum data size for a bookmarklet is approximately 39KB, allowing for encryption of 25KB (minus base64 encoding overhead) when size restricted.
To insert binary encrypted data into a data URL, it has to go through base64 encoding twice. The first round of encoding converts the binary data to a string for the bookmarklet template, while the second round is for creating a data URL from the full page, which increases its size by about 1.8 times. If compression is utilized, there will be an extra step of base64 encoding before the data gets encrypted. However, this added overhead is considered when deciding to use compression.
Dependencies and their licenses are included in the lib
directory.
- aes-lib-js for AES-256 in CBC mode.
- Forge's SHA-256 implementation for key derivation and data integrity verification.
- fflate for compression on the generator side.
- tiny-inflate for decompression on the bookmarklet side.
- terser for JavaScript minification during generation.
- Snarkdown for Markdown parsing.
- tailwindcss for generator styling.
This open-source project is available under the MIT License.