LibLogicalAccess
2.5.0
An Open Source RFID Library
|
A DES cipher. More...
#include <des_cipher.hpp>
Public Member Functions | |
DESCipher (EncMode _mode=ENC_MODE_CBC) | |
Constructor. | |
unsigned char | getBlockSize () const override |
![]() | |
OpenSSLSymmetricCipher (EncMode mode) | |
Constructor. | |
virtual | ~OpenSSLSymmetricCipher () |
OpenSSLSymmetricCipherContext | start (Method method, const SymmetricKey &key, const InitializationVector &iv, bool padding) const |
Initialize a new encryption/decryption session. | |
void | cipher (const ByteVector &src, ByteVector &dest, const SymmetricKey &key, const InitializationVector &iv, bool padding) override |
Cipher a buffer. | |
void | decipher (const ByteVector &src, ByteVector &dest, const SymmetricKey &key, const InitializationVector &iv, bool padding) override |
Decipher a buffer. | |
![]() | |
virtual | ~SymmetricCipher () |
Destructor. | |
virtual void | cipher (const ByteVector &src, ByteVector &dest, const SymmetricKey &key, const InitializationVector &iv, bool padding)=0 |
Cipher a buffer. | |
void | cipher (const ByteVector &src, ByteVector &dest, const SymmetricKey &key) |
void | cipher (const ByteVector &src, ByteVector &dest, const ByteVector &key, const ByteVector &iv={}) |
virtual void | decipher (const ByteVector &src, ByteVector &dest, const SymmetricKey &key, const InitializationVector &iv, bool padding)=0 |
Decipher a buffer. | |
void | decipher (const ByteVector &src, ByteVector &dest, const SymmetricKey &key) |
void | decipher (const ByteVector &src, ByteVector &dest, const ByteVector &key, const ByteVector &iv={}) |
virtual unsigned char | getBlockSize () const =0 |
Protected Member Functions | |
const EVP_CIPHER * | getEVPCipher (const SymmetricKey &key) const override |
Get the openssl EVP cipher. | |
![]() | |
virtual const EVP_CIPHER * | getEVPCipher (const SymmetricKey &key) const =0 |
Get the openssl EVP cipher. | |
EncMode | mode () const |
Get the encryption mode. | |
Additional Inherited Members | |
![]() | |
enum | EncMode { ENC_MODE_CBC , ENC_MODE_CFB , ENC_MODE_CFB1 , ENC_MODE_CFB8 , ENC_MODE_ECB , ENC_MODE_OFB } |
Encryption mode. More... | |
enum | Method { M_ENCRYPT , M_DECRYPT } |
A method. More... | |
![]() | |
static void | update (OpenSSLSymmetricCipherContext &context, const ByteVector &src) |
Add data to encrypt/decrypt. | |
static ByteVector | stop (OpenSSLSymmetricCipherContext &context) |
Finalize an encryption/decryption session. | |
A DES cipher.
DESCipher is a symmetric cipher that relies on OpenSSL's implementation of the DES algorithm. Take a look at SymmetricCipher for usage.
|
inlineexplicit |
Constructor.
_mode | The encryption mode. Default is CBC. |
|
overridevirtual |
Implements logicalaccess::openssl::SymmetricCipher.
|
overrideprotectedvirtual |
Get the openssl EVP cipher.
key | The key. |
Implements logicalaccess::openssl::OpenSSLSymmetricCipher.