Cipher-block chaining encryption and decryption cryptographic service.
More...
#include <cppcms/crypto.h>
|
virtual unsigned | block_size () const =0 |
|
virtual unsigned | key_size () const =0 |
|
virtual void | set_key (key const &)=0 |
|
virtual void | set_iv (void const *ptr, size_t size)=0 |
|
virtual void | set_nonce_iv ()=0 |
|
virtual void | encrypt (void const *in, void *out, unsigned len)=0 |
|
virtual void | decrypt (void const *in, void *out, unsigned len)=0 |
|
Cipher-block chaining encryption and decryption cryptographic service.
- Note
- In order to use it, you must compile CppCMS with OpenSSL (libcrypto) or GNU-TLS (libgcrypt) library.
CBC encryption type
Enumerator |
---|
aes128 |
AES-128.
|
aes192 |
AES-192.
|
aes256 |
AES-256.
|
virtual unsigned cppcms::crypto::cbc::block_size |
( |
| ) |
const |
|
pure virtual |
Get the size of the block CBC works on
static std::auto_ptr<cbc> cppcms::crypto::cbc::create |
( |
cbc_type |
type | ) |
|
|
static |
Create a new cbc object that performs encryption using type method.
If the encryption method is not supported returns an empty pointer!
static std::auto_ptr<cbc> cppcms::crypto::cbc::create |
( |
std::string const & |
name | ) |
|
|
static |
Create a new cbc object that performs encryption using algorithm name
If the encryption method is not supported returns an empty pointer!
Currently supported aes128, aes192, aes256, with names "aes" = "aes-128" = "aes128" , "aes-192" "aes192", "aes-256" = "aes256". They require CppCMS to be compiled with OpenSSL or GNU-TLS library
virtual void cppcms::crypto::cbc::decrypt |
( |
void const * |
in, |
|
|
void * |
out, |
|
|
unsigned |
len |
|
) |
| |
|
pure virtual |
Decrypt the data in to out of size len. len should be multiple of block_size()
virtual void cppcms::crypto::cbc::encrypt |
( |
void const * |
in, |
|
|
void * |
out, |
|
|
unsigned |
len |
|
) |
| |
|
pure virtual |
Encrypt the data in to out of size len. len should be multiple of block_size()
virtual unsigned cppcms::crypto::cbc::key_size |
( |
| ) |
const |
|
pure virtual |
Get the required key size in bytes
virtual void cppcms::crypto::cbc::set_iv |
( |
void const * |
ptr, |
|
|
size_t |
size |
|
) |
| |
|
pure virtual |
Set initial vector value, size should be equal to block_size()
virtual void cppcms::crypto::cbc::set_key |
( |
key const & |
| ) |
|
|
pure virtual |
virtual void cppcms::crypto::cbc::set_nonce_iv |
( |
| ) |
|
|
pure virtual |
Set randomly created initial vector value
The documentation for this class was generated from the following file: