Documentation ¶
Overview ¶
Package ecb implements block cipher mode of encryption ECB (Electronic Code Book) functions. This is implemented for legacy purposes only and should not be used for any new encryption needs. Use CBC (Cipher Block Chaining) instead.
Index ¶
- func AESECBPKCS7Decrypt(cipherData, key []byte) (decrypted []byte, err error)
- func AESECBPKCS7Encrypt(pt, key []byte) (encrypted []byte, err error)
- func GetRandString(length int) string
- func GetRandStringWithCharset(length int, charset string) string
- func Map2XML(kvs map[string]string) (text []byte, err error)
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func StructToMapByXMLTag(item interface{}, result map[string]interface{})
- func XML2Map(text []byte) (result map[string]string, err error)
- type CDATA
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESECBPKCS7Decrypt ¶
AES decryption with ECB and PKCS7 padding
AES算法有AES-128、AES-192、AES-256三种,分别对应的key是 16、24、32字节长度 ¶
对应的加密解密区块长度BlockSize也是16、24、32字节长度
func AESECBPKCS7Encrypt ¶
AES encryption with ECB and PKCS7 padding
AES算法有AES-128、AES-192、AES-256三种,分别对应的key是 16、24、32字节长度 ¶
对应的加密解密区块长度BlockSize也是16、24、32字节长度
func GetRandStringWithCharset ¶
GetRandStringWithCharset 获取指定字符集 下 指定长度的随机字符串
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic codebook (ECB) mode, using the given Block.
func NewECBEncrypter ¶
NewECBEncrypter returns a BlockMode which encrypts in elecronic codebook (ECB) mode, using the given Block (Cipher).
func StructToMapByXMLTag ¶
func StructToMapByXMLTag(item interface{}, result map[string]interface{})