Documentation ¶
Index ¶
- func AesECBDecrypt(ciphertext, key []byte) (plaintext []byte, err error)
- func CBCDecrypt(ssk, data, iv string) (bts []byte, err error)
- func CBCEncrypt(key, data string) (ciphertext []byte, err error)
- func MD5(str string) (string, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(plaintext []byte) ([]byte, error)
- func SignByMD5(data map[string]string, key string) (string, error)
- func Validate(rawData, ssk, signature string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CBCDecrypt ¶
CBCDecrypt CBC解密数据
@ssk 通过 Login 向微信服务端请求得到的 session_key @data 小程序通过 api 得到的加密数据(encryptedData) @iv 小程序通过 api 得到的初始向量(iv)
func CBCEncrypt ¶
CBCEncrypt CBC加密数据
func PKCS5Padding ¶
PKCS5Padding 补位 Golang AES没有64位的块, 如果采用PKCS5, 那么实质上就是采用PKCS7
func PKCS5UnPadding ¶
PKCS5UnPadding 反补 Golang AES没有64位的块, 如果采用PKCS5, 那么实质上就是采用PKCS7
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.