July 2017
Beginner to intermediate
358 pages
10h 54m
English
bcrypt is another popular method of hashing passwords. It uses a variable number of rounds to generate the hash, which both slows down the ability to brute force the attack and the time it takes to generate the hash. Go has an implementation of bcrypt that is provided by the experimental packages at https://godoc.org/golang.org/x/crypto/bcrypt. To hash a password with bcrypt, we use the GenerateFromPassword method:
func GenerateFromPassword(password []byte, cost int) ([]byte, error)
The GenerateFromPassword method returns the bcrypt hash of the password at the given cost. The cost is a variable that allows you to increase the security of the returned hash at the expense of more processing time to generate it.
To check the equality ...
Read now
Unlock full access