Documentation ¶
Index ¶
- func AES256CBCDecrypt(cipherText, key string) (string, error)
- func AES256CBCEncrypt(iv []byte, plainText, key, encoding string) (string, error)
- func AES256GCMDecrypt(params AES256GCMParams) (plaintext []byte, err error)
- func AES256GCMNounce(gcm cipher.AEAD) (nonce []byte, err error)
- func CompareHashes(expected, recieved hash.Hash) bool
- func HMAC256Sum(message, key, format string) (string, error)
- func MD5Sum(data, format string) (string, error)
- func PKCS7Pad(data []byte, blockSize int) ([]byte, error)
- func PKCS7Strip(data []byte, blockSize int) ([]byte, error)
- func RandomIV(length int) ([]byte, error)
- func SHA1Sum(data, format string) (string, error)
- func SHA256Sum(data, format string) (string, error)
- type AES256CBCCrypter
- type AES256GCMParams
- type HMACOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AES256CBCDecrypt ¶
func AES256CBCEncrypt ¶
func AES256GCMDecrypt ¶
func AES256GCMDecrypt(params AES256GCMParams) (plaintext []byte, err error)
func CompareHashes ¶
CompareHashes returns true if the provided hashes are equal
func HMAC256Sum ¶
HMAC256Sum hashes the input and returns a string in the specified encoding format
func PKCS7Strip ¶
PKCS7Strip remove pkcs7 padding
Types ¶
type AES256CBCCrypter ¶
AES256CBCCrypter hashes the input and returns a string in the specified encoding format
func NewAES256CBCCrypter ¶
func NewAES256CBCCrypter(iv, key []byte, disablePadding bool) *AES256CBCCrypter
NewAES256CBCCrypter returns an AES256CBCCrypter
type AES256GCMParams ¶
type AES256GCMParams struct { Key []byte Nonce []byte Ciphertext []byte Plaintext []byte AdditionalData []byte }
func AES256GCMEncrypt ¶
func AES256GCMEncrypt(params AES256GCMParams) (result AES256GCMParams, err error)
Click to show internal directories.
Click to hide internal directories.