Rudiments
|
Inherited by aes128.
Public Member Functions | |
encryption () | |
virtual | ~encryption () |
virtual bool | setKey (const unsigned char *key, size_t keysize) |
virtual void | setRandomKey () |
virtual unsigned char * | getKey () |
virtual uint32_t | getKeySize ()=0 |
virtual bool | setIv (const unsigned char *iv, size_t ivsize) |
virtual void | setRandomIv () |
virtual unsigned char * | getIv () |
virtual uint32_t | getIvSize ()=0 |
virtual bool | append (const unsigned char *data, uint32_t size) |
virtual const unsigned char * | getEncryptedData ()=0 |
virtual uint64_t | getEncryptedDataSize () |
virtual const unsigned char * | getDecryptedData ()=0 |
virtual uint64_t | getDecryptedDataSize () |
virtual bool | clear () |
virtual encryptionerror_t | getError () |
The encryption class provides a simple encryption interface.
encryption::encryption | ( | ) |
Creates an instance of the encryption class.
|
virtual |
Deletes this instance of the encryption class.
|
virtual |
Appends "size" bytes of "data" to the data to be encrypted/decrypted. Returns true on success or false if an error occurred.
|
virtual |
Clears the current encrypted/decrypted data and any data that had previously been appended. Does not clear the key or initialization vector. Returns true on success or false if an error occurred.
|
pure virtual |
Interprets the current data as encrypted. Decrypts the current data. Returns the decrypted data on success or NULL if an error occurred. Note that the decrypted data returned will be an empty string if no data has been appended yet.
Implemented in aes128.
|
virtual |
Returns the number of bytes of decrypted data.
|
pure virtual |
Interprets the current data as unencrypted. Encrypts the current data. Returns the encrypted data on success or NULL if an error occurred. Note that the encrypted data returned will be an empty string if no data has been appended yet.
Implemented in aes128.
|
virtual |
Returns the number of bytes of encrypted data.
|
virtual |
Returns the most recent error.
|
virtual |
Returns the initialization vector currently used for encryption/decryption. If no initialization vector has been set, then this will be a block of 0's.
|
pure virtual |
Returns the number of bytes in the initialization vector.
Implemented in aes128.
|
virtual |
Returns the key currently used for encryption/decryption. If no key has been set, then this will be a block of 0's.
|
pure virtual |
Returns the number of bytes in the key.
Implemented in aes128.
|
virtual |
Sets the initialization vector used for encryption/decryption to the first "ivsize" bytes of "iv". Returns true on success and false on failure. The most common failure is that "ivsize" is not the correct number of bytes. The method getKeySize() returns the correct number of bytes for the key.
|
virtual |
Sets the key used for encryption/decryption to the first "keysize" bytes of "key". Returns true on success and false on failure. The most common failure is that "keysize" is not the correct number of bytes. The method getKeySize() returns the correct number of bytes for the key.
|
virtual |
Sets the initialization vector used encryption/decryption to random data. The data used can be retrived using getKey().
|
virtual |
Sets the key used for encryption/decryption to random data. The data used can be retrived using getKey().