velosurf.util
Class DESCryptograph

java.lang.Object
  extended by velosurf.util.DESCryptograph
All Implemented Interfaces:
Cryptograph

public class DESCryptograph
extends java.lang.Object
implements Cryptograph

Implemenation of the cryptograph for the DES algorithm. Inspired from some code found at http://javaalmanac.com

Author:
Claude Brisson

Field Summary
(package private)  javax.crypto.Cipher dcipher
          decryption cypher
(package private)  javax.crypto.Cipher ecipher
          encryption cypher
 
Constructor Summary
DESCryptograph()
          Constructor.
 
Method Summary
 java.lang.String decrypt(java.lang.String str)
          Decrypt a string.
 java.lang.String encrypt(java.lang.String str)
          encrypt a string.
 void init(java.lang.String random)
          initialization.
static void main(java.lang.String[] args)
          test method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ecipher

javax.crypto.Cipher ecipher
encryption cypher


dcipher

javax.crypto.Cipher dcipher
decryption cypher

Constructor Detail

DESCryptograph

public DESCryptograph()
Constructor.

Method Detail

init

public void init(java.lang.String random)
initialization.

Specified by:
init in interface Cryptograph
Parameters:
random - random string

encrypt

public java.lang.String encrypt(java.lang.String str)
encrypt a string.

Specified by:
encrypt in interface Cryptograph
Parameters:
str - string to encrypt
Returns:
encrypted string

decrypt

public java.lang.String decrypt(java.lang.String str)
Decrypt a string.

Specified by:
decrypt in interface Cryptograph
Parameters:
str - string to decrypt
Returns:
decrypted string

main

public static void main(java.lang.String[] args)
test method

Parameters:
args - not used


~ooOoo~