Documentation ¶
Index ¶
- func AESDecryptByECB(text, key string) string
- func AESEncryptByECB(text, key string) string
- func AesECBDecrypt(crypted, key []byte) (origData []byte, err error)
- func AesECBEncrypt(src, key []byte) (crypted []byte, err error)
- func EcbDecrypt(data, key []byte) []byte
- func EcbEncrypt(data, key []byte) []byte
- func GcmDecrypt(ciphertext []byte, key []byte) (plaintext []byte, err error)
- func GcmEncrypt(plaintext []byte, key []byte) (ciphertext []byte, err error)
- func Get16BitMD5(noSign string) string
- func HmacSha256(message string, secret string) string
- func MD5(noSign string) string
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PKCS5Unpadding(origData []byte) []byte
- func Sha256Sign(noSign string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecryptByECB ¶
func AESEncryptByECB ¶
AESEncryptByECB golang和Java中的AES模式不一样:java aes默认加密模式为ECB golang 默认的是CBC模式
func AesECBDecrypt ¶ added in v1.0.4
func AesECBEncrypt ¶ added in v1.0.4
func EcbDecrypt ¶
func EcbEncrypt ¶
func GcmDecrypt ¶ added in v1.0.4
GcmDecrypt decrypts data using 128-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 GcmEncrypt ¶ added in v1.0.4
GcmEncrypt encrypts data using 128-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 Get16BitMD5 ¶
func NewECBDecrypter ¶ added in v1.0.4
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
func NewECBEncrypter ¶ added in v1.0.4
NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.
func PKCS5UnPadding ¶ added in v1.0.4
func PKCS5Unpadding ¶
Types ¶
This section is empty.