PCL
|
Abstract base class for cipher algorithm implementations. More...
#include <Cryptography.h>
Public Member Functions | |
Cipher ()=default | |
Cipher (const Cipher &)=default | |
virtual | ~Cipher () |
virtual String | AlgorithmName () const =0 |
template<class C > | |
ByteArray | Decrypt (const C &input) const |
template<class C > | |
void | Decrypt (void *output, const C &input) const |
virtual void | Decrypt (void *output, const void *input, size_type length) const =0 |
template<class C > | |
ByteArray | Encrypt (const C &input) const |
template<class C > | |
void | Encrypt (void *output, const C &input) const |
virtual void | Encrypt (void *output, const void *input, size_type length) const =0 |
virtual size_type | KeyLength () const =0 |
Cipher & | operator= (const Cipher &)=default |
Cipher defines a common interface for implementations of algorithms performing encryption and decryption of generic data.
Currently we have implemented the AES-256 cipher with CBC/ECB encryption and decryption on the PixInsight platform, available as the AES256 class.
Definition at line 758 of file Cryptography.h.
|
default |
Default constructor.
|
default |
Copy constructor.
|
inlinevirtual |
Destroys a Cipher object.
Definition at line 780 of file Cryptography.h.
|
pure virtual |
Returns the name of this cipher algorithm.
Implemented in pcl::AES256.
|
inline |
Out-of-place container decryption.
input | Reference to a container where the encrypted data (or cipher text) is stored as a contiguous block. The input container will be treated as a contiguous sequence of bytes, ignoring the data type of the items contained. |
The C
template argument must be a class with PCL container semantics (the Begin() and Size() member functions are required). Typically the ByteArray class is used, although any array-like class with contiguous storage is appropriate, including Array, String, Vector and Matrix.
Returns a ByteArray object with the decrypted data, or plain text), as a contiguous sequence of bytes.
Definition at line 906 of file Cryptography.h.
|
inline |
Container decryption.
[out] | output | Starting address of the output buffer, where the decrypted data (or plain text) will be stored. |
input | Reference to a container where the encrypted data (or cipher text) is stored as a contiguous block. The input container will be treated as a contiguous sequence of bytes, ignoring the data type of the items contained. |
The C
template argument must be a class with PCL container semantics (the Begin() and Size() member functions are required). Typically the ByteArray class is used, although any array-like class with contiguous storage is appropriate, including Array, String, Vector and Matrix.
Definition at line 884 of file Cryptography.h.
|
pure virtual |
Buffer decryption.
[out] | output | Starting address of the output buffer, where the decrypted data (or plain text) will be stored. |
input | Starting address of the input buffer, where the encrypted data (or cipher text) is stored. | |
length | The buffer length in bytes. |
Implemented in pcl::AES256.
|
inline |
Out-of-place container encryption.
input | Reference to a container where the original data (or plain text) is stored as a contiguous block. The input container will be treated as a contiguous sequence of bytes, ignoring the data type of the items contained. |
The C
template argument must be a class with PCL container semantics (the Begin() and Size() member functions are required). Typically the ByteArray class is used, although any array-like class with contiguous storage is appropriate, including Array, String, Vector and Matrix.
Returns a ByteArray object with the encrypted data, or cipher text. The returned object can be used to decrypt the data with the Decrypt() member function.
Definition at line 860 of file Cryptography.h.
|
inline |
Container encryption.
[out] | output | Starting address of the output buffer, where the encrypted data (or cipher text) will be stored. |
input | Reference to a container where the original data (or plain text) is stored as a contiguous block. The input container will be treated as a contiguous sequence of bytes, ignoring the data type of the items contained. |
The C
template argument must be a class with PCL container semantics (the Begin() and Size() member functions are required). Typically the ByteArray class is used, although any array-like class with contiguous storage is appropriate, including Array, String, Vector and Matrix.
Definition at line 837 of file Cryptography.h.
|
pure virtual |
Buffer encryption.
[out] | output | Starting address of the output buffer, where the encrypted data (or cipher text) will be stored. |
input | Starting address of the input buffer, where the original data (or plain text) is stored. | |
length | The buffer length in bytes. |
Implemented in pcl::AES256.
|
pure virtual |
Returns the length in bytes of a key in this cipher algorithm.
Implemented in pcl::AES256.
Copy assignment operator. Returns a reference to this object.