pbkdf2

package module
v0.0.0-...-1092b15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2011 License: MIT Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstantTimeEq

func ConstantTimeEq(a []byte, b []byte) bool

func MatchPassword

func MatchPassword(password string, phash PasswordHash) bool

func Pbkdf2

func Pbkdf2(password []byte, salt []byte, iterations int, hash func() hash.Hash, outlen int) (out []byte)

Calculate password hash with PKCS#5 PBKDF2 method using the given hash function as HMAC.

Types

type PasswordHash

type PasswordHash struct {
	Salt []byte
	Hash []byte
}

func HashPassword

func HashPassword(password string) (out PasswordHash)

Call Pbkdf2 password hash with reasonable defaults (9999 iterations + SHA1 + 64 bytes output).

func HashPasswordWith

func HashPasswordWith(salt []byte, password string) (out PasswordHash)

Call Pbkdf2 with reasonable defaults (9999 iterations + SHA1 + 64 bytes output).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL