pbdk

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveKey

func DeriveKey(secret []byte) ([]byte, error)

DeriveKey derives a key as PBKDF2 from the specified secret string. HMAC is SHA 256, salt a random 16 bytes array, 2048 iterations. The returned key length is 32 bytes

func NewEncryptionKey

func NewEncryptionKey() ([]byte, error)

NewEncryptionKey generates a random 256-bit key for Encrypt() and Decrypt(). It panics if the source of randomness fails.

func NewSalt

func NewSalt(secret []byte) ([]byte, error)

NewSalt create pseudo random binary data (salt) that is used as an additional input to derive the encryption key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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