import "github.com/mailchain/mailchain/crypto/cipher/nacl"
decrypter.go encoding.go encrypter.go nacl.go
type Decrypter struct {
// contains filtered or unexported fields
}
Decrypter will decrypt data using AES256CBC method
func NewDecrypter(privateKey crypto.PrivateKey) (*Decrypter, error)
NewDecrypter create a new decrypter attaching the private key to it
func (d Decrypter) Decrypt(data cipher.EncryptedContent) (cipher.PlainContent, error)
Decrypt data using recipient private key with AES in CBC mode.
type Encrypter struct {
// contains filtered or unexported fields
}
Encrypter will encrypt data using AES256CBC method
NewEncrypter create a new encrypter with crypto rand for reader
func (e Encrypter) Encrypt(recipientPublicKey crypto.PublicKey, message cipher.PlainContent) (cipher.EncryptedContent, error)
Encrypt contents with the recipients public key.
Package nacl imports 8 packages (graph) and is imported by 1 packages. Updated 2019-12-12. Refresh now. Tools for package owners.