Versions in this module Expand all Collapse all v0 v0.1.0 Dec 2, 2022 Changes in this version + var AES cryptAES + var Blowfish cryptBlowfish + var ChaCha20 cryptChaCha20 + var DES cryptDES + var DES3 tripleDES + var MD5 cryptMD5 + var RC4 cryptRC4 + var SHA3 cryptSha3 + 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 uint8 + const MODE_CBC + const MODE_CFB + const MODE_CTR + const MODE_ECB + const MODE_GCM + const MODE_OFB + func (mode BlockMode) Has(modes ...BlockMode) bool + func (mode BlockMode) Not(modes ...BlockMode) bool + func (mode BlockMode) String() string + type CipherMethod uint8 + const METHOD_AES + const METHOD_BLOWFISH + const METHOD_CHACHA20 + const METHOD_DES + const METHOD_DES3 + const METHOD_RC4 + func (method CipherMethod) String() string + type Crypt struct + 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) + func (c Crypt) Decrypt(src []byte) ([]byte, error) + func (c Crypt) Encrypt(src []byte) ([]byte, error) + type Options struct + Mode BlockMode + Padding PaddingScheme + type PaddingScheme uint8 + const PAD_ANSIX923 + const PAD_ISO10126 + const PAD_ISO97971 + const PAD_NOPADDING + const PAD_PKCS7 + const PAD_ZEROPADDING + func (scheme PaddingScheme) String() string