Documentation ¶
Index ¶
- Variables
- func AnsiX923Padding(plaintext []byte, blockSize int) ([]byte, error)
- func AnsiX923UnPadding(ciphertext []byte, blockSize int) ([]byte, error)
- func ISO10126Padding(plaintext []byte, blockSize int) ([]byte, error)
- func ISO10126UnPadding(ciphertext []byte, blockSize int) ([]byte, error)
- func ISO97971Padding(plaintext []byte, blockSize int) ([]byte, error)
- func ISO97971UnPadding(ciphertext []byte, blockSize int) ([]byte, error)
- func PKCS7Padding(plaintext []byte, blockSize int) ([]byte, error)
- func PKCS7UnPadding(ciphertext []byte, blockSize int) ([]byte, error)
- func Padding(scheme PaddingScheme, plaintext []byte, blockSize int) (padded []byte, err error)
- func UnPadding(scheme PaddingScheme, ciphertext []byte, blockSize int) (data []byte, err error)
- func ZeroPadding(plaintext []byte, blockSize int) ([]byte, error)
- func ZeroUnPadding(ciphertext []byte, _ int) ([]byte, error)
- type BlockMode
- type CipherMethod
- type Crypt
- func NewAES(key, iv []byte, args ...Options) (*Crypt, error)
- func NewBlowfish(key []byte) (*Crypt, error)
- func NewChaCha20(key, iv []byte) (*Crypt, error)
- func NewDES(key, iv []byte, args ...Options) (*Crypt, error)
- func NewDES3(key, iv []byte, args ...Options) (*Crypt, error)
- func NewRC4(key []byte) (*Crypt, error)
- type Options
- type PaddingScheme
Constants ¶
This section is empty.
Variables ¶
View Source
var AES cryptAES
Shortcuts
View Source
var Blowfish cryptBlowfish
View Source
var ChaCha20 cryptChaCha20
View Source
var DES cryptDES
View Source
var DES3 tripleDES
View Source
var MD5 cryptMD5
View Source
var RC4 cryptRC4
View Source
var SHA3 cryptSha3
Functions ¶
func AnsiX923Padding ¶
ANSI X.923 padding
func ISO10126Padding ¶
ISO10126 implements ISO 10126 byte padding. This has been withdrawn in 2007.
func ISO97971Padding ¶
ISO/IEC 9797-1 Padding Method 2
func Padding ¶
func Padding(scheme PaddingScheme, plaintext []byte, blockSize int) (padded []byte, err error)
Types ¶
type CipherMethod ¶
type CipherMethod uint8
const ( METHOD_AES CipherMethod = iota METHOD_DES METHOD_DES3 METHOD_CHACHA20 METHOD_BLOWFISH METHOD_RC4 )
func (CipherMethod) String ¶
func (method CipherMethod) String() string
type Crypt ¶
type Crypt struct {
// contains filtered or unexported fields
}
func NewBlowfish ¶
func NewChaCha20 ¶
type Options ¶
type Options struct { Mode BlockMode Padding PaddingScheme }
type PaddingScheme ¶
type PaddingScheme uint8
const ( PAD_PKCS7 PaddingScheme = iota PAD_ISO97971 PAD_ANSIX923 PAD_ISO10126 PAD_ZEROPADDING PAD_NOPADDING )
func (PaddingScheme) String ¶
func (scheme PaddingScheme) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.