crypto

package
v0.0.0-...-6019ff8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAesIV

func GenerateAesIV() []byte

GenerateAesIV generates an IV with AES's BlockSize

func GenerateIV

func GenerateIV(blockSize int) (p []byte)

GenerateIV generates an IV for the given blocksize

func GenerateKey

func GenerateKey(bits int, key []byte) []byte

GenerateKey generates a hashed key based on the number of bits

func NewAesReader

func NewAesReader(r io.Reader, iv, key []byte) (io.Reader, error)

NewAesReader an alias for NewReader(r, iv, key, aes.NewCipher)

func NewAesWriter

func NewAesWriter(w io.Writer, iv, key []byte) (io.Writer, error)

NewAesWriter alias for NewWriter(w, iv, key, aes.NewCipher)

func NewReader

func NewReader(r io.Reader, iv, key []byte, init CryptoInitilizer) (io.Reader, error)

NewReader returns a new Reader with the specific crypto Algroithm Note that it uses CFB mode for streams.

func NewWriter

func NewWriter(w io.Writer, iv, key []byte, init CryptoInitilizer) (io.Writer, error)

NewReader returns a new Reader with the specific crypto Algroithm Note that it uses CFB mode for streams.

func ZeroSlice

func ZeroSlice(p []byte)

ZeroSlice sets all the bytes in a slice to 0, should be used on keys and IVs.

Types

type CryptoInitilizer

type CryptoInitilizer func(key []byte) (cipher.Block, error)

Jump to

Keyboard shortcuts

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