Documentation ¶
Overview ¶
Package pbkdf2 implements password-based key derivation using the PBKDF2 algorithm described in RFC 2898 and RFC 8018.
It provides a drop-in replacement for `golang.org/x/crypto/pbkdf2`, with the following benefits:
- Released as a module with semantic versioning
- Does not pull in dependencies for unrelated `x/crypto/*` packages
- Supports Go 1.9+
See https://tools.ietf.org/html/rfc8018#section-4 for security considerations in the selection of a salt and iteration count.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Key ¶
Key generates a derived key from a password using the PBKDF2 algorithm. The inputs include salt bytes, the iteration count, desired key length, and a constructor for a hashing function. For example, for a 32-byte key using SHA-256:
key := Key([]byte("trustNo1"), salt, 10000, 32, sha256.New)
Types ¶
This section is empty.