Documentation ¶
Overview ¶
Package pbkdf2 implements a Django compatible PBKDF2 algorithm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHashComponentUnreadable = errors.New("unchained/pbkdf2: unreadable component in hashed password") ErrHashComponentMismatch = errors.New("unchained/pbkdf2: hashed password components mismatch") ErrAlgorithmMismatch = errors.New("unchained/pbkdf2: algorithm mismatch") ErrSaltContainsDollarSing = errors.New("unchained/pbkdf2: salt contains dollar sign ($)") )
Errors returned by PBKDF2Hasher.
Functions ¶
This section is empty.
Types ¶
type PBKDF2Hasher ¶
type PBKDF2Hasher struct { // Algorithm identifier. Algorithm string // Defines the number of rounds used to encode the password. Iterations int // Defines the length of the hash in bytes. Size int // Defines the hash function used to encode the password. Digest func() hash.Hash }
PBKDF2Hasher implements PBKDF2 password hasher.
func NewPBKDF2SHA1Hasher ¶
func NewPBKDF2SHA1Hasher() *PBKDF2Hasher
NewPBKDF2SHA1Hasher secures password hashing using the PBKDF2 algorithm.
Alternate PBKDF2 hasher which uses SHA1, the default PRF recommended by PKCS #5.
This is compatible with other implementations of PBKDF2, such as openssl's PKCS5_PBKDF2_HMAC_SHA1().
func NewPBKDF2SHA256Hasher ¶
func NewPBKDF2SHA256Hasher() *PBKDF2Hasher
NewPBKDF2SHA256Hasher secures password hashing using the PBKDF2 algorithm.
Configured to use PBKDF2 + HMAC + SHA256. The result is a 64 byte binary string.
Click to show internal directories.
Click to hide internal directories.