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

nacl encrypter does not encrypt messages correctly #482

Closed robdefeo closed 4 years ago

robdefeo commented 4 years ago

Is your feature request related to a problem? Please describe. crypto/cipher/nacl uses SecretBox which is for symmetric encryption, this means that the implementation is incorrect it should of used Box. nacl.Box does not support ed25519 and sr25519 only x25519 so can not be used.

Describe the solution you'd like

Currently nacl is not used in to send any messages so it can safely be removed.

developerfred commented 4 years ago
  • remove crypto/cipher/nacl
  • [x] remove all references to crypto/cipher/nacl
  • [x] remove NACL byte = 0x2a from crypto/cipher/cipher.go
  • [x] remove all references to ciper.NACL
robdefeo commented 4 years ago

With the key exchange interface #497 and implementations in secp256k1 #501 , ed25519 #504, and sr25519 #505 and fix #528 it is now possible to the ECHD keys exchange for these key types and generate a shared secret which can be used with secretbox.