17#include "ns3/header.h"
18#include "ns3/tcp-header.h"
19#include "ns3/udp-header.h"
20#include "ns3/icmpv4.h"
22#include "ns3/dsdv-packet.h"
23#include "ns3/aodv-packet.h"
24#include "ns3/olsr-header.h"
26#include "ns3/packet.h"
28#include "ns3/object.h"
29#include "ns3/callback.h"
30#include "ns3/assert.h"
32#include "ns3/deprecated.h"
33#include "ns3/traced-value.h"
34#include "ns3/packet-metadata.h"
35#include "ns3/trace-source-accessor.h"
37#include "ns3/net-device.h"
40#include <crypto++/aes.h>
41#include <crypto++/modes.h>
42#include <crypto++/filters.h>
43#include <crypto++/hex.h>
44#include <crypto++/osrng.h>
45#include <crypto++/ccm.h>
46#include <crypto++/vmac.h>
47#include <crypto++/iterhash.h>
48#include <crypto++/secblock.h>
49#include <crypto++/sha.h>
50#include <cryptopp/base64.h>
53#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
54#include <crypto++/md5.h>
161 std::string
OTP(
const std::string& key,
const std::string&
data);
171 std::string
COTP(
const std::string& key,
const std::string&
input);
179 std::string
AESEncrypt(
const std::string& key,
const std::string&
data);
187 std::string
AESDecrypt(
const std::string& key,
const std::string&
data);
212 std::string
Authenticate(std::string&, std::string key =
"0");
275 unsigned char m_iv [ CryptoPP::AES::BLOCKSIZE ];
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
Introspection did not find any typical Config paths.
~QKDEncryptor() override
Destructor.
uint32_t m_index
index in the qkd encryptor container
unsigned char m_iv[CryptoPP::AES::BLOCKSIZE]
bool m_encryptionEnabled
real encryption used?
std::string EncryptMsg(std::string input, std::string key)
Perform encryption of plaintext.
std::string HexDecode(const std::string &data)
Help function used to decode string to HEX string.
std::string AESEncrypt(const std::string &key, const std::string &data)
AES encryption.
EncryptionType
Encryption type.
void SetNode(Ptr< Node > node)
Set node on which qkd encryptor is installed.
Ptr< Node > GetNode() const
Get details about the node on which qkd encryptor is installed.
void SetIndex(uint32_t index)
Set internal index identifier in qkd encryptor container.
bool CheckAuthentication(std::string payload, std::string authTag, std::string key="0")
Check Authentication on packet payload for authenticated packet.
std::string Base64Decode(std::string input)
Base64 decoder.
TracedCallback< Ptr< Packet >, std::string > m_authenticationTrace
trace callback for authentication
std::string VMAC(std::string &key, std::string &inputString)
Authentication function in Wegman-Carter fashion.
std::string OTP(const std::string &key, const std::string &data)
One-time cipher.
uint32_t m_authenticationTagLengthInBits
length of the authentication tag in bits(32 by default)
std::string SHA1(std::string &inputString)
SHA1 Authentication function.
TracedCallback< Ptr< Packet >, std::string > m_deauthenticationTrace
trace callback for authentication check
AuthenticationType m_authenticationType
Ptr< Node > m_node
pointer to node on which encryptor is installed
uint32_t GetIndex() const
Get internal index identifier in qkd encryptor container.
TracedCallback< Ptr< Packet > > m_decryptionTrace
trace callback for decryption
AuthenticationType
Authentication type.
TracedCallback< Ptr< Packet > > m_encryptionTrace
trace callback for encryption
std::string HexEncode(const std::string &data)
Help function used to encode string to HEX string.
std::string Authenticate(std::string &, std::string key="0")
Help parent function used for calling child authentication functions.
std::string COTP(const std::string &key, const std::string &input)
One-Time Pad cipher where output is alfabet/number symbols.
void ChangeSettings(EncryptionType type1, AuthenticationType type2, uint32_t authTagLength)
Constructor.
bool m_compressionEnabled
should compression algorithms be used?
std::string DecryptMsg(std::string input, std::string key)
Perform decryption of ciphertext.
static TypeId GetTypeId()
Get the TypeId.
std::string Base64Encode(std::string input)
Base64 encoder.
EncryptionType m_encryptionType
std::string MD5(std::string &inputString)
MD5 Authentication function.
std::string AESDecrypt(const std::string &key, const std::string &data)
AES decryption.
Forward calls to a chain of Callback.
a unique identifier for an interface.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.