Documentation ¶
Index ¶
- Constants
- func ComparePWHash(plaintext string, hashWithSalt string) bool
- func CreateHmac(message []byte, key []byte) []byte
- func DecryptAesCbc(iv, key, data []byte) ([]byte, error)
- func DecryptAesGcm(key []byte, cryptoText string) ([]byte, error)
- func EncryptAesCbc(iv []byte, key []byte, data []byte) ([]byte, error)
- func EncryptAesGcm(key []byte, plaintext []byte) (string, error)
- func NewPWHash(plaintext string, salt []byte) (string, error)
- func PermuteWithMask(original []byte, mask []byte) ([]byte, error)
- func Pkcs7Pad(data []byte, blocklen int) []byte
- func Pkcs7Unpad(data []byte, blocklen int) ([]byte, error)
- func RandomBytes(byteLength uint64) ([]byte, error)
- func ValidateHmac(sig []byte, message []byte, key []byte) bool
- func WrapTortilla(plaintext []byte, publicKey []byte, aesCharif []byte, aesTortilla []byte) ([]byte, error)
Constants ¶
View Source
const CBC_IV_SIZE uint64 = 16
View Source
const GCM_ADATA_SIZE uint64 = 16
View Source
const GCM_IV_SIZE uint64 = 12
View Source
const PASSWORD_KEY_LENGTH = 32
View Source
const SALT_LENGTH = 16
Variables ¶
This section is empty.
Functions ¶
func ComparePWHash ¶
func CreateHmac ¶
func DecryptAesCbc ¶
func DecryptAesGcm ¶
decrypt from base64 to decrypted string (strip iv->adata off front of ciphertext)
func EncryptAesGcm ¶
encrypt string to base64 crypto using AES GCM Mode (ciphertext is iv->adata->ciphertext)
func PermuteWithMask ¶
permute with mask
func Pkcs7Unpad ¶
Returns slice of the original data without padding.
func RandomBytes ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.