|
10Duke Enterprise C++ SDK
|
#include <Ciphers.h>
A "service locator" for cipher-related operations.
This class consolidates cipher-related operations into a single interface. It provides methods for encrypting and decrypting data using the system default cipher (AES256 GCM).
Public Member Functions | |
| virtual std::unique_ptr<::tenduke::utl::BinaryData > | decrypt (const ::tenduke::utl::DataSpan &ciphertext, const ::tenduke::utl::DataSpan &encryptionKey) const =0 |
| Decrypts given data using the system default cipher (AES256 GCM). | |
| virtual std::string | decryptString (const ::tenduke::utl::DataSpan &ciphertext, const ::tenduke::utl::DataSpan &encryptionKey) const =0 |
| Decrypts given data using the system default cipher (AES256 GCM) to a string. | |
| virtual std::unique_ptr<::tenduke::utl::BinaryData > | encrypt (const ::tenduke::utl::DataSpan &plaintext, const ::tenduke::utl::DataSpan &encryptionKey) const =0 |
| Encrypts given data using the system default cipher (AES256 GCM). | |
| virtual std::unique_ptr<::tenduke::utl::BinaryData > | encrypt (const std::string &plaintext, const ::tenduke::utl::DataSpan &encryptionKey) const =0 |
| Encrypts given data using the system default cipher (AES256 GCM). | |
|
pure virtual |
Decrypts given data using the system default cipher (AES256 GCM).
This method expects the input to consist of magic (4 bytes) + version (2 bytes) + IV (12 bytes) + ciphertext + tag (16 bytes), i.e., the output produced by calling ::encrypt(key, plaintext).
This is "syntactic sugar": The method also performs key-derivation for the provided key to simplify the use.
| ciphertext | the cipher text (the data to decrypt), the maximum supported length is INT_MAX. |
| encryptionKey | encryption key |
Implemented in tenduke::crypto::AbstractCiphers.
|
pure virtual |
Decrypts given data using the system default cipher (AES256 GCM) to a string.
This method expects the input to consist of magic (4 bytes) + version (2 bytes) + IV (12 bytes) + ciphertext + tag (16 bytes), i.e., the output produced by calling ::encrypt(key, plaintext).
This is "syntactic sugar": The method also performs key-derivation for the provided key to simplify the use.
| ciphertext | the cipher text (the data to decrypt), the maximum supported length is INT_MAX. |
| encryptionKey | encryption key |
Implemented in tenduke::crypto::AbstractCiphers.
|
pure virtual |
Encrypts given data using the system default cipher (AES256 GCM).
The output consists of magic (4 bytes) + version (2 bytes) + IV (12 bytes) + ciphertext + tag (16 bytes).
This is "syntactic sugar": The method also performs key-derivation for the provided key to simplify the use. The method also generates a random IV.
| plaintext | the plain text (the data to encrypt), the maximum supported length is INT_MAX. |
| encryptionKey | encryption key |
Implemented in tenduke::crypto::AbstractCiphers.
|
pure virtual |
Encrypts given data using the system default cipher (AES256 GCM).
The output consists of magic (4 bytes) + version (2 bytes) + IV (12 bytes) + ciphertext + tag (16 bytes).
This is "syntactic sugar": The method also performs key-derivation for the provided key to simplify the use. The method also generates a random IV.
| plaintext | the plain text, the maximum supported length is INT_MAX. |
| encryptionKey | encryption key |
Implemented in tenduke::crypto::AbstractCiphers.