Documentation ¶
Index ¶
- func NewECBDecrypter(block cipher.Block) cipher.BlockMode
- func NewECBEncrypter(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 ¶
func NewECBDecrypter ¶
NewECBDecrypter 实例化
Types ¶
type Cipher ¶
Cipher 提供了统一的接口对数据进行加密/解密操作.
func NewAESWith ¶
func NewAESWith(key []byte, mode CipherMode) (Cipher, error)
NewAESWith 根据指定的工作模式,创建AESCipher,算法秘钥长度128 192 256 位 , 使用秘钥作为初始向量
func NewBlockCipher ¶
NewBlockCipher 新建块加密
func NewDESWith ¶
func NewDESWith(key []byte, mode CipherMode) (Cipher, error)
NewDESWith 根据指定的工作模式,创建DESCipher,算法秘钥长度64位,使用秘钥作为初始向量
type CipherMode ¶
type CipherMode interface { SetPadding(padding Padding) CipherMode Cipher(block cipher.Block, iv []byte) Cipher }
CipherMode 为不同的工作模式提供了统一的接口来设置填充方式,创建Cipher。
func NewCBCMode ¶
func NewCBCMode() CipherMode
func NewCFBMode ¶
func NewCFBMode() CipherMode
func NewCTRMode ¶
func NewCTRMode() CipherMode
func NewECBMode ¶
func NewECBMode() CipherMode
func NewOFBMode ¶
func NewOFBMode() CipherMode
Click to show internal directories.
Click to hide internal directories.