Versions in this module Expand all Collapse all v0 v0.0.3 Aug 16, 2021 v0.0.2 Aug 16, 2021 Changes in this version + const AES_128 + const AES_192 + const AES_256 + const CHACHA20 + const CHACHA20_POLY1305 + const CTR + const DES + const TDES + const XCHACHA20 + const XCHACHA20_POLY1305 + func GetAEADCipherFromString(cip string, key []byte) (cipher.AEAD, error) + func GetBlockCipherFromCipherString(cip string, key []byte) (cipher.Block, error) + func GetStreamCipherFromCipherString(cip string, key, nonce []byte) (cipher.Stream, error) + func PaddingPKCS5(src []byte, size int) []byte + func PaddingPKCS7(src []byte, size int) []byte + func RegistAEAD(cip string, getter AEADCipherGetter) + func RegistBlock(cip string, getter BlockCipherGetter) + func RegistStream(cip string, getter StreamCipherGetter) + func UnPaddingPKCS5(src []byte, size int) ([]byte, error) + func UnPaddingPKCS7(src []byte, size int) ([]byte, error) + type AEADCipherGetter func(key []byte) (cip cipher.AEAD, err error) + type BlockCipherGetter func(key []byte) (cip cipher.Block, err error) + type ModeGetter func(cip cipher.Block, iv []byte) (interface{}, error) + type Padder func(src []byte, size int) []byte + type PadderPair struct + P Padder + Un UnPadder + func PKCS5Padding() PadderPair + func PKCS7Padding() PadderPair + type StreamCipherGetter func(key, nonce []byte) (cip cipher.Stream, err error) + type UnPadder func(src []byte, size int) ([]byte, error) + type VAEAD struct + func (v *VAEAD) DecryptData(ciphertext, nonce, additional []byte) ([]byte, error) + func (v *VAEAD) EncryptData(plaintext, nonce, additional []byte) ([]byte, error) + type VBlock struct + func Upgrade(b cipher.Block) *VBlock + func (v *VBlock) CBC(iv []byte, pair PadderPair) *VBlockModePair + func (v *VBlock) CFB(iv []byte) *VStream + func (v *VBlock) CTR(iv []byte) cipher.Stream + func (v *VBlock) DecryptData(ciphertext []byte) ([]byte, error) + func (v *VBlock) EncryptData(plaintext []byte) ([]byte, error) + func (v *VBlock) GCM() (cipher.AEAD, error) + func (v *VBlock) OFB(iv []byte) cipher.Stream + type VBlockModePair struct + D cipher.BlockMode + E cipher.BlockMode + func NewVBlockMode(e, d cipher.BlockMode, p Padder, un UnPadder) *VBlockModePair + func (v *VBlockModePair) DecryptData(ciphertext []byte) ([]byte, error) + func (v *VBlockModePair) EncryptData(plaintext []byte) ([]byte, error) + type VCipher interface + DecryptData func([]byte) ([]byte, error) + EncryptData func([]byte) ([]byte, error) + type VStream struct + D cipher.Stream + E cipher.Stream + func NewVStream(e, d cipher.Stream) *VStream + func (v *VStream) DecryptData(ciphertext []byte) ([]byte, error) + func (v *VStream) EncryptData(plaintext []byte) ([]byte, error) v0.0.1 Aug 12, 2021