pbkdf2

package
v0.0.0-...-77a769f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HashFunc   = sha1.New // Hash function to use
	Iterations = 16384    // Number of iterations to use
	KeySize    = 32       // Output size of key (32 is suitable for AES256)
	SaltSize   = 16       // Size of salt. Recommend >8.
)

Functions

func MatchPassword

func MatchPassword(password string, ph *PasswordHash) bool

MatchPassword compares the input password with the password hash. It returns true if they match.

Types

type PasswordHash

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

Type PasswordHash stores a hashed version of a password.

func HashPassword

func HashPassword(password string) *PasswordHash

HashPassword generates a salt and returns a hashed version of the password.

func HashPasswordWithSalt

func HashPasswordWithSalt(password string, salt []byte) (ph *PasswordHash)

HashPasswordWithSalt hashes the password with the specified salt.

Jump to

Keyboard shortcuts

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