In file /home/eternity/Source/Mix/Translator/H/translator.h:

class Translator : public Runable, public MixOffspring

Message translator

Inheritance:

Translator < Runable < Debugable

Translator < MixOffspring


Public Methods

char* Translator::PaddRestOfPath (char *path, Size pathLen, Size peelLen)
Padds rest of path field to the original length
void* Translator::Run (void *)
The main method that do the things
Translator::Translator (Mix * parent, LogFile * translatorLogFile)
Translator constructor
Translator::~Translator ()
Translator destructor

Private

methods

Inherited from Runable:

Public Methods

void Runable::MaskAllSignals()
Runable::Runable(LogFile * logFile)

Inherited from Debugable:

Public Methods

string* Debugable::CreateString(char *firstStr, int firstInt, int secondInt)
Debugable::Debugable(LogFile * debugLogFile)
int Debugable::SetDebugOptions(int newLogOptions)
void Debugable::SetLogFile(LogFile *aLogFile)
void Debugable::WriteString(LogLevel debugLevel, char * format, ...)
Debugable::~Debugable()

Public

attributes

int debugOptions
What messages should be logged
LogFile* logFile
Log file for debug messages

Inherited from MixOffspring:

Public Methods

MixOffspring::MixOffspring(Mix * mix)

Documentation

Message translator. Decrypts one peel from message that is sent using onion routing. In the decrypted peel it finds the information necessary to decide whether the message is at its destination or whether it should be send to further to another Mix.
methods

char* Translator::PaddRestOfPath(char *path, Size pathLen, Size peelLen)
Padds rest of path field to the original length. When the chunk goes through the chain of Mixes, the rest of path field is downsizing. This fact could be used to try the onion length attack and recognize, how many hops the chunk is to go yet. The enemy then could try to chose what is easier to break (the Mixes that are close).
Returns:
Padded rest of path.
Parameters:
path - Path to be padded.
pathLen - Current path length.
peelLen - Length to which to padd the path.
Author:
Pechy
See Also:
Translator, onion length attack discussion

void* Translator::Run(void *)
The main method that do the things. WARNING: the method is long.

This method translates the incoming chunk into the outcoming one. First, the method decrypts the GMessage where is some information useful for further chunk translation. The GMessage is encrypted with public key of this Mix (the public key that was included into the Mix's certificate during certification creation). By decrypting this, Run() gets a symetric key that is used to decrypt information about next possible recipients. The combination of asymetric and symetric cryptography is used because we want to be able to have more than one recipient in each peel.

After decryption by symetric key, we have to check whether there is a final stop indication:

  • Yes: we have to decrypt multiple encrypted data (as the data went through the chain of Mixes related to the recipient's onion). The symetric keys should be already in the dectypted onion bottom (ie. rest of path bottom). After the dectyption the data has to be dectypted by a private asymetric key included also in the bottom. See middle attack discussion for more info. That the data are passed to Linker.
  • No (final stop not found): we strip from the decrypted rest of path field (decrypted by symetric key that was in turn decrypted by Mix's private key). The stripped data part is indicated by the first sizeof(Size) bytes in the decrypted rest of path field. From this part we make a GMessage. This GMessage contains needed information about the next possible recipients. After stripping the rest of path field, we have to padd it to the original length. Then we have to encrypt the data by another symetric key found in the stripped GMessage. Next, we take the data, padded rest of path, several recipients (got from stripped GMessage) and make a new chunk, suitable for Sender.
Returns:
void pointer
Author:
Pechy, Venca
See Also:
CreateChunk(), CreateOnion(), Cipherer

Translator::Translator(Mix * parent, LogFile * translatorLogFile)
Translator constructor. Saves object pointers he gets as parameters.
Parameters:
parent - Parent, ie. Mix object.
translatorLogFile - Log file.
Author:
Venca
See Also:
~Translator()

Translator::~Translator()
Translator destructor. Now does nothing.
Author:
Pechy or Venca


This class has no child classes.
Author:
Venca, Pechy
See Also:
Cipherer, MessageCreator

alphabetic index hierarchy of classes


generated by doc++