hash

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Pbkdf2Hash256

func Pbkdf2Hash256(password string, salt []byte, iter int) string

Pbkdf2Hash256 returns a PBKDF2-SHA256 hash of the given password.

Example usage:

saltSize := 16
salt, err := libcrypto.GenerateSalt(saltSize)
if err != nil {
	panic(err)
}

passwordHash := hash.Pbkdf2Hash256("password", salt, 100000)

func Pbkdf2Hash512

func Pbkdf2Hash512(password string, salt []byte, iter int) string

Pbkdf2Hash512 returns a PBKDF2-SHA512 hash of the given password.

Example usage:

saltSize := 16
salt, err := GenerateSalt(saltSize)
if err != nil {
	panic(err)
}

passwordHash := hash.Pbkdf2Hash512("password", salt, 100000)

func Pbkdf2Match256

func Pbkdf2Match256(hash string, password string, salt []byte, iter int) bool

Pbkdf2Match256 validates the given password against the given hash (256-bit hash).

func Pbkdf2Match512

func Pbkdf2Match512(hash string, password string, salt []byte, iter int) bool

Pbkdf2Match512 validates the given password against the given hash (512-bit hash).

Types

This section is empty.

Jump to

Keyboard shortcuts

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