Documentation ¶
Index ¶
- Constants
- func GetAlgoAndMode(alg BlockCipherAlg) (string, string)
- func GetKeyAndIVSize(alg BlockCipherAlg) (int, int)
- func NewECBDecrypter(b cipher.Block) cipher.BlockMode
- func NewECBEncrypter(b cipher.Block) cipher.BlockMode
- type BlockCipherAlg
- type BlockCipherPadding
- type GoCryptoBlockCipherDecryptionCtx
- type GoCryptoBlockCipherDecryptor
- type GoCryptoBlockCipherEncryptionCtx
- type GoCryptoBlockCipherEncryptor
Constants ¶
View Source
const AES_BLOCK_SIZE = 16 //nolint:golint,stylecheck
View Source
const DOUBLE_DES_KEY_LEN = 16 //nolint:golint,stylecheck
View Source
const TDES_BLOCK_SIZE = 8 //nolint:golint,stylecheck
Variables ¶
This section is empty.
Functions ¶
func GetAlgoAndMode ¶
func GetAlgoAndMode(alg BlockCipherAlg) (string, string)
Function will take algorithm as input and
Return algo and mode in return
func GetKeyAndIVSize ¶
func GetKeyAndIVSize(alg BlockCipherAlg) (int, int)
Types ¶
type BlockCipherAlg ¶
type BlockCipherAlg string
const ( AES_256_CBC BlockCipherAlg = "aes-256-cbc" AES_192_CBC BlockCipherAlg = "aes-192-cbc" AES_128_CBC BlockCipherAlg = "aes-128-cbc" AES_256_ECB BlockCipherAlg = "aes-256-ecb" AES_192_ECB BlockCipherAlg = "aes-192-ecb" AES_128_ECB BlockCipherAlg = "aes-128-ecb" TDES_CBC BlockCipherAlg = "des-ede3-cbc" TDES_112_CBC BlockCipherAlg = "des-ede-cbc" TDES_192_ECB BlockCipherAlg = "des-ede3" TDES_128_ECB BlockCipherAlg = "des-ede" )
type BlockCipherPadding ¶
type BlockCipherPadding string
const ( PKCS7_CRYPTO_PADDING BlockCipherPadding = "pkcs7" NO_CRYPTO_PADDING BlockCipherPadding = "none" )
type GoCryptoBlockCipherDecryptionCtx ¶
type GoCryptoBlockCipherDecryptionCtx struct {
// contains filtered or unexported fields
}
func NewGoCryptoBlockCipherDecryptor ¶
func NewGoCryptoBlockCipherDecryptor() *GoCryptoBlockCipherDecryptionCtx
func (*GoCryptoBlockCipherDecryptionCtx) Final ¶
func (dc *GoCryptoBlockCipherDecryptionCtx) Final() ([]byte, error)
Final routine for decrytion
func (*GoCryptoBlockCipherDecryptionCtx) Init ¶
func (dc *GoCryptoBlockCipherDecryptionCtx) Init(alg BlockCipherAlg, pad BlockCipherPadding, key, iv []byte) error
Initialization routine for decrytion
type GoCryptoBlockCipherDecryptor ¶
type GoCryptoBlockCipherDecryptor interface { Init(alg BlockCipherAlg, pad BlockCipherPadding, key, iv []byte) error Update(ct []byte, final bool) ([]byte, error) Final() ([]byte, error) }
type GoCryptoBlockCipherEncryptionCtx ¶
type GoCryptoBlockCipherEncryptionCtx struct {
// contains filtered or unexported fields
}
Encryption context
func NewGoCryptoBlockCipherEncryptor ¶
func NewGoCryptoBlockCipherEncryptor() *GoCryptoBlockCipherEncryptionCtx
func (*GoCryptoBlockCipherEncryptionCtx) Final ¶
func (ec *GoCryptoBlockCipherEncryptionCtx) Final() ([]byte, error)
Final routine for encrytion
func (*GoCryptoBlockCipherEncryptionCtx) Init ¶
func (ec *GoCryptoBlockCipherEncryptionCtx) Init(alg BlockCipherAlg, pad BlockCipherPadding, key, iv []byte) error
Encryption context initialization
type GoCryptoBlockCipherEncryptor ¶
type GoCryptoBlockCipherEncryptor interface { Init(alg BlockCipherAlg, pad BlockCipherPadding, key, iv []byte) error Update(pt []byte, final bool) ([]byte, error) Final() ([]byte, error) }
Click to show internal directories.
Click to hide internal directories.