Documentation ¶
Index ¶
- Constants
- func AESDecryptCBC(crypted, key string, iv string) ([]byte, error)
- func AESDecryptECB(crypted, key string) ([]byte, error)
- func AESEncryptCBC(origData []byte, key string, iv string) (string, error)
- func AESEncryptECB(origData []byte, key string) (string, error)
- func AesDecrypt(crypted, key []byte, iv string, mode AESEncryptoMode) ([]byte, error)
- func AesEncrypt(origData, key []byte, iv string, mode AESEncryptoMode) ([]byte, error)
- func Base64Decode(val string) ([]byte, error)
- func Base64Encode(val []byte) string
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(origData []byte) []byte
- func RSAEncryptNE(origData []byte, n *big.Int, e int) (string, error)
- type AESCryptoModeError
- type AESEncryptoMode
Constants ¶
View Source
const ( AESEncryptoModeECB = AESEncryptoMode(1) AESEncryptoModeCBC = AESEncryptoMode(2) )
Constants
Variables ¶
This section is empty.
Functions ¶
func AESDecryptCBC ¶
AESDecryptCBC decrypt
func AESDecryptECB ¶
AESDecryptECB aes decrypt
func AESEncryptCBC ¶
AESEncryptCBC encrypt
func AESEncryptECB ¶
AESEncryptECB encrypt
func AesDecrypt ¶
func AesDecrypt(crypted, key []byte, iv string, mode AESEncryptoMode) ([]byte, error)
AesDecrypt do aes decrypt
func AesEncrypt ¶
func AesEncrypt(origData, key []byte, iv string, mode AESEncryptoMode) ([]byte, error)
AesEncrypt do aes encrypt
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 PKCS7Padding ¶
PKCS7Padding do pkcs7 padding for aes encrypt
Types ¶
type AESCryptoModeError ¶
type AESCryptoModeError int
AESCryptoModeError error
func (AESCryptoModeError) Error ¶
func (k AESCryptoModeError) Error() string
Click to show internal directories.
Click to hide internal directories.