Documentation ¶
Overview ¶
CBC describes a block cipher mode. In cryptography, a block cipher mode of operation is an algorithm that uses a block cipher to provide an information service such as confidentiality or authenticity. A block cipher by itself is only suitable for the secure cryptographic transformation (encryption or decryption) of one fixed-length group of bits called a block. A mode of operation describes how to repeatedly apply a cipher's single-block operation to securely transform amounts of data larger than a block.
This package simplifies the usage of AES-256-CBC.
Package cipher is a package for common encrypt/decrypt of symmetric key messages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrInvalidBlockSize indicates hash blocksize <= 0. ErrInvalidBlockSize = errors.New("invalid blocksize") // ErrInvalidPKCS7Data indicates bad input to PKCS7 pad or unpad. ErrInvalidPKCS7Data = errors.New("invalid PKCS7 data (empty or not padded)") // ErrInvalidPKCS7Padding indicates PKCS7 unpad fails to bad input. ErrInvalidPKCS7Padding = errors.New("invalid padding on input") )
PKCS7 errors.
Functions ¶
func DecryptCbc ¶
Decrypt is a function that decrypts a given cipher text with a provided key and initialization vector(iv).
func EncryptCbc ¶
Encrypt is a function that encrypts plaintext with a given key and an optional initialization vector(iv).
Types ¶
This section is empty.