anon.mixminion.message
Class Decoder

java.lang.Object
  extended by anon.mixminion.message.Decoder

public class Decoder
extends java.lang.Object

Author:
Stefan Roenisch

Field Summary
private  int KEY_LEN
           
private  java.lang.String m_message
           
private  java.lang.String m_password
           
private  int MAXHOPS
           
private  int PACKETSIZE
           
 
Constructor Summary
Decoder(java.lang.String message, java.lang.String password)
          Constructor
 
Method Summary
private  int byteToInt(byte[] b, int offset)
          Calculates the int value of a given ByteArray
 java.lang.String decode()
          Method to decode a given payload as String
private  int testPayload(byte[] payload)
          Tests a given payload for being a plaintext one
private  java.lang.String trytoReassemble(byte[] fragment)
          try's to reassemble the message the fragment belongs to and returns either null or the reassembled message
private  byte[] unwhiten(byte[] m)
          Unwhites a ByteArray in the fashion of mixminion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_LEN

private final int KEY_LEN
See Also:
Constant Field Values

MAXHOPS

private final int MAXHOPS
See Also:
Constant Field Values

PACKETSIZE

private final int PACKETSIZE
See Also:
Constant Field Values

m_message

private java.lang.String m_message

m_password

private java.lang.String m_password
Constructor Detail

Decoder

public Decoder(java.lang.String message,
               java.lang.String password)
Constructor

Parameters:
message -
Method Detail

decode

public java.lang.String decode()
                        throws java.io.IOException
Method to decode a given payload as String

Returns:
String decodedMessages
Throws:
java.io.IOException

testPayload

private int testPayload(byte[] payload)
Tests a given payload for being a plaintext one

Parameters:
payload -
Returns:
true if a message, false otherwise

trytoReassemble

private java.lang.String trytoReassemble(byte[] fragment)
try's to reassemble the message the fragment belongs to and returns either null or the reassembled message

Parameters:
fragment -
Returns:

byteToInt

private int byteToInt(byte[] b,
                      int offset)
Calculates the int value of a given ByteArray

Parameters:
b -
offset -
Returns:
int value of the bytearray

unwhiten

private byte[] unwhiten(byte[] m)
Unwhites a ByteArray in the fashion of mixminion

Parameters:
m -
Returns: