Mixe for Privacy and Anonymity in the Internet
Static Public Member Functions | List of all members
CASymChannelCipherFactory Class Reference

#include <CASymChannelCipherFactory.hpp>

Collaboration diagram for CASymChannelCipherFactory:

Static Public Member Functions

static CASymChannelCiphercreateCipher (SYMCHANNELCIPHER_ALGORITHM alg)
 
static SYMCHANNELCIPHER_ALGORITHM getAlgIDFromString (UINT8 *strAlgID)
 

Detailed Description

Definition at line 46 of file CASymChannelCipherFactory.hpp.

Member Function Documentation

◆ createCipher()

static CASymChannelCipher* CASymChannelCipherFactory::createCipher ( SYMCHANNELCIPHER_ALGORITHM  alg)
inlinestatic

Definition at line 49 of file CASymChannelCipherFactory.hpp.

50  {
51  switch (alg)
52  {
53  case OFB:
54  return new CASymCipherOFB();
55  case CTR:
56  return new CASymCipherCTR();
57  case NULL_CIPHER:
58 #ifdef DEBUG
59  CAMsg::printMsg(LOG_DEBUG, "Creating NULL-cipher for channel encryption!\n");
60 #endif
61  return new CASymCipherNull();
62  case UNDEFINED_CIPHER:
63  return NULL;
64  }
65  return NULL;
66  }
@ NULL_CIPHER
@ UNDEFINED_CIPHER
static SINT32 printMsg(UINT32 typ, const char *format,...)
Writes a given message to the log.
Definition: CAMsg.cpp:251
This class could be used for encryption/decryption of data (streams) with AES using 128bit CTR mode.
This class implemtns the symmetric channel cipher interface - but does not do eny encryption!...
This class could be used for encryption/decryption of data (streams) with AES using 128bit OFB mode.

References CTR, NULL_CIPHER, OFB, CAMsg::printMsg(), and UNDEFINED_CIPHER.

Referenced by CAFirstMix::doUserLogin_internal(), CALocalProxy::loop(), CAFirstMixA::loop(), CALastMixA::loop(), CALocalProxy::processKeyExchange(), and CAMuxSocket::setCipher().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAlgIDFromString()

static SYMCHANNELCIPHER_ALGORITHM CASymChannelCipherFactory::getAlgIDFromString ( UINT8 strAlgID)
inlinestatic

Definition at line 68 of file CASymChannelCipherFactory.hpp.

69  {
70  if (strAlgID == NULL)
71  return UNDEFINED_CIPHER;
72  if (strcmp((const char*)SYMCHANNELCIPHER_ALG_NAME_OFB, (const char*)strAlgID) == 0)
73  {
74  return OFB;
75  }
76  if (strcmp((const char*)SYMCHANNELCIPHER_ALG_NAME_CTR, (const char*)strAlgID) == 0)
77  {
78  return CTR;
79  }
80  if (strcmp((const char*)SYMCHANNELCIPHER_ALG_NAME_NULL, (const char*)strAlgID) == 0)
81  {
82  return NULL_CIPHER;
83  }
84  return UNDEFINED_CIPHER;
85 
86  }
const UINT8 *const SYMCHANNELCIPHER_ALG_NAME_OFB
const UINT8 *const SYMCHANNELCIPHER_ALG_NAME_NULL
const UINT8 *const SYMCHANNELCIPHER_ALG_NAME_CTR

References CTR, NULL_CIPHER, OFB, SYMCHANNELCIPHER_ALG_NAME_CTR, SYMCHANNELCIPHER_ALG_NAME_NULL, SYMCHANNELCIPHER_ALG_NAME_OFB, and UNDEFINED_CIPHER.

Referenced by CALocalProxy::processKeyExchange().

Here is the caller graph for this function:

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