Documentation
¶
Index ¶
- Variables
- func AesCBCDecrypt(cryted, key string) result.Result[string]
- func AesCBCEncrypt(orig, key string) result.Result[string]
- func CheckPassword(hash, password string) error
- func Decrypt(ciphertext []byte, key *[32]byte) (plaintext []byte, err error)
- func Encrypt(plaintext []byte, key *[32]byte) (ciphertext []byte, err error)
- func HashPassword(password string) result.Result[string]
- func Hmac(key, data string) string
- func HmacSha256(key, data string) string
- func PKCS7Padding(ciphertext []byte, size int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func SecureKey() *[32]byte
- func SecureToken(lengths ...int) string
- type HMACSign
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func CheckPassword ¶
CheckPassword checks to see if the password matches the hashed password.
func Decrypt ¶
Decrypt decrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Expects input form nonce|ciphertext|tag where '|' indicates concatenation.
func Encrypt ¶
Encrypt encrypts data using 256-bit AES-GCM. This both hides the content of the data and provides a check that it hasn't been altered. Output takes the form nonce|ciphertext|tag where '|' indicates concatenation.
func HmacSha256 ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.