š Portable Secret
š Portable Secret
Better privacy, without special software.
(from: https://github.com/mprimi/portable-secret)
TL;DR;
Portable Secret is a little hack that allows you to:
- Send encrypted messages/images/files over insecure channels (email, messaging, ā¦)
- Store sensitive information (passwords, documents) in insecure locations (web, Cloud drives, USB drives)
Itās portable because: decrypting these secrets does not require special software! All you need is a browser.
I created Portable Secret to securely exchange documents via email with my mother, who canāt be expected to learn PGP, age, or similar.
I also use Portable Secret to store some my most sensitive secrets (private keys, 2FA recovery codes, etc.)
Finally, I use it to store copies of important documents (like a picture of passport). These documents are accessible to me from anywhere, even if all my trusted devices have been stolen or lost.
Sounds too good to be true? Keep reading. This is for you.
Portable Secret is not a product and it is barely a project. It is just a neat trick, a hack.
The source code and creator tool are provided as a demonstration.
How it works
A āPortable Secretā is simply an HTML file that also contains:
- An encrypted payload
- Some Javascript that calls into the browserās Web Cryptography APIs
Any (reasonably modern) web browser can open the file, even without an internet connection! If you know the password, you can recover the secret within.
Hereās an example (the password is banana
)
Notice that the file is self-contained and has no external dependencies! It can be carried on a USB drive and decrypted without an internet connection, on any device that has a web browser.
To understand how it works, go ahead and create yourself a secret. Download and inspect the generated Portable Secret.
The embedded code is straightforward:
- Take the password and generate a key
- Use the key to decrypt the payload
- Display the decrypted secret
How I use Portable Secret
Private communication
Do you want to communicate privately with people, but you canāt expect them to learn how to use PGP?
Send a Portable Secret. For example as email attachment.
Hey ___, attached to this email is the PDF and data you requested, but itās encrypted. Never double-click on attachments, itās dangerous! Give me a call when you get this, and Iāll show you how to read it.
Whenever they call me, I tell them:
Right-click on the attachment and āOpen withā¦ā any browser. The password is ābanana_splitā. Now you can save the decrypted PDF.
Store top-level secrets
Some secrets donāt belong in your password manager. Things like backup private keys, 2FS recovery keys, wallet keys, safe combinations, treasure maps, etc.
Using Portable Secret, I can keep copies of these critical keys all over the place (Cloud drives, USB drives, all my devices, etc).
Even if some of these copies end up stolen (e.g. I lose a USB stick), I am not concerned anyone will be able to recover the secrets within.
The passwords are long sequence of words that are trivial for me to remember (thanks to the hints provided), but impossible for anyone else to guess or crack.
Emergency documents on the go
Have you ever gotten stranded in a foreign country without any of your devices or documents? Itās not fun.
I keep a copy of my passport encrypted on the internet. Itās just an HTML file, itās easy to host. If I find myself stranded again, I can use any computer/device to retrieve it.
Hereās an example of ID document safely encrypted in plain sight.
Miscellaneous
Crack me if you can
Do you think this cannot possibly be secure? Great, prove it.
This secret contains the recovery key for a Bitcoin wallet. Crack it and take my money!
Choosing a good password
Choosing a strong-enough password is key (pun intended).
Eventually Iāll fill in this paragraph. For now all you get is the obligatory XKCD: correct-horse-battery-staple
On tools
Portable Secret is a tool. As such, it can be used wrong (e.g. weak password), or used to do bad things (e.g., exfiltrate intellectual property).
I cannot take responsibility for such misuse any more than a hammer manufacturer can take responsibility for me hammering my thumb, or using the hammer to attack someone.
Prior art
I came up with Portable Secret on my own, but I have since found a few projects that do something similar.
https://github.com/kaushalmeena/digi-cloak
https://9p4.github.io/hackna/
https://github.com/dividuum/html-vault
If you are aware of other similar projects, please let me know and Iāll link them here.
Feedback
I would love to hear what you think of this project, good, bad, or ugly.
Please use GH issue to report a problems and make suggestions. For everything else, start a GH Discussion.
You can also find my email on my homepage (linked from my GH profile).
Or discuss on HackerNews