Documentation ¶
Overview ¶
Package crypto implements the following:- Basic encryption using aes and gcm Hmac with sha256 based hashing Random string generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrWrongPasswd = errors.New("crypto: wrong password")
ErrWrongPasswd is the error thrown when wrong password is given.
Functions ¶
func Generate ¶
Generate generates a random byte array of length "s" and returns it. This function is used to generate random passwords.
func HmacHash ¶
HmacHash hashes "s" with password "p" using hmac and sha256, appends it to "b" and returns it.
func HmacVerify ¶
HmacVerify verifies if "s" is equal to "a" in a secure way. Use this for hmac based hashes.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.