Documentation ¶
Index ¶
- Constants
- Variables
- func Decrypt(ciphertext []byte, key []byte) ([]byte, error)
- func DeriveKey(password string, salt []byte) ([]byte, error)
- func Encrypt(plaintext []byte, key []byte) ([]byte, error)
- func GenerateNonce(n uint8) []byte
- func HashData(data []byte) []byte
- func HashDataWithSalt(data, salt []byte) []byte
- func HashStringData(data string) []byte
- func HashStringWithSalt(data string, salt []byte) []byte
- func VerifyBytes(data []byte, hash []byte) bool
- func VerifyString(data string, hash []byte) bool
Constants ¶
View Source
const ( HashSaltLen = 64 HashKeyLen = 64 // 128-bit salt according to NIST SP 800-132 )
Variables ¶
View Source
var ErrInvalidSaltLen = fmt.Errorf("invalid salt length must be %d bytes", HashKeyLen)
Functions ¶
func DeriveKey ¶
Generate a random 128-bit salt according to NIST SP 800-132 Uses Argon2id to derive a 256-bit key from the password
func GenerateNonce ¶
func HashDataWithSalt ¶
func HashStringData ¶
func HashStringWithSalt ¶
func VerifyBytes ¶
func VerifyString ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.