Cool, but what I love more about this (post) is how helpful the comments are!<p>It reminds me of the old bash.org quote that basically said the best way to get help from the Internet is not to ask, but to assert an answer, and let people correct you.
Using libsodium, there are two routes you can go:<p><pre><code> - crypto_box() for authenticated public-key encryption
- crypto_box_seal() for anonymous public-key encryption
(with message authentication)
</code></pre>
I know for a fact that there are JS bindings for libsodium.<p><a href="http://doc.libsodium.org/bindings_for_other_languages/index.html" rel="nofollow">http://doc.libsodium.org/bindings_for_other_languages/index....</a><p>For PHP developers:<p><a href="https://github.com/paragonie/pecl-libsodium-doc/blob/master/chapters/05-publickey-crypto.md#crypto-box" rel="nofollow">https://github.com/paragonie/pecl-libsodium-doc/blob/master/...</a><p><a href="https://github.com/paragonie/pecl-libsodium-doc/blob/master/chapters/08-advanced.md#crypto-box-seal" rel="nofollow">https://github.com/paragonie/pecl-libsodium-doc/blob/master/...</a>
I have also built something similar, I knew of the existence of cipherhub, but my goal was to focus on the ease of use, with the browser (<a href="https://mailbeam.io" rel="nofollow">https://mailbeam.io</a> and <a href="https://github.com/bobbywilson0/gh-message" rel="nofollow">https://github.com/bobbywilson0/gh-message</a>). I do admit that my solution is not as easy as it should be yet.<p>You should consider with RSA keys have a limited size message that can be encrypted (e.g. for 2048 bit keys you are limited to 256 bytes in your message). My solution was to use the SSH key to encrypt the secret I used to encrypt the message with.
IIRC, asymmetric key encryption is not preferred for large message lengths -- maybe the author could consider embedding an randomly generated AES key, and using that to encrypt the message instead?