symmetric
Class OneTimePad

java.lang.Object
  extended by symmetric.OneTimePad
All Implemented Interfaces:
java.io.Serializable

public class OneTimePad
extends java.lang.Object
implements java.io.Serializable

Author:
Dominik
See Also:
Serialized Form

Constructor Summary
OneTimePad(int size)
          Creates a new One Time Pad
 
Method Summary
 byte[] crypt(byte[] seq)
          Encrypts or Decrypts a byte array by using XOR
 byte[] getKey()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OneTimePad

public OneTimePad(int size)
Creates a new One Time Pad

Parameters:
size - the size of the One Time Pad
Method Detail

crypt

public byte[] crypt(byte[] seq)
Encrypts or Decrypts a byte array by using XOR

Parameters:
seq - the byte array to encode/decode
Returns:
the encoded/decoded byte array

getKey

public byte[] getKey()
Returns:
Returns the key.