Luky Library - 4.1.1 (20061117-1148)

luky.crypt
Class BlowfishCBC

java.lang.Object
  extended by luky.crypt.BlowfishECB
      extended by luky.crypt.BlowfishCBC

public class BlowfishCBC
extends BlowfishECB

implementation of the Blowfish encryption algorithm in CBC mode

Version:
1.0.0
Author:
Markus Hahn
 

Field Summary
 
Fields inherited from class luky.crypt.BlowfishECB
BLOCKSIZE, MAXKEYLENGTH
 
Constructor Summary
BlowfishCBC(byte[] bfkey, long lInitCBCIV)
          constructor
 
Method Summary
 void decrypt(byte[] buffer)
          decrypts a byte buffer (should be aligned to an 8 byte border) to itself
 void encrypt(byte[] buffer)
          encrypts a byte buffer (should be aligned to an 8 byte border) to itself
 long getCBCIV()
          get the current CBC IV (for cipher resets)
 void setCBCIV(byte[] newCBCIV)
          set the current CBC IV (for cipher resets)
 void setCBCIV(long lNewCBCIV)
          set the current CBC IV (for cipher resets)
 
Methods inherited from class luky.crypt.BlowfishECB
decryptBlock, encryptBlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlowfishCBC

public BlowfishCBC(byte[] bfkey,
                   long lInitCBCIV)
constructor

Parameters:
bfkey - key material, up to MAXKEYLENGTH bytes
lInitCBCIV - the CBC IV
Method Detail

getCBCIV

public long getCBCIV()
get the current CBC IV (for cipher resets)

Returns:
current CBC IV

setCBCIV

public void setCBCIV(long lNewCBCIV)
set the current CBC IV (for cipher resets)

Parameters:
lNewCBCIV - the new CBC IV

setCBCIV

public void setCBCIV(byte[] newCBCIV)
set the current CBC IV (for cipher resets)

Parameters:
newCBCIV - the new CBC IV in network byte ordered array

encrypt

public void encrypt(byte[] buffer)
encrypts a byte buffer (should be aligned to an 8 byte border) to itself

Parameters:
buffer - buffer to encrypt

decrypt

public void decrypt(byte[] buffer)
decrypts a byte buffer (should be aligned to an 8 byte border) to itself

Parameters:
buffer - buffer to decrypt

Luky Library - 4.1.1 (20061117-1148)