Introspection did not find any typical Config paths. More...
#include "qkd-encryptor.h"
Inheritance diagram for ns3::QKDEncryptor:
Collaboration diagram for ns3::QKDEncryptor:Public Types | |
| enum | AuthenticationType { UNAUTHENTICATED , QKDCRYPTO_AUTH_VMAC , QKDCRYPTO_AUTH_MD5 , QKDCRYPTO_AUTH_SHA1 } |
| Authentication type. More... | |
| enum | EncryptionType { UNENCRYPTED , QKDCRYPTO_OTP , QKDCRYPTO_AES } |
| Encryption type. More... | |
Public Member Functions | |
| QKDEncryptor () | |
| QKDEncryptor (EncryptionType type1, AuthenticationType type2) | |
| Constructor. | |
| QKDEncryptor (EncryptionType type1, AuthenticationType type2, uint32_t authTagLength) | |
| Constructor. | |
| QKDEncryptor (uint32_t authTagLength) | |
| Constructor. | |
| ~QKDEncryptor () override | |
| Destructor. | |
| std::string | AESDecrypt (const std::string &key, const std::string &data) |
| AES decryption. | |
| std::string | AESEncrypt (const std::string &key, const std::string &data) |
| AES encryption. | |
| std::string | Authenticate (std::string &, std::string key="0") |
| Help parent function used for calling child authentication functions. | |
| std::string | Base64Decode (std::string input) |
| Base64 decoder. | |
| std::string | Base64Encode (std::string input) |
| Base64 encoder. | |
| void | ChangeSettings (EncryptionType type1, AuthenticationType type2, uint32_t authTagLength) |
| Constructor. | |
| bool | CheckAuthentication (std::string payload, std::string authTag, std::string key="0") |
| Check Authentication on packet payload for authenticated packet. | |
| std::string | COTP (const std::string &key, const std::string &input) |
| One-Time Pad cipher where output is alfabet/number symbols. | |
| std::string | DecryptMsg (std::string input, std::string key) |
| Perform decryption of ciphertext. | |
| std::string | EncryptMsg (std::string input, std::string key) |
| Perform encryption of plaintext. | |
| uint32_t | GetIndex () const |
| Get internal index identifier in qkd encryptor container. | |
| Ptr< Node > | GetNode () const |
| Get details about the node on which qkd encryptor is installed. | |
| std::string | HexDecode (const std::string &data) |
| Help function used to decode string to HEX string. | |
| std::string | HexEncode (const std::string &data) |
| Help function used to encode string to HEX string. | |
| std::string | MD5 (std::string &inputString) |
| MD5 Authentication function. | |
| std::string | OTP (const std::string &key, const std::string &data) |
| One-time cipher. | |
| void | SetIndex (uint32_t index) |
| Set internal index identifier in qkd encryptor container. | |
| void | SetNode (Ptr< Node > node) |
| Set node on which qkd encryptor is installed. | |
| std::string | SHA1 (std::string &inputString) |
| SHA1 Authentication function. | |
| std::string | VMAC (std::string &key, std::string &inputString) |
| Authentication function in Wegman-Carter fashion. | |
Public Member Functions inherited from ns3::Object | |
| Object () | |
| Constructor. | |
| ~Object () override | |
| Destructor. | |
| void | AggregateObject (Ptr< Object > other) |
| Aggregate two Objects together. | |
| void | Dispose () |
| Dispose of this Object. | |
| AggregateIterator | GetAggregateIterator () const |
| Get an iterator to the Objects aggregated to this one. | |
| TypeId | GetInstanceTypeId () const override |
| Get the most derived TypeId for this Object. | |
| template<typename T > | |
| Ptr< T > | GetObject () const |
| Get a pointer to the requested aggregated Object. | |
| template<> | |
| Ptr< Object > | GetObject () const |
| Specialization of () for objects of type ns3::Object. | |
| template<typename T > | |
| Ptr< T > | GetObject (TypeId tid) const |
| Get a pointer to the requested aggregated Object by TypeId. | |
| template<> | |
| Ptr< Object > | GetObject (TypeId tid) const |
| Specialization of (TypeId tid) for objects of type ns3::Object. | |
| void | Initialize () |
| Invoke DoInitialize on all Objects aggregated to this one. | |
| bool | IsInitialized () const |
| Check if the object has been initialized. | |
| void | UnidirectionalAggregateObject (Ptr< Object > other) |
| Aggregate an Object to another Object. | |
Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
| SimpleRefCount () | |
| Default constructor. | |
| SimpleRefCount (const SimpleRefCount &o) | |
| Copy constructor. | |
| uint32_t | GetReferenceCount () const |
| Get the reference count of the object. | |
| SimpleRefCount & | operator= (const SimpleRefCount &o) |
| Assignment operator. | |
| void | Ref () const |
| Increment the reference count. | |
| void | Unref () const |
| Decrement the reference count. | |
Public Member Functions inherited from ns3::ObjectBase | |
| virtual | ~ObjectBase () |
| Virtual destructor. | |
| void | GetAttribute (std::string name, AttributeValue &value, bool permissive=false) const |
| Get the value of an attribute, raising fatal errors if unsuccessful. | |
| bool | GetAttributeFailSafe (std::string name, AttributeValue &value) const |
| Get the value of an attribute without raising errors. | |
| void | SetAttribute (std::string name, const AttributeValue &value) |
| Set a single attribute, raising fatal errors if unsuccessful. | |
| bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
| Set a single attribute without raising errors. | |
| bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
| Connect a TraceSource to a Callback with a context. | |
| bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
| Connect a TraceSource to a Callback without a context. | |
| bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected with a context. | |
| bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
| Disconnect from a TraceSource a Callback previously connected without a context. | |
Static Public Member Functions | |
| static TypeId | GetTypeId () |
| Get the TypeId. | |
Static Public Member Functions inherited from ns3::Object | |
| static TypeId | GetTypeId () |
| Register this type. | |
Static Public Member Functions inherited from ns3::ObjectBase | |
| static TypeId | GetTypeId () |
| Get the type ID. | |
Private Attributes | |
| uint32_t | m_authenticationTagLengthInBits |
| length of the authentication tag in bits(32 by default) | |
| TracedCallback< Ptr< Packet >, std::string > | m_authenticationTrace |
| trace callback for authentication | |
| AuthenticationType | m_authenticationType |
| bool | m_compressionEnabled |
| should compression algorithms be used? | |
| TracedCallback< Ptr< Packet >, std::string > | m_deauthenticationTrace |
| trace callback for authentication check | |
| TracedCallback< Ptr< Packet > > | m_decryptionTrace |
| trace callback for decryption | |
| bool | m_encryptionEnabled |
| real encryption used? | |
| TracedCallback< Ptr< Packet > > | m_encryptionTrace |
| trace callback for encryption | |
| EncryptionType | m_encryptionType |
| uint32_t | m_index |
| index in the qkd encryptor container | |
| unsigned char | m_iv [CryptoPP::AES::BLOCKSIZE] |
| Ptr< Node > | m_node |
| pointer to node on which encryptor is installed | |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
| Object (const Object &o) | |
| Copy an Object. | |
| virtual void | DoDispose () |
| Destructor implementation. | |
| virtual void | DoInitialize () |
| Initialize() implementation. | |
| virtual void | NotifyNewAggregate () |
| Notify all Objects aggregated to this one of a new Object being aggregated. | |
Protected Member Functions inherited from ns3::ObjectBase | |
| void | ConstructSelf (const AttributeConstructionList &attributes) |
| Complete construction of ObjectBase; invoked by derived classes. | |
| virtual void | NotifyConstructionCompleted () |
| Notifier called once the ObjectBase is fully constructed. | |
Related Symbols inherited from ns3::ObjectBase | |
| static TypeId | GetObjectIid () |
| Ensure the TypeId for ObjectBase gets fully configured to anchor the inheritance tree properly. | |
Introspection did not find any typical Config paths.
Size of this type is 200 bytes (on a 64-bit architecture).
Definition at line 77 of file qkd-encryptor.h.
Authentication type.
| Enumerator | |
|---|---|
| UNAUTHENTICATED | |
| QKDCRYPTO_AUTH_VMAC | |
| QKDCRYPTO_AUTH_MD5 | |
| QKDCRYPTO_AUTH_SHA1 | |
Definition at line 93 of file qkd-encryptor.h.
Encryption type.
| Enumerator | |
|---|---|
| UNENCRYPTED | |
| QKDCRYPTO_OTP | |
| QKDCRYPTO_AES | |
Definition at line 84 of file qkd-encryptor.h.
| ns3::QKDEncryptor::QKDEncryptor | ( | ) |
Definition at line 74 of file qkd-encryptor.cc.
References NS_LOG_FUNCTION.
| ns3::QKDEncryptor::QKDEncryptor | ( | uint32_t | authTagLength | ) |
Constructor.
Definition at line 79 of file qkd-encryptor.cc.
References ns3::Create(), m_authenticationTagLengthInBits, and NS_LOG_FUNCTION.
Here is the call graph for this function:| ns3::QKDEncryptor::QKDEncryptor | ( | EncryptionType | type1, |
| AuthenticationType | type2 | ||
| ) |
Constructor.
Definition at line 85 of file qkd-encryptor.cc.
References ChangeSettings(), ns3::Create(), m_iv, and NS_LOG_FUNCTION.
Here is the call graph for this function:| ns3::QKDEncryptor::QKDEncryptor | ( | EncryptionType | type1, |
| AuthenticationType | type2, | ||
| uint32_t | authTagLength | ||
| ) |
Constructor.
Definition at line 94 of file qkd-encryptor.cc.
References ChangeSettings(), ns3::Create(), and NS_LOG_FUNCTION.
Here is the call graph for this function:
|
override |
Destructor.
Definition at line 119 of file qkd-encryptor.cc.
AES decryption.
| std::string | data |
| Ptr<QKDKey> | key |
Definition at line 326 of file qkd-encryptor.cc.
References ns3::Create(), data, m_iv, and NS_LOG_FUNCTION.
Referenced by DecryptMsg().
Here is the call graph for this function:
Here is the caller graph for this function:AES encryption.
| std::string | data |
| Ptr<QKDKey> | key |
Definition at line 306 of file qkd-encryptor.cc.
References ns3::Create(), data, m_iv, and NS_LOG_FUNCTION.
Referenced by EncryptMsg().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string ns3::QKDEncryptor::Authenticate | ( | std::string & | inputString, |
| std::string | key = "0" |
||
| ) |
Help parent function used for calling child authentication functions.
| std::string | data |
| Ptr<QKDKey> | key |
| uint8_t | authentic |
Definition at line 187 of file qkd-encryptor.cc.
References ns3::Create(), m_authenticationType, MD5(), NS_LOG_FUNCTION, QKDCRYPTO_AUTH_MD5, QKDCRYPTO_AUTH_SHA1, QKDCRYPTO_AUTH_VMAC, SHA1(), UNAUTHENTICATED, and VMAC().
Referenced by CheckAuthentication().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string ns3::QKDEncryptor::Base64Decode | ( | std::string | input | ) |
Base64 decoder.
| input | input data |
Definition at line 235 of file qkd-encryptor.cc.
References ns3::Create().
Here is the call graph for this function:| std::string ns3::QKDEncryptor::Base64Encode | ( | std::string | input | ) |
Base64 encoder.
| input | input data |
Definition at line 223 of file qkd-encryptor.cc.
References ns3::Create().
Here is the call graph for this function:| void ns3::QKDEncryptor::ChangeSettings | ( | EncryptionType | type1, |
| AuthenticationType | type2, | ||
| uint32_t | authTagLength | ||
| ) |
Constructor.
Definition at line 104 of file qkd-encryptor.cc.
References ns3::Create(), m_authenticationTagLengthInBits, m_authenticationType, m_encryptionType, and NS_FATAL_ERROR.
Referenced by QKDEncryptor(), and QKDEncryptor().
Here is the call graph for this function:
Here is the caller graph for this function:| bool ns3::QKDEncryptor::CheckAuthentication | ( | std::string | payload, |
| std::string | authTag, | ||
| std::string | key = "0" |
||
| ) |
Check Authentication on packet payload for authenticated packet.
| payload | payload data |
| key | key for authentication |
Definition at line 209 of file qkd-encryptor.cc.
References Authenticate(), ns3::Create(), and NS_LOG_FUNCTION.
Here is the call graph for this function:One-Time Pad cipher where output is alfabet/number symbols.
| key | symmetric key |
| input | input message |
Solution adapted from: https://stackoverflow.com/questions/12671510/xor-on-two-hexadeicmal-values-stored-as-string-in-c
Definition at line 278 of file qkd-encryptor.cc.
References ns3::Create(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, and ns3::value().
Here is the call graph for this function:| std::string ns3::QKDEncryptor::DecryptMsg | ( | std::string | input, |
| std::string | key | ||
| ) |
Perform decryption of ciphertext.
| input | ciphertext |
| key | encryption key |
Definition at line 166 of file qkd-encryptor.cc.
References AESDecrypt(), ns3::Create(), m_encryptionType, NS_LOG_FUNCTION, OTP(), QKDCRYPTO_AES, QKDCRYPTO_OTP, and UNENCRYPTED.
Here is the call graph for this function:| std::string ns3::QKDEncryptor::EncryptMsg | ( | std::string | input, |
| std::string | key | ||
| ) |
Perform encryption of plaintext.
| input | plaintext |
| key | encryption key |
Definition at line 145 of file qkd-encryptor.cc.
References AESEncrypt(), ns3::Create(), m_encryptionType, NS_LOG_FUNCTION, OTP(), QKDCRYPTO_AES, QKDCRYPTO_OTP, and UNENCRYPTED.
Here is the call graph for this function:| uint32_t ns3::QKDEncryptor::GetIndex | ( | ) | const |
Get internal index identifier in qkd encryptor container.
@featureTask
Definition at line 139 of file qkd-encryptor.cc.
References m_index.
Get details about the node on which qkd encryptor is installed.
Definition at line 129 of file qkd-encryptor.cc.
References m_node.
|
static |
Get the TypeId.
Definition at line 40 of file qkd-encryptor.cc.
References m_authenticationTrace, m_compressionEnabled, m_deauthenticationTrace, m_decryptionTrace, m_encryptionEnabled, m_encryptionTrace, ns3::MakeBooleanAccessor(), ns3::MakeBooleanChecker(), ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
Here is the call graph for this function:| std::string ns3::QKDEncryptor::HexDecode | ( | const std::string & | data | ) |
Help function used to decode string to HEX string.
| std::string | data |
Definition at line 359 of file qkd-encryptor.cc.
References ns3::Create(), data, and NS_LOG_FUNCTION.
Here is the call graph for this function:| std::string ns3::QKDEncryptor::HexEncode | ( | const std::string & | data | ) |
Help function used to encode string to HEX string.
| std::string | data |
Definition at line 346 of file qkd-encryptor.cc.
References ns3::Create(), data, and NS_LOG_FUNCTION.
Here is the call graph for this function:| std::string ns3::QKDEncryptor::MD5 | ( | std::string & | inputString | ) |
MD5 Authentication function.
| std::string | data |
Definition at line 404 of file qkd-encryptor.cc.
References ns3::Create(), m_authenticationTagLengthInBits, and NS_LOG_FUNCTION.
Referenced by Authenticate().
Here is the call graph for this function:
Here is the caller graph for this function:One-time cipher.
| key | key for encryption |
| data | message to encrypt/decrypt |
Definition at line 247 of file qkd-encryptor.cc.
References ns3::Create(), NS_FATAL_ERROR, and NS_LOG_FUNCTION.
Referenced by DecryptMsg(), and EncryptMsg().
Here is the call graph for this function:
Here is the caller graph for this function:Set internal index identifier in qkd encryptor container.
@featureTask
| uint32_t | index |
Definition at line 135 of file qkd-encryptor.cc.
References m_index.
Set node on which qkd encryptor is installed.
| Ptr<Node> | node |
Definition at line 125 of file qkd-encryptor.cc.
References m_node.
| std::string ns3::QKDEncryptor::SHA1 | ( | std::string & | inputString | ) |
SHA1 Authentication function.
| std::string | data |
Definition at line 425 of file qkd-encryptor.cc.
References ns3::Create(), m_authenticationTagLengthInBits, and NS_LOG_FUNCTION.
Referenced by Authenticate().
Here is the call graph for this function:
Here is the caller graph for this function:| std::string ns3::QKDEncryptor::VMAC | ( | std::string & | key, |
| std::string & | inputString | ||
| ) |
Authentication function in Wegman-Carter fashion.
| std::string | data |
| std::string | data |
| uint32_t | length of auth tag |
Definition at line 372 of file qkd-encryptor.cc.
References ns3::Create(), m_iv, and NS_LOG_FUNCTION.
Referenced by Authenticate().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
length of the authentication tag in bits(32 by default)
Definition at line 282 of file qkd-encryptor.h.
Referenced by QKDEncryptor(), ChangeSettings(), MD5(), and SHA1().
|
private |
trace callback for authentication
Definition at line 290 of file qkd-encryptor.h.
Referenced by GetTypeId().
|
private |
Definition at line 285 of file qkd-encryptor.h.
Referenced by Authenticate(), and ChangeSettings().
|
private |
should compression algorithms be used?
Definition at line 281 of file qkd-encryptor.h.
Referenced by GetTypeId().
|
private |
trace callback for authentication check
Definition at line 291 of file qkd-encryptor.h.
Referenced by GetTypeId().
|
private |
trace callback for decryption
Definition at line 288 of file qkd-encryptor.h.
Referenced by GetTypeId().
|
private |
|
private |
trace callback for encryption
Definition at line 287 of file qkd-encryptor.h.
Referenced by GetTypeId().
|
private |
Definition at line 284 of file qkd-encryptor.h.
Referenced by ChangeSettings(), DecryptMsg(), and EncryptMsg().
|
private |
index in the qkd encryptor container
Definition at line 278 of file qkd-encryptor.h.
Referenced by GetIndex(), and SetIndex().
|
private |
Definition at line 275 of file qkd-encryptor.h.
Referenced by QKDEncryptor(), AESDecrypt(), AESEncrypt(), and VMAC().
pointer to node on which encryptor is installed
Definition at line 277 of file qkd-encryptor.h.