Documentation
¶
Index ¶
- Variables
- func AesDecryptCbc(ciphertext, key, iv []byte) (dec []byte, err error)
- func AesEncryptCbc(plaintext, key, iv []byte) (enc []byte, err error)
- func Md5(dataIn []byte) (dataOut []byte)
- func Sha1(dataIn []byte) (dataOut []byte)
- func Sha256(dataIn []byte) (dataOut []byte)
- func Sha512(dataIn []byte) (dataOut []byte)
- func Xor(data *([]byte), key byte)
- type HashAlgorithm
Constants ¶
This section is empty.
Variables ¶
View Source
var Hash = map[string](HashAlgorithm){ "MD5": Md5, "SHA1": Sha1, "SHA256": Sha256, "SHA512": Sha512, }
Hash provides quick access to hashing functions through a map.
Functions ¶
func AesDecryptCbc ¶
AesDecryptCbc decrypts ciphertext with a key and an IV.
func AesEncryptCbc ¶
AesEncryptCbc encrypts a plaintext byte slice in CBC mode. It returns an encrypted byte slice.
Types ¶
type HashAlgorithm ¶
A HashAlgorithm takes a slice of bytes, hashes it with an algorithm, and returns the hashed byte slice, which is more flexible/generic than a fixed array.
Click to show internal directories.
Click to hide internal directories.