Documentation ¶
Index ¶
- Constants
- func AesDecryptString(key []byte, iv []byte, encryptedData string) (string, error)
- func AesEncryptString(key []byte, iv []byte, src string) (string, error)
- func CBCPKCS5PaddingAesDecrypt(key []byte, iv []byte, encryptedData []byte) ([]byte, error)
- func CBCPKCS5PaddingAesEncrypt(key []byte, iv []byte, src []byte) ([]byte, error)
- func ECBPKCS5PaddingAesDecrypt(key []byte, encryptedData []byte) ([]byte, error)
- func ECBPKCS5PaddingAesEncrypt(key []byte, src []byte) ([]byte, error)
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- type AesCryptor
- type PKCS5Padding
Constants ¶
View Source
const ( BlockMode_CBC = "CBC" BlockMode_ECB = "ECB" Padding_PKCS5 = "PKCS5Padding" )
Variables ¶
This section is empty.
Functions ¶
func AesDecryptString ¶
解密字符串数据
func AesEncryptString ¶
加密字符串数据
func CBCPKCS5PaddingAesDecrypt ¶
解密数据 CBC PKCS5Padding
func CBCPKCS5PaddingAesEncrypt ¶
加密数据 CBC PKCS5Padding
func ECBPKCS5PaddingAesDecrypt ¶
解密数据 ECB PKCS5Padding
func ECBPKCS5PaddingAesEncrypt ¶
加密数据 ECB PKCS5Padding
func NewECBDecrypter ¶
NewECBDecrypter returns a BlockMode which decrypts in electronic code book mode, using the given Block.
Types ¶
type AesCryptor ¶
type AesCryptor struct {
// contains filtered or unexported fields
}
func NewAesCryptor ¶
func NewAesCryptor(key, iv []byte, mode, pad string) (*AesCryptor, error)
type PKCS5Padding ¶
type PKCS5Padding struct { }
PKCS5包装
func (*PKCS5Padding) Padding ¶
func (m *PKCS5Padding) Padding(cipherText []byte, blockSize int) []byte
func (*PKCS5Padding) UnPadding ¶
func (m *PKCS5Padding) UnPadding(encrypt []byte) []byte
Click to show internal directories.
Click to hide internal directories.