Idea: Embedding code, that can perform cryptographic operations, together with private keys.
Use case: You’re next to your colleague, and want to send something secret over Slack.
In short; when you download an Ecedehey HTML file from the demo, you can use it to encrypt files that can be sent to a receiver.
You can try it on palmenhq.dev/create-ecedehey.html. The code is available on github.com/palmenhq/ecedehey.
The concept is simple; An HTML file generates private keys, that are embedded into other HTML files (let’s call them private key HTML files). These private key HTML files can encrypt and decrypt content performing an asynchronous ECDH. The idea struck me when I found out that filesystem-served (file://
) files are considered a secure context in the browsers, as the WebCrypto API is only available in secure contexts.
These are the steps that are taken in Ecedehey to encrypt and then decrypt something:
Sounds great - and very straightforward, yeah? Well, if you’re not familiar with asymmetric cryptography it may seem messy - but jokes aside, I think this is a pretty standard procedure in asymmetrical cryptography.
So can you use this for production? NO! Please don’t. This was a fun experiment from my end, and shouldn’t be considered ready for sensitive values.
So how insecure is it, to be precise? Well, I think the cryptographic bits should be fine, as they are mostly handled by the browser - and I sure hope the bigtech™ browser vendor companies know how to get cryptography right. The main problem I can think of lies within how the keys are stored - in plain text on your disk. Any security expert will have a small heart attack if you tell them that’s your way of managing cryptographic keys. That being said, there might be other issues I’ve missed. If you find any - feel free to put an issue on GitHub ✨