aes

package
v0.0.0-...-602dc05 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2014 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const ITERATION_COUNT = 1000
View Source
const KEY_LENGTH = 32 // 32bytes = 256bits = AES256
View Source
const SALT_LENGTH = 8

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(input, passphrase string) (output []byte, decryptError error)

Decrypt some data using AES-256 with PKCS#7 Padding using an AES key derived via PBKDF2 with HMAC-SHA1

func Encrypt

func Encrypt(input []byte, passphrase string) (output string, encryptError error)

Encrypt some data using AES-256 with PKCS#7 Padding using an AES key derived via PBKDF2 with HMAC-SHA1

Types

type CouldNotObtainRandomIVError

type CouldNotObtainRandomIVError struct {
	Msg string
}

func (*CouldNotObtainRandomIVError) Error

func (err *CouldNotObtainRandomIVError) Error() string

type CouldNotObtainRandomSaltError

type CouldNotObtainRandomSaltError struct {
	Msg string
}

func (*CouldNotObtainRandomSaltError) Error

type IncorrectPassphraseError

type IncorrectPassphraseError struct{}

func (*IncorrectPassphraseError) Error

func (err *IncorrectPassphraseError) Error() string

type InvalidAESKeyError

type InvalidAESKeyError struct {
	Msg string
}

func (*InvalidAESKeyError) Error

func (err *InvalidAESKeyError) Error() string

type InvalidEncryptedDataError

type InvalidEncryptedDataError struct {
	Msg string
}

func (*InvalidEncryptedDataError) Error

func (err *InvalidEncryptedDataError) Error() string

type InvalidIVError

type InvalidIVError struct {
	Msg string
}

func (*InvalidIVError) Error

func (err *InvalidIVError) Error() string

type InvalidPassphraseError

type InvalidPassphraseError struct {
	Msg string
}

func (*InvalidPassphraseError) Error

func (err *InvalidPassphraseError) Error() string

type InvalidSaltError

type InvalidSaltError struct {
	Msg string
}

func (*InvalidSaltError) Error

func (err *InvalidSaltError) Error() string

Jump to

Keyboard shortcuts

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