Documentation
¶
Index ¶
- Constants
- type EncryptCBC
- func (e *EncryptCBC) Decrypt(ciphertext string) (plaintext string, err error)
- func (e *EncryptCBC) DecryptBytes(cipherBytes []byte) (plainBytes []byte, err error)
- func (e *EncryptCBC) Encrypt(plaintext string) (ciphertext string, err error)
- func (e *EncryptCBC) EncryptBytes(plainBytes []byte) (cipherBytes []byte, err error)
- func (e *EncryptCBC) PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func (e *EncryptCBC) PKCS5UnPadding(origData []byte) []byte
Constants ¶
View Source
const ( //OFFSET 补齐字符的ascii码值与个数的偏移量 OFFSET = 0 BLOCK_SIZE = 16 IV_TYPE_KEY = 1 IV_TYPE_RAND = 2 ENCRYPT_TYPE_COMMON = 1 ENCRYPT_TYPE_PRIVATE = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EncryptCBC ¶
type EncryptCBC struct {
// contains filtered or unexported fields
}
EncryptCBC ... AES CBC模式的加密算法
func (*EncryptCBC) Decrypt ¶
func (e *EncryptCBC) Decrypt(ciphertext string) (plaintext string, err error)
Decrypt 解密方法
func (*EncryptCBC) DecryptBytes ¶
func (e *EncryptCBC) DecryptBytes(cipherBytes []byte) (plainBytes []byte, err error)
Decrypt 解密方法
func (*EncryptCBC) Encrypt ¶
func (e *EncryptCBC) Encrypt(plaintext string) (ciphertext string, err error)
Encrypt 加密方法
func (*EncryptCBC) EncryptBytes ¶
func (e *EncryptCBC) EncryptBytes(plainBytes []byte) (cipherBytes []byte, err error)
EncryptBytes 加密方法
func (*EncryptCBC) PKCS5Padding ¶
func (e *EncryptCBC) PKCS5Padding(ciphertext []byte, blockSize int) []byte
PKCS5Padding ...
func (*EncryptCBC) PKCS5UnPadding ¶
func (e *EncryptCBC) PKCS5UnPadding(origData []byte) []byte
PKCS5UnPadding ...
Click to show internal directories.
Click to hide internal directories.