Documentation ¶
Index ¶
- func CS7Padding(ciphertext []byte, blockSize int) []byte
- func CS7UnPadding(origData []byte) ([]byte, error)
- func ZeroPadding(ciphertext []byte, blockSize int) ([]byte, error)
- func ZeroUnPadding(origData []byte) ([]byte, error)
- type EncodingWay
- type Encrypt
- func (e Encrypt) Decrypt(encrypted string, key string) (string, error)
- func (e Encrypt) EnCodding(encrypted []byte) string
- func (e Encrypt) Encrypt(orig string, key string) (string, error)
- func (e Encrypt) GetCipherBlock(encrypted []byte) (cipher.Block, error)
- func (e Encrypt) Padding(ciphertext []byte, blockSize int) ([]byte, error)
- func (e *Encrypt) UnEnCodding(encrypted string) ([]byte, error)
- func (e Encrypt) UnPadding(origData []byte) ([]byte, error)
- type EncryptMode
- type EncryptWay
- type NewEncryptOption
- type PaddingWay
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CS7Padding ¶
CS7Padding 补码 AES加密数据块分组长度必须为128bit(byte[16]),密钥长度可以是128bit(byte[16])、192bit(byte[24])、256bit(byte[32])中的任意一个。
func ZeroPadding ¶
ZeroPadding ...
Types ¶
type EncodingWay ¶
type EncodingWay uint
type Encrypt ¶
type Encrypt struct {
// contains filtered or unexported fields
}
func (Encrypt) GetCipherBlock ¶
GetCipherBlock ...
func (*Encrypt) UnEnCodding ¶
UnEnCodding ...
type NewEncryptOption ¶
type NewEncryptOption func(encrypt *Encrypt)
NewEncryptOption ...
func WithAesEncryptMode ¶
func WithAesEncryptMode(mode EncryptMode) NewEncryptOption
WithAesEncryptMode ...
func WithAesEncryptModePaddingWay ¶
func WithAesEncryptModePaddingWay(way PaddingWay) NewEncryptOption
WithAesEncryptModePaddingWay ...
type PaddingWay ¶
type PaddingWay uint
const ( PaddingWayCS7 PaddingWay = iota + 1 PaddingWayCS5 PaddingWayZero )
Click to show internal directories.
Click to hide internal directories.