asgaard.utils.cryptography
Class ROT13

java.lang.Object
  |
  +--asgaard.utils.cryptography.Cryptography
        |
        +--asgaard.utils.cryptography.ROT13

public class ROT13
extends Cryptography

ROT13 is a popular cipher on USEnet News. Move each alpahbetic character 13 characters along the alphabet. Not at all secure, just used to prevent people accidentally reading offensive material. Copyright (c) 1997 David Purdue.

See Also:
Cryptography

Constructor Summary
ROT13()
           
 
Method Summary
 byte[] decrypt(byte[] ciphertext)
          Performs a ROT13 decryption.
 byte[] decryptFinish()
          Tidies up a ROT13 decryption.
 byte[] encrypt(byte[] plaintext)
          Performs a ROT13 encryption.
 byte[] encryptFinish()
          Tidies up a ROT13 encryption.
 
Methods inherited from class asgaard.utils.cryptography.Cryptography
getCrypto, getKey, setKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ROT13

public ROT13()
Method Detail

encrypt

public byte[] encrypt(byte[] plaintext)
               throws java.lang.NoSuchMethodException
Performs a ROT13 encryption.
Parameters:
plaintext - The plain text to encrypt as an array of bytes.
Returns:
An array of bytes with the cipher text.
Throws:
java.lang.NoSuchMethodException - Thrown by superclass.
Overrides:
encrypt in class Cryptography
See Also:
Cryptography.encrypt(byte[])

encryptFinish

public byte[] encryptFinish()
                     throws java.lang.NoSuchMethodException
Tidies up a ROT13 encryption.
Returns:
An array of bytes with the cipher text.
Throws:
java.lang.NoSuchMethodException - Thrown by superclass.
Overrides:
encryptFinish in class Cryptography
See Also:
Cryptography.encryptFinish()

decrypt

public byte[] decrypt(byte[] ciphertext)
               throws java.lang.NoSuchMethodException
Performs a ROT13 decryption.
Parameters:
ciphertext - The cipher text to decrypt, an array of bytes.
Returns:
An array of bytes with the plain text.
Throws:
java.lang.NoSuchMethodException - Thrown by superclass.
Overrides:
decrypt in class Cryptography
See Also:
Cryptography.decrypt(byte[])

decryptFinish

public byte[] decryptFinish()
                     throws java.lang.NoSuchMethodException
Tidies up a ROT13 decryption.
Returns:
An array of bytes with the plain text.
Throws:
java.lang.NoSuchMethodException - Thrown by superclass.
Overrides:
decryptFinish in class Cryptography
See Also:
Cryptography.decryptFinish()