|
feisty meow concerns codebase 2.140
|
#include <cryptical_envelopment.h>


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. | |
Definition at line 31 of file cryptical_envelopment.h.
| 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().
| 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().
|
virtual |
Definition at line 116 of file cryptical_envelopment.cpp.
References FUNCDEF, LOG, and basis::WHACK().
| bool crypto::cryptical_envelopment::decrypt | ( | const basis::byte_array & | source, |
| basis::byte_array & | target | ||
| ) | const |
decrypts the "target" array from the encrypted "source" array.
Definition at line 306 of file cryptical_envelopment.cpp.
References basis::array< contents >::access(), ALWAYS_LOG, basis::nameable::class_name(), ERROR_BAILOUT, crypto::FUDGE, FUNCDEF, GET_SSL_ERROR, init_vector(), basis::array< contents >::last(), basis::array< contents >::length(), LOG, NULL_POINTER, basis::array< contents >::observe(), basis::array< contents >::reset(), and basis::array< contents >::zap().
Referenced by octopi::encryption_tentacle::consume().
| crypto::cryptical_envelopment::DEFINE_CLASS_NAME | ( | "cryptical_envelopment" | ) |
| bool crypto::cryptical_envelopment::encrypt | ( | const basis::byte_array & | source, |
| basis::byte_array & | target | ||
| ) | const |
encrypts the "source" array into the "target" array.
Definition at line 228 of file cryptical_envelopment.cpp.
References basis::array< contents >::access(), ALWAYS_LOG, basis::nameable::class_name(), ERROR_BAILOUT, crypto::FUDGE, FUNCDEF, GET_SSL_ERROR, init_vector(), basis::array< contents >::last(), basis::array< contents >::length(), LOG, NULL_POINTER, basis::array< contents >::observe(), basis::array< contents >::reset(), and basis::array< contents >::zap().
Referenced by cromp::cromp_server::wrap_infoton().
| bool crypto::cryptical_envelopment::generate_key | ( | int | size, |
| basis::byte_array & | new_key | ||
| ) |
creates a "new_key" of the "size" (in bits) specified.
Definition at line 170 of file cryptical_envelopment.cpp.
References ALWAYS_LOG, BITS_PER_BYTE, BYTE_TO_BINARY, BYTE_TO_BINARY_PATTERN, DISCUSS_KEY_SIZE, FUNCDEF, mathematics::chaos::inclusive(), crypto::ssl_init::randomizer(), basis::array< contents >::reset(), and crypto::static_ssl_initializer().
Referenced by set_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().
|
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().
| int crypto::cryptical_envelopment::key_size | ( | ) | const |
|
pure virtual |
returns the maximum key size in bits supported here.
Implemented in crypto::borked_blowfish_crypto, and crypto::twofish_crypto.
|
pure virtual |
returns the minimum key size in bits supported here.
Implemented in crypto::borked_blowfish_crypto, and crypto::twofish_crypto.
| cryptical_envelopment & crypto::cryptical_envelopment::operator= | ( | const cryptical_envelopment & | to_copy | ) |
Definition at line 139 of file cryptical_envelopment.cpp.
| 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().
| bool crypto::cryptical_envelopment::set_key | ( | int | key_size | ) |
this will create a new random key of the "key_size", in bits.
the valid sizes for keys depend on the algorithm in question.
Definition at line 124 of file cryptical_envelopment.cpp.
References DISCUSS_KEY_SIZE, FUNCDEF, generate_key(), key_size(), and LOG.
Referenced by crypto::borked_blowfish_crypto::borked_blowfish_crypto(), crypto::borked_blowfish_crypto::borked_blowfish_crypto(), octopi::encryption_infoton::extract_response(), cromp::cromp_client::login(), crypto::twofish_crypto::twofish_crypto(), and crypto::twofish_crypto::twofish_crypto().