mailchain: Index | Files

package noop

import ""

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.


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 {
    // contains filtered or unexported fields

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(pubKey crypto.PublicKey) (*Encrypter, error)

NewEncrypter create a new encrypter with crypto rand for reader

func (Encrypter) Encrypt Uses

func (e Encrypter) Encrypt(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) and is imported by 1 packages. Updated 2020-02-29. Refresh now. Tools for package owners.