Documentation ¶
Overview ¶
Package saltissimo was developed to easily compare hash of salt password. Suppose you have saved like this data.
+--------------------------+ | PBDKF2_hex | secret_key | +--------------------------+ | 5f54e622... | 951ff34... | +--------------------------+
Then, you are passed any string. Assume that you are given a "password" here. You can use compare function looks like this:
saltissimo.CompareHexHash(sha256.New, "password", PBDKF2_hexstr, secret_key)
Index ¶
- Variables
- func B64Hash(hash func() hash.Hash, str string) (string, string, error)
- func CompareB64Hash(hash func() hash.Hash, str, b64Str, key string) (bool, error)
- func CompareHexHash(hash func() hash.Hash, str, hexStr, key string) (bool, error)
- func HexHash(hash func() hash.Hash, str string) (string, string, error)
- func PBDKF2B64(hash func() hash.Hash, str string, key []byte) string
- func PBDKF2Hex(hash func() hash.Hash, str string, key []byte) string
- func RandomBytes(l int) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SaltLength = 36 KeyLength = 32 Iter = 4096 )
SaltLength specifies the length of a random byte sequence. KeyLength, Iter for pbkdf2.Key arguments.
Functions ¶
func CompareB64Hash ¶
CompareB64Hash to compare passed string and PBDKF2 as base64 string.
func CompareHexHash ¶
CompareHexHash to compare passed string and PBDKF2 as hex string.
func RandomBytes ¶
RandomBytes generate a random byte slice.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.