feisty meow concerns codebase 2.140
crypto::cryptical_envelopment Class Referenceabstract

#include <cryptical_envelopment.h>

Inheritance diagram for crypto::cryptical_envelopment:
Collaboration diagram for crypto::cryptical_envelopment:

Public Member Functions

 cryptical_envelopment (const EVP_CIPHER *cipher_type)
 constructor requires the type of encryption to use.
 
 cryptical_envelopment (const cryptical_envelopment &to_copy)
 copy constructor.
 
virtual ~cryptical_envelopment ()
 
cryptical_envelopment & operator= (const cryptical_envelopment &to_copy)
 
bool set_key (int key_size)
 this will create a new random key of the "key_size", in bits.
 
bool set_key (const basis::byte_array &new_key, int key_size)
 sets the encryption key to "new_key" with a "key_size" in bits.
 
 DEFINE_CLASS_NAME ("cryptical_envelopment")
 
int key_size () const
 
virtual int minimum_key_size_in_bits () const =0
 returns the minimum key size in bits supported here.
 
virtual int maximum_key_size_in_bits () const =0
 returns the maximum key size in bits supported here.
 
const basis::byte_array & get_key () const
 returns our current key.
 
bool generate_key (int size, basis::byte_array &new_key)
 creates a "new_key" of the "size" (in bits) specified.
 
bool encrypt (const basis::byte_array &source, basis::byte_array &target) const
 encrypts the "source" array into the "target" array.
 
bool decrypt (const basis::byte_array &source, basis::byte_array &target) const
 decrypts the "target" array from the encrypted "source" array.
 
- Public Member Functions inherited from basis::nameable
virtual const char * class_name () const =0
 Returns the bare name of this class as a constant character pointer.
 

Static Public Member Functions

static const basis::byte_array & init_vector ()
 returns the initialization vector that is used by this class.
 

Detailed Description

Definition at line 31 of file cryptical_envelopment.h.

Constructor & Destructor Documentation

◆ cryptical_envelopment() [1/2]

crypto::cryptical_envelopment::cryptical_envelopment ( const EVP_CIPHER *  cipher_type)

constructor requires the type of encryption to use.

Definition at line 97 of file cryptical_envelopment.cpp.

References FUNCDEF, and crypto::static_ssl_initializer().

◆ cryptical_envelopment() [2/2]

crypto::cryptical_envelopment::cryptical_envelopment ( const cryptical_envelopment &  to_copy)

copy constructor.

Definition at line 106 of file cryptical_envelopment.cpp.

References FUNCDEF, LOG, and crypto::static_ssl_initializer().

◆ ~cryptical_envelopment()

crypto::cryptical_envelopment::~cryptical_envelopment ( )
virtual

Definition at line 116 of file cryptical_envelopment.cpp.

References FUNCDEF, LOG, and basis::WHACK().

Member Function Documentation

◆ decrypt()

◆ DEFINE_CLASS_NAME()

crypto::cryptical_envelopment::DEFINE_CLASS_NAME ( "cryptical_envelopment"  )

◆ encrypt()

◆ generate_key()

bool crypto::cryptical_envelopment::generate_key ( int  size,
basis::byte_array &  new_key 
)

◆ get_key()

const byte_array & crypto::cryptical_envelopment::get_key ( ) const

returns our current key.

Definition at line 137 of file cryptical_envelopment.cpp.

Referenced by cromp::cromp_client::login(), and octopi::encryption_infoton::prepare_blowfish_key().

◆ init_vector()

const byte_array & crypto::cryptical_envelopment::init_vector ( )
static

returns the initialization vector that is used by this class.

decryption of chunks that were encrypted by this class will require the same init vector as this function returns. this is mainly provided for third-party applications that want to be able to decrypt interoperably with this class. if you are creating such an application but for some reason cannot run this class in order to invoke this method, the vector is created by the algorithm in this class's implementation file (currently named cryptical_envelopment.cpp).

Definition at line 210 of file cryptical_envelopment.cpp.

References FUNCDEF, basis::array< contents >::length(), LOG, and crypto::static_ssl_initializer().

Referenced by decrypt(), and encrypt().

◆ key_size()

◆ maximum_key_size_in_bits()

virtual int crypto::cryptical_envelopment::maximum_key_size_in_bits ( ) const
pure virtual

returns the maximum key size in bits supported here.

Implemented in crypto::borked_blowfish_crypto, and crypto::twofish_crypto.

◆ minimum_key_size_in_bits()

virtual int crypto::cryptical_envelopment::minimum_key_size_in_bits ( ) const
pure virtual

returns the minimum key size in bits supported here.

Implemented in crypto::borked_blowfish_crypto, and crypto::twofish_crypto.

◆ operator=()

cryptical_envelopment & crypto::cryptical_envelopment::operator= ( const cryptical_envelopment &  to_copy)

Definition at line 139 of file cryptical_envelopment.cpp.

◆ set_key() [1/2]

bool crypto::cryptical_envelopment::set_key ( const basis::byte_array &  new_key,
int  key_size 
)

sets the encryption key to "new_key" with a "key_size" in bits.

Definition at line 148 of file cryptical_envelopment.cpp.

References DISCUSS_KEY_SIZE, DISCUSS_PROVIDED_KEY, FUNCDEF, and key_size().

◆ set_key() [2/2]

bool crypto::cryptical_envelopment::set_key ( int  key_size)

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