CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cipher::CipherAes256Cbc Class Reference

#include <encrypt.h>

Inheritance diagram for cipher::CipherAes256Cbc:
Collaboration diagram for cipher::CipherAes256Cbc:

Public Member Functions

virtual ~CipherAes256Cbc ()
 
virtual std::string name () const
 
virtual Algorithms algorithm () const
 
virtual unsigned key_size () const
 
virtual unsigned iv_size () const
 
virtual unsigned block_size () const
 
- Public Member Functions inherited from cipher::Cipher
virtual ~Cipher ()
 
bool Encrypt (const std::string &plaintext, const Key &key, std::string *ciphertext)
 

Static Public Attributes

static const unsigned kKeySize = 256/8
 
static const unsigned kIvSize = 128/8
 
static const unsigned kBlockSize = 128/8
 

Protected Member Functions

virtual std::string DoEncrypt (const std::string &plaintext, const Key &key)
 
virtual std::string DoDecrypt (const std::string &ciphertext, const Key &key)
 
- Protected Member Functions inherited from cipher::Cipher
 Cipher ()
 

Private Member Functions

 FRIEND_TEST (T_Encrypt, Aes_256_Cbc_Iv)
 
shash::Md5 GenerateIv (const Key &key)
 

Additional Inherited Members

- Static Public Member Functions inherited from cipher::Cipher
static CipherCreate (const Algorithms a)
 
static bool Decrypt (const std::string &ciphertext, const Key &key, std::string *plaintext)
 

Detailed Description

Uses OpenSSL EVP_... format. The IV is created from the system time.

Definition at line 117 of file encrypt.h.

Constructor & Destructor Documentation

virtual cipher::CipherAes256Cbc::~CipherAes256Cbc ( )
inlinevirtual

Definition at line 125 of file encrypt.h.

Member Function Documentation

virtual Algorithms cipher::CipherAes256Cbc::algorithm ( ) const
inlinevirtual

Implements cipher::Cipher.

Definition at line 128 of file encrypt.h.

virtual unsigned cipher::CipherAes256Cbc::block_size ( ) const
inlinevirtual

Implements cipher::Cipher.

Definition at line 131 of file encrypt.h.

string cipher::CipherAes256Cbc::DoDecrypt ( const std::string &  ciphertext,
const Key key 
)
protectedvirtual

Implements cipher::Cipher.

Definition at line 216 of file encrypt.cc.

Here is the call graph for this function:

string cipher::CipherAes256Cbc::DoEncrypt ( const std::string &  plaintext,
const Key key 
)
protectedvirtual

Implements cipher::Cipher.

Definition at line 277 of file encrypt.cc.

Here is the call graph for this function:

cipher::CipherAes256Cbc::FRIEND_TEST ( T_Encrypt  ,
Aes_256_Cbc_Iv   
)
private
shash::Md5 cipher::CipherAes256Cbc::GenerateIv ( const Key key)
private

The block size of AES-256-CBC happens to be the same of the MD5 digest (128 bits). Use the HMAC of a UUID to make it random and unpredictable.

Definition at line 331 of file encrypt.cc.

Here is the call graph for this function:

virtual unsigned cipher::CipherAes256Cbc::iv_size ( ) const
inlinevirtual

Implements cipher::Cipher.

Definition at line 130 of file encrypt.h.

virtual unsigned cipher::CipherAes256Cbc::key_size ( ) const
inlinevirtual

Implements cipher::Cipher.

Definition at line 129 of file encrypt.h.

virtual std::string cipher::CipherAes256Cbc::name ( ) const
inlinevirtual

Implements cipher::Cipher.

Definition at line 127 of file encrypt.h.

Member Data Documentation

const unsigned cipher::CipherAes256Cbc::kBlockSize = 128/8
static

Definition at line 123 of file encrypt.h.

const unsigned cipher::CipherAes256Cbc::kIvSize = 128/8
static

Definition at line 122 of file encrypt.h.

const unsigned cipher::CipherAes256Cbc::kKeySize = 256/8
static

Definition at line 121 of file encrypt.h.


The documentation for this class was generated from the following files: