Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SymetricKeyLength is the length in bytes of the key used with the // AES-256 algorithm SymetricKeyLength = 32 // HmacKeyLength is the length in bytes of the key used in the HMAC // SHA-512 algorithm HmacKeyLength = 128 // HmacOutputLength is the length in bytes of the sum produced by the HMAC // SHA-512 algorithm. HmacOutputLength = 64 )
Variables ¶
This section is empty.
Functions ¶
func NewCrypter ¶
New creates and returns a new crypter. Keys are obtained by reading from the provided reader.
func NewCrypterFromFile ¶ added in v0.5.0
func NewRandomCrypter ¶ added in v0.5.0
func NewRandomCrypter() (*crypter, error)
Types ¶
type Crypter ¶
type Crypter interface { EncryptString(plaintext string) (string, error) DecryptString(message string) (string, error) }
A Crypter is an encrypter/decrypter.
type CrypterError ¶
type CrypterError struct {
Err string
}
CrypterError represents a run-time error in a crypter method.
func (CrypterError) Error ¶
func (e CrypterError) Error() string
Click to show internal directories.
Click to hide internal directories.