crypto

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 14, 2016 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadPasswordKey

func LoadPasswordKey(password string, salt []byte, stretch int) ([]byte, error)

func NewKey

func NewKey() []byte

func NewPasswordKey

func NewPasswordKey(password string, stretch int) ([]byte, []byte, error)

Types

type Cipher

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

func LoadCipher

func LoadCipher(key, nonce []byte) (*Cipher, error)

func NewCipher

func NewCipher(key []byte) (*Cipher, error)

func (*Cipher) Decrypt

func (cipher *Cipher) Decrypt(ciphertext []byte) []byte

func (*Cipher) Encrypt

func (cipher *Cipher) Encrypt(plaintext []byte) []byte

func (*Cipher) GetNonce

func (cipher *Cipher) GetNonce() []byte

func (*Cipher) TryDecrypt

func (cipher *Cipher) TryDecrypt(ciphertext []byte) ([]byte, error)

type IncorrectPasswordError

type IncorrectPasswordError string

func (IncorrectPasswordError) Error

func (s IncorrectPasswordError) Error() string

type InvalidPasswordError

type InvalidPasswordError string

func (InvalidPasswordError) Error

func (s InvalidPasswordError) Error() string

Jump to

Keyboard shortcuts

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