au.net.aba.crypto.provider
Class Blowfish

java.lang.Object
  |
  +--javax.crypto.CipherSpi
        |
        +--au.net.aba.crypto.provider.BlockCipher
              |
              +--au.net.aba.crypto.provider.Blowfish

public final class Blowfish
extends BlockCipher

A class that provides Blowfish key encryption operations, such as encoding data and generating keys.


Field Summary
static java.lang.String ident
           
protected static int Rounds
           
 
Fields inherited from class au.net.aba.crypto.provider.BlockCipher
BLOCK_SIZE, buffer, bufferPos, CBC, cbcV, ECB, firstBlock, ident, ivec, ivEncrypted, ivInline, key, mode, paddedStream, random, streamMode
 
Fields inherited from class javax.crypto.CipherSpi
ident
 
Constructor Summary
Blowfish()
           
 
Method Summary
protected  int decryptBlock(byte[] src, int srcIndex, int len, byte[] dst, int dstIndex)
          Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
protected  int encryptBlock(byte[] src, int srcIndex, int len, byte[] dst, int dstIndex)
          Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset.
protected  void setKey(java.security.Key inKey)
          Re-key the cipher.
 
Methods inherited from class au.net.aba.crypto.provider.BlockCipher
engineDoFinal, engineDoFinal, engineGetBlockSize, engineGetIV, engineGetOutputSize, engineGetParameters, engineInit, engineInit, engineInit, engineSetMode, engineSetPadding, engineUpdate, engineUpdate, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ident

public static final java.lang.String ident

Rounds

protected static final int Rounds
Constructor Detail

Blowfish

public Blowfish()
Method Detail

setKey

protected void setKey(java.security.Key inKey)
               throws java.security.InvalidKeyException
Re-key the cipher. If the provided Key is not compatible with this cipher the exception should throw an InvalidKeyException.
Parameters:
inKey - the key to be used.
Throws:
java.security.InvalidKeyException - if the key is of the wrong type.
Overrides:
setKey in class BlockCipher

encryptBlock

protected int encryptBlock(byte[] src,
                           int srcIndex,
                           int len,
                           byte[] dst,
                           int dstIndex)
                    throws IllegalBlockSizeException
Encrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. The input will be an exact multiple of our blocksize.
Overrides:
encryptBlock in class BlockCipher

decryptBlock

protected int decryptBlock(byte[] src,
                           int srcIndex,
                           int len,
                           byte[] dst,
                           int dstIndex)
                    throws BadPaddingException
Decrypt the given input starting at the given offset and place the result in the provided buffer starting at the given offset. The input will be an exact multiple of our blocksize.
Overrides:
decryptBlock in class BlockCipher