Luky Library - 4.1.1 (20061117-1148)

luky.crypt
Class BlowfishCipher

java.lang.Object
  extended by luky.crypt.BlowfishCipher

public class BlowfishCipher
extends Object

A Blowfish Ciphering object that can be used to crypt and decrypt strings Revision Changes :

Version:
2.00
Author:
Chris Lukassen
 

Constructor Summary
BlowfishCipher(byte[] key, Random rand)
          default constructor
BlowfishCipher(String key, Random rand)
          default constructor
 
Method Summary
 byte[] decrypt(byte[] cipherText)
          decrypt a byte array
 String decrypt(String input)
          decrypt a string
 byte[] encrypt(byte[] plainText)
          encrypt a byte array
 String encrypt(String input)
          encrypt a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlowfishCipher

public BlowfishCipher(String key,
                      Random rand)
default constructor

Parameters:
key - the key which is used to decrypt or encrypt the strings
rand - the randomizer that is used to generate random numbers

BlowfishCipher

public BlowfishCipher(byte[] key,
                      Random rand)
default constructor

Parameters:
key - the key which is used to decrypt or encrypt the data
rand - the randomizer that is used to generate random numbers
Method Detail

encrypt

public String encrypt(String input)
encrypt a string

Parameters:
input - the string that is to be encrypted
Returns:
the encrypted string

encrypt

public byte[] encrypt(byte[] plainText)
encrypt a byte array

Parameters:
plainText - the byte array that is to be encrypted
Returns:
the encrypted byte array

decrypt

public String decrypt(String input)
decrypt a string

Parameters:
input - the string that is to be decrypt
Returns:
the decrypted string or null in case of an error

decrypt

public byte[] decrypt(byte[] cipherText)
decrypt a byte array

Parameters:
cipherText - the byte array that is to be decrypt
Returns:
the decrypted byte array or null in case of an error

Luky Library - 4.1.1 (20061117-1148)