mailchain / mailchain-legacy

Using Mailchain, blockchain users can now send and receive rich-media HTML messages with attachments via a blockchain address.
https://mailchain.xyz
Apache License 2.0
143 stars 51 forks source link

Hash ephemeral key #657

Open robdefeo opened 3 years ago

robdefeo commented 3 years ago

Is your feature request related to a problem? Please describe. Ephemeral key is not hashed in https://github.com/mailchain/mailchain/blob/f85c09ea74722525db86ce90aac433a9e729af6f/crypto/cipher/nacl/encrypter.go#L32 This is because if it is not hashed, we do not know how to prove any security property and there may be attacks against the scheme.

Describe the solution you'd like Libsodium provides an example https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_box/curve25519xsalsa20poly1305/box_curve25519xsalsa20poly1305.c#L45