The Encrypt and Decrypt functions implemented an encryption and ciphering scheme using secp256k1 for ECDH key exchange and AES-256-CBC for ciphering of message plaintext, combined with HMAC-SHA256 for message authentication (as the CBC block mode is otherwise vulnerable to message tampering). This change removes these functions because they are unused within the Decred project, and we wish to discourage their use. Instead, we recommend callers to derive a shared key using secp256k1 for use with a modern symmetric encryption scheme. This remains possible through the ECDH function GenerateSharedSecret (which is not being removed at this time) and using this key with an AEAD cipher such as AES-256-GCM or ChaCha20-Poly1305. Examples which demonstrated use of the Encrypt/Decrypt functions have been replaced with an example demonstrating usage of GenerateSharedSecret to encrypt a message using AES-256-GCM. While here, the doc comment for GenerateSharedSecret has been updated to reflect that the function has been changed to correctly conform to RFC 5903. |
||
|---|---|---|
| .. | ||
| edwards | ||
| secp256k1 | ||
| common.go | ||
| go.mod | ||