10Duke Enterprise C++ SDK
Loading...
Searching...
No Matches
tenduke::crypto::Cipher Class Referenceabstract

#include <Cipher.h>

Detailed Description

Cipher for encrypting / decrypting data.

Cipher is initialized with a key.

Inheritance diagram for tenduke::crypto::Cipher:
tenduke::crypto::aes::AESCipher tenduke::crypto::aes::AESGCMCipher tenduke::crypto::aes::libcrypto::LibcryptoAESCipher tenduke::crypto::win::cng::WinCNGAESCipher

Public Member Functions

 Cipher (const Cipher &)=delete
Cipher & operator= (const Cipher &)=delete
 Cipher (Cipher &&other) noexcept=default
Cipher & operator= (Cipher &&other) noexcept=default
virtual void decryptData (const ::tenduke::utl::DataSpan &ciphertext, ::tenduke::utl::DataSink &plaintext) const =0
 Utility method to decrypt data.
virtual void encryptData (const ::tenduke::utl::DataSpan &plaintext, ::tenduke::utl::DataSink &ciphertext) const =0
 Utility method to encrypt data.

Member Function Documentation

◆ decryptData()

virtual void tenduke::crypto::Cipher::decryptData ( const ::tenduke::utl::DataSpan & ciphertext,
::tenduke::utl::DataSink & plaintext ) const
pure virtual

Utility method to decrypt data.

This method decrypts the provided data, encrypted by ::encryptData() method.

Parameters
ciphertextthe encrypted data
plaintextthe decrypted data

Implemented in LibcryptoAESCipher, tenduke::crypto::aes::libcrypto::LibcryptoAESCipher, and tenduke::crypto::win::cng::WinCNGAESCipher.

◆ encryptData()

virtual void tenduke::crypto::Cipher::encryptData ( const ::tenduke::utl::DataSpan & plaintext,
::tenduke::utl::DataSink & ciphertext ) const
pure virtual

Utility method to encrypt data.

This method encrypts the provided data and outputs a binary data object which contains:

  • nonce / IV (if used by the cipher), automatically generated
  • the ciphertext
  • the authentication tag (if used by the cipher)
Parameters
plaintextthe data to encrypt
ciphertextthe encrypted data

Implemented in AESGCMCipher, LibcryptoAESCipher, tenduke::crypto::aes::AESGCMCipher, tenduke::crypto::aes::libcrypto::LibcryptoAESCipher, and tenduke::crypto::win::cng::WinCNGAESCipher.


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