Documentation
¶
Overview ¶
Package wcipher 用于加密和解密数据的包
Index ¶
- func NewECBDecrypt(block cipher.Block) cipher.BlockMode
- func NewECBEncrypt(block cipher.Block) cipher.BlockMode
- type Cipher
- func NewAES(key []byte) (Cipher, error)
- func NewAESWith(key []byte, mode CipherMode) (Cipher, error)
- func NewBlockCipher(padding Padding, encrypt, decrypt cipher.BlockMode) Cipher
- func NewDES(key []byte) (Cipher, error)
- func NewDESWith(key []byte, mode CipherMode) (Cipher, error)
- func NewStreamCipher(encrypt cipher.Stream, decrypt cipher.Stream) Cipher
- type CipherMode
- type Padding
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cipher ¶
Cipher 提供统一的加密/解密数据接口
func NewAESWith ¶
func NewAESWith(key []byte, mode CipherMode) (Cipher, error)
NewAESWith 根据指定的工作模式创建AES密码器, 算法密钥长度为128 192 256位,使用密钥作为初始向量。
func NewBlockCipher ¶
NewBlockCipher 创建新的块加密
func NewDESWith ¶
func NewDESWith(key []byte, mode CipherMode) (Cipher, error)
NewDESWith 根据指定的工作模式创建DES密码器, 算法密钥长度为64位,使用密钥作为初始向量。
type CipherMode ¶
type CipherMode interface {
SetPadding(padding Padding) CipherMode
Cipher(block cipher.Block, iv []byte) Cipher
}
CipherMode 为不同操作模式提供统一的填充方法设置接口
Click to show internal directories.
Click to hide internal directories.