mailchain: github.com/mailchain/mailchain/crypto/cipher/aes256cbc Index | Files

package aes256cbc

import "github.com/mailchain/mailchain/crypto/cipher/aes256cbc"

Package aes256cbc implements Advanced Encryption Standard with a 256 bit key length, using Chain Block Cipher mode (AES-256-CBC).

Index

Package Files

aes256cbc.go compression.go conversions.go data.go decrypter.go ecdh.go encoding.go encrypter.go

type Decrypter Uses

type Decrypter struct {
    // contains filtered or unexported fields
}

Decrypter will decrypt data using AES256CBC method

func NewDecrypter Uses

func NewDecrypter(privateKey crypto.PrivateKey) Decrypter

NewDecrypter create a new decrypter attaching the private key to it

func (Decrypter) Decrypt Uses

func (d Decrypter) Decrypt(data mc.EncryptedContent) (mc.PlainContent, error)

Decrypt data using recipient private key with AES in CBC mode.

type Encrypter Uses

type Encrypter struct {
    // contains filtered or unexported fields
}

Encrypter will encrypt data using AES256CBC method

func NewEncrypter Uses

func NewEncrypter() Encrypter

NewEncrypter create a new encrypter with crypto rand for reader

func (Encrypter) Encrypt Uses

func (e Encrypter) Encrypt(recipientPublicKey crypto.PublicKey, message mc.PlainContent) (mc.EncryptedContent, error)

Encrypt data using recipient public key with AES in CBC mode. Generate an ephemeral private key and IV.

Package aes256cbc imports 16 packages (graph) and is imported by 1 packages. Updated 2019-12-14. Refresh now. Tools for package owners.