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

package noop

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

Package noop is a no operation encryption algorithm for use when the message is intended to be publically readable.

Noop implements the Encrypt and Decrypt interfaces to ensure that is is compatible with Mailchain protocol. It does not perform any encryption or decryption actions.

Index

Package Files

decrypter.go docs.go encoding.go encrypter.go

type Decrypter Uses

type Decrypter struct {
}

Decrypter will decrypt data using AES256CBC method

func NewDecrypter Uses

func NewDecrypter() Decrypter

NewDecrypter create a new decrypter attaching the private key to it

func (Decrypter) Decrypt Uses

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

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

type Encrypter Uses

type Encrypter struct {
}

Encrypter will not perform any operation when encrypting the message.

No operation (noop) encrypter is used when the contents of the message and envelope are intended to readable by the public.

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 cipher.PlainContent) (cipher.EncryptedContent, error)

Encrypt does not apply any encrption algortim. PlainContent will be return as EncryptedContent with the encryption method prepend as the first byte.

Package noop imports 3 packages (graph). Updated 2019-12-11. Refresh now. Tools for package owners.