Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HmacCrypt ¶
type HmacCrypt struct {
// contains filtered or unexported fields
}
func New ¶
Returns a HmacCrypt using the specified hash (e.g. sha512.New) and pepper for its HMAC function. The pepper should be stored separately from the returned digests. If the digests are stored in a database, it is a good idea to store the pepper on the disk, or as a constant in the application itself.
func (*HmacCrypt) Bcrypt ¶
Generates a new bcrypt(HMAC-hash(password, pepper), salt(cost)) digest of a password with a given bcrypt cost/work factor, e.g. 10 (bcrypt.DefaultCost). Use BcryptCompare to compare a password to an existing digest.
func (*HmacCrypt) BcryptCompare ¶
Compares an existing bcrypt digest to HMAC-hash(password, pepper). Returns an error if there is no match.
Click to show internal directories.
Click to hide internal directories.