Documentation ¶
Overview ¶
Package benc 是用来处理加密的包
Index ¶
- func AesDecFromBase64(base64Str string, key []byte) ([]byte, error)
- func AesEncToBase64(originData, key []byte) (string, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PwdSlat(password, slat string) string
- func StrToMd5(b string) string
- func StrToSha256(b string) string
- type AesStruct
- func (as *AesStruct) CBCDecrypt() error
- func (as *AesStruct) CBCEncrypt() error
- func (as *AesStruct) GetCryptedData() []byte
- func (as *AesStruct) GetCryptedDataBase64() string
- func (as *AesStruct) GetIV() []byte
- func (as *AesStruct) GetKey() []byte
- func (as *AesStruct) SetIV(iv []byte) error
- func (as *AesStruct) SetKey(key []byte) error
- func (as *AesStruct) SetOriginData(originData []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecFromBase64 ¶ added in v0.0.4
AesDecFromBase64 数据解密
func AesEncToBase64 ¶ added in v0.0.4
AesEncToBase64 将数据 aes 加密, 并转成 base64 格式
Types ¶
type AesStruct ¶ added in v0.0.4
type AesStruct struct {
// contains filtered or unexported fields
}
AesStruct 为 Aes 操作定义一个结构
func NewAesEncrypt ¶ added in v0.0.4
NewAesEncrypt 初始化 aes 的结构
func NewAesEncryptFromBase64 ¶ added in v0.0.4
NewAesEncryptFromBase64 从 base64 字符串实例化
func (*AesStruct) CBCDecrypt ¶ added in v0.0.4
CBCDecrypt CBC 解密
func (*AesStruct) CBCEncrypt ¶ added in v0.0.4
CBCEncrypt CBC 加密
func (*AesStruct) GetCryptedData ¶ added in v0.0.4
GetCryptedData 获取加密或解密后的结果
func (*AesStruct) GetCryptedDataBase64 ¶ added in v0.0.4
GetCryptedDataBase64 获取 base64 格式的加密结果
func (*AesStruct) SetOriginData ¶ added in v0.0.4
SetOriginData 设置需要加密的数据
Click to show internal directories.
Click to hide internal directories.