Documentation ¶
Index ¶
- func AesDecrypt(msg, k string) (string, error)
- func AesEncrypt(src, k string) (string, error)
- func Base64UrlSafeEncode(source []byte) string
- func DecryptUseCBC(cipherText, key []byte, iv []byte) ([]byte, error)
- func DecryptUseCBCWithDefaultProtocol(cipherText, key []byte) ([]byte, error)
- func DecryptUseCTRNoPadding(cipherText, key, iv []byte) ([]byte, error)
- func EncryptUseCBC(plainText, key, iv []byte) ([]byte, error)
- func EncryptUseCBCWithDefaultProtocol(plainText, key []byte) ([]byte, error)
- func EncryptUseCTRNoPadding(plainText, key, iv []byte) ([]byte, error)
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- func NoPadding(cipherText []byte, blockSize int) []byte
- func NoUnPadding(origData []byte) []byte
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AesDecrypt ¶
func AesEncrypt ¶
func Base64UrlSafeEncode ¶
func DecryptUseCBC ¶ added in v1.1.0
Decrypt using cbc mode There are two kinds of panic that may occur: 1. When iv length do not equal block size 2. When key does not match the cipher text, and it always happens when do unpadding
func DecryptUseCBCWithDefaultProtocol ¶ added in v1.1.0
Decrypt using given iv parameter and cbc mode When key does not match the cipher text, it will panic
func DecryptUseCTRNoPadding ¶ added in v1.1.10
func EncryptUseCBC ¶ added in v1.1.0
Encrypt using cbc mode When iv length does not equal block size, it will panic
func EncryptUseCBCWithDefaultProtocol ¶ added in v1.1.0
Encrypt using random iv parameter and cbc mode Never panic, only possible to return an error
func EncryptUseCTRNoPadding ¶ added in v1.1.10
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 NoUnPadding ¶ added in v1.1.10
func PKCS5Padding ¶
func PKCS5UnPadding ¶
Types ¶
This section is empty.