Documentation
¶
Index ¶
Constants ¶
View Source
const ( // KeySize is the size of the encryption key. KeySize = 32 // SaltSize is the size of the argon2id salt. SaltSize = 16 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crypter ¶
type Crypter interface {
// Encrypt encrypts the plaintext.
Encrypt(b []byte) ([]byte, error)
// Decrypt decrypts the ciphertext created by Encrypt.
Decrypt(b []byte) ([]byte, error)
// Serialize serializes the Crypter. Use the Deserialize function to create
// a Crypter from the resulting bytes. Deserializing requires the password
// used to create the Crypter.
Serialize() []byte
// Close zeros the encryption key. The Crypter is useless after closing.
Close()
}
Crypter is an interface for an encryption key and encryption/decryption algorithms. Create a Crypter with the NewCrypter function.
func Deserialize ¶
Deserialize deserializes the Crypter for the password.
func NewCrypter ¶
NewCrypter derives an encryption key from a password string.
Click to show internal directories.
Click to hide internal directories.