aes

package
v0.0.0-...-1b2fc92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenKey

func GenKey() (string, error)

GenKey generates a 32 bytes key encoded in base64.

Types

type AES

type AES struct {
	// The encryption key must be 256 bits long.
	Key []byte

	// Alternativly to the key, a b64 encoded string can be set as the key
	// and will be decoded on start if Key is nil.
	KeyB64 string `json:"key"`
}

AES encryption encrypts with a key 256 bits key using an aes 256 cfb scheme and an IV that is appended to the output stream.

func (*AES) Decode

func (a *AES) Decode(r io.Reader, w io.Writer) error

Decode an encrypted stream that start with an IV.

func (*AES) Encode

func (a *AES) Encode(r io.Reader, w io.Writer) error

Encode encrypts a stream with the key and generates an IV that will be appended to the stream.

func (*AES) Start

func (a *AES) Start() error

Start the encoder.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL