Class Vernam
java.lang.Object
AbstractCodingDevice
Vernam
- All Implemented Interfaces:
- CodingDevice
public class Vernam
- extends AbstractCodingDevice
Implements Vernam's coding algorithm
- Version:
- 29 10 2009
- Author:
- Tomas Sedmik
|
Constructor Summary |
Vernam(String key)
Constructor that sets the key used for encoding/decoding |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Vernam
public Vernam(String key)
- Constructor that sets the key used for encoding/decoding
- Parameters:
key - the key used for encoding/decoding.
decode
public String decode(String text)
- Decode a message
- Specified by:
decode in interface CodingDevice- Specified by:
decode in class AbstractCodingDevice
- Parameters:
text - message which will be decoded
- Returns:
- decoded text
encode
public String encode(String text)
- Encode a message
- Specified by:
encode in interface CodingDevice- Specified by:
encode in class AbstractCodingDevice
- Parameters:
text - message which will be encoded
- Returns:
- encoded text