com.mindbright.security.cipher
Class BlockCipher

java.lang.Object
  extended by com.mindbright.jce.crypto.CipherSpi
      extended by com.mindbright.security.cipher.BlockCipher
Direct Known Subclasses:
Blowfish, CAST128, DES, DES3, IDEA, RC2, Rijndael, Twofish

public abstract class BlockCipher
extends CipherSpi


Constructor Summary
BlockCipher()
           
 
Method Summary
abstract  void blockDecrypt(byte[] in, int offset, byte[] out, int outOffset)
           
abstract  void blockEncrypt(byte[] in, int offset, byte[] out, int outOffset)
           
protected  int engineDoFinal(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
           
protected  int engineGetBlockSize()
           
protected  byte[] engineGetIV()
           
protected  int engineGetOutputSize(int inputLen)
           
protected  void engineInit(int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random)
           
protected  void engineInit(int opmode, Key key, SecureRandom random)
           
protected  void engineSetMode(java.lang.String mode)
           
protected  void engineSetPadding(java.lang.String padding)
           
abstract  int getBlockSize()
           
protected static int getIntLSBO(byte[] src, int srcOffset)
           
protected static int getIntMSBO(byte[] src, int srcOffset)
           
abstract  void initializeKey(byte[] key)
           
protected static void nboIncr(byte[] b)
           
protected static void putIntLSBO(int val, byte[] dest, int destOffset)
           
protected static void putIntMSBO(int val, byte[] dest, int destOffset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlockCipher

public BlockCipher()
Method Detail

engineDoFinal

protected int engineDoFinal(byte[] input,
                            int inputOffset,
                            int inputLen,
                            byte[] output,
                            int outputOffset)
Specified by:
engineDoFinal in class CipherSpi

getIntMSBO

protected static final int getIntMSBO(byte[] src,
                                      int srcOffset)

getIntLSBO

protected static final int getIntLSBO(byte[] src,
                                      int srcOffset)

putIntMSBO

protected static final void putIntMSBO(int val,
                                       byte[] dest,
                                       int destOffset)

putIntLSBO

protected static final void putIntLSBO(int val,
                                       byte[] dest,
                                       int destOffset)

nboIncr

protected static final void nboIncr(byte[] b)

engineGetBlockSize

protected int engineGetBlockSize()
Specified by:
engineGetBlockSize in class CipherSpi

engineGetIV

protected byte[] engineGetIV()
Specified by:
engineGetIV in class CipherSpi

engineGetOutputSize

protected int engineGetOutputSize(int inputLen)
Specified by:
engineGetOutputSize in class CipherSpi

engineInit

protected void engineInit(int opmode,
                          Key key,
                          AlgorithmParameterSpec params,
                          SecureRandom random)
                   throws InvalidKeyException
Specified by:
engineInit in class CipherSpi
Throws:
InvalidKeyException

engineInit

protected void engineInit(int opmode,
                          Key key,
                          SecureRandom random)
                   throws InvalidKeyException
Specified by:
engineInit in class CipherSpi
Throws:
InvalidKeyException

engineSetMode

protected void engineSetMode(java.lang.String mode)
Specified by:
engineSetMode in class CipherSpi

engineSetPadding

protected void engineSetPadding(java.lang.String padding)
Specified by:
engineSetPadding in class CipherSpi

getBlockSize

public abstract int getBlockSize()

initializeKey

public abstract void initializeKey(byte[] key)
                            throws InvalidKeyException
Throws:
InvalidKeyException

blockEncrypt

public abstract void blockEncrypt(byte[] in,
                                  int offset,
                                  byte[] out,
                                  int outOffset)

blockDecrypt

public abstract void blockDecrypt(byte[] in,
                                  int offset,
                                  byte[] out,
                                  int outOffset)