Documentation ¶
Overview ¶
Package aesKit
更多可以参考:https://github.com/hwholiday/learning_tools/blob/master/encryption_algorithm/aes.go
Package aesKit ¶
AES/ECB/PKCS5Padding 参考:https://www.cnblogs.com/lavin/p/5373188.html 缺点:代码中有 panic 秘钥:长度必须是 16、24、32 中的一个!
Index ¶
- func Decrypt(cipherText, key []byte) (plainText []byte, err error)
- func DecryptToString(base64Text, key []byte) (string, error)
- func Encrypt(plainText, key []byte) (cipherText []byte, err error)
- func EncryptToString(plainText, key []byte) (string, error)
- 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 ZeroPadding(ciphertext []byte, blockSize int) []byte
- func ZeroUnpadding(origData []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptToString ¶
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
func NewECBEncrypter ¶
NewECBEncrypter returns a BlockMode which encrypts in electronic code book mode, using the given Block.
func PKCS5Padding ¶
func PKCS5Unpadding ¶
func ZeroPadding ¶
func ZeroUnpadding ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.