ccs.crypt
Class BlowfishWrapper

java.lang.Object
  extended by ccs.crypt.BlowfishWrapper
All Implemented Interfaces:
org.bouncycastle.crypto.BlockCipher

public class BlowfishWrapper
extends java.lang.Object
implements org.bouncycastle.crypto.BlockCipher

A wrapper around the BouncyCastle Blowfish engine. The wrapper provides modified key handling to cope with very long keys (anything over 56 bytes is hashed down to 40 bytes; this allows you to distil a silk purse out of several sow's ears.) Also anything shorter than 8 bytes is disallowed.


Constructor Summary
BlowfishWrapper()
           
 
Method Summary
 java.lang.String getAlgorithmName()
           
 int getBlockSize()
           
 void init(boolean encrypting, org.bouncycastle.crypto.CipherParameters params)
           
 int processBlock(byte[] in, int inOff, byte[] out, int outOff)
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlowfishWrapper

public BlowfishWrapper()
Method Detail

init

public void init(boolean encrypting,
                 org.bouncycastle.crypto.CipherParameters params)
Specified by:
init in interface org.bouncycastle.crypto.BlockCipher

getAlgorithmName

public java.lang.String getAlgorithmName()
Specified by:
getAlgorithmName in interface org.bouncycastle.crypto.BlockCipher

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface org.bouncycastle.crypto.BlockCipher

processBlock

public int processBlock(byte[] in,
                        int inOff,
                        byte[] out,
                        int outOff)
                 throws org.bouncycastle.crypto.DataLengthException,
                        java.lang.IllegalStateException
Specified by:
processBlock in interface org.bouncycastle.crypto.BlockCipher
Throws:
org.bouncycastle.crypto.DataLengthException
java.lang.IllegalStateException

reset

public void reset()
Specified by:
reset in interface org.bouncycastle.crypto.BlockCipher