Documentation ¶
Overview ¶
Package cryptography provides symmetric authenticated encryption using 256-bit AES-GCM with a random nonce.
Index ¶
Constants ¶
const PasswordCost = 14
Variables ¶
This section is empty.
Functions ¶
func CheckPasswordHash ¶
CheckPasswordHash compares a bcrypt hashed password with its possible plaintext equivalent. Returns bool if the password match, false otherwise.
func Decrypt ¶
Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.
func HashPassword ¶
HashPassword generates a bcrypt hash of the password. Uses a work factor of PasswordCost.
Types ¶
This section is empty.