au.net.aba.crypto.provider
Class DES

java.lang.Object
  |
  +--javax.crypto.CipherSpi
        |
        +--au.net.aba.crypto.provider.BlockCipher
              |
              +--au.net.aba.crypto.provider.DES
Direct Known Subclasses:
DESede

public class DES
extends BlockCipher

A class that provides DES encryption.


Field Summary
static java.lang.String ident
           
protected  int[] Kn1
           
protected  int[] work
           
 
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
DES()
           
 
Method Summary
protected  int decryptBlock(byte[] in, int inOff, int len, byte[] out, int outOff)
           
protected  void desfunc(int[] block, int[] keys)
          the DES engine.
protected  int encryptBlock(byte[] in, int inOff, int len, byte[] out, int outOff)
           
protected  void prepareKeys(int opMode, byte[] key, int[] keys)
          prepare the key for whatever processing we are planing.
protected  void scrunch(byte[] outof, int offset, int[] into)
          pack 8 bytes from outof into 2 ints.
protected  void setKey(java.security.Key key)
           
protected  void unscrunch(int[] outof, byte[] into, int offset)
          extract 8 bytes from the 2 ints in outof.
 
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

work

protected int[] work

Kn1

protected int[] Kn1
Constructor Detail

DES

public DES()
Method Detail

setKey

protected void setKey(java.security.Key key)
               throws java.security.InvalidKeyException
Overrides:
setKey in class BlockCipher

encryptBlock

protected int encryptBlock(byte[] in,
                           int inOff,
                           int len,
                           byte[] out,
                           int outOff)
                    throws IllegalBlockSizeException
Overrides:
encryptBlock in class BlockCipher

decryptBlock

protected int decryptBlock(byte[] in,
                           int inOff,
                           int len,
                           byte[] out,
                           int outOff)
                    throws BadPaddingException
Overrides:
decryptBlock in class BlockCipher

prepareKeys

protected void prepareKeys(int opMode,
                           byte[] key,
                           int[] keys)
prepare the key for whatever processing we are planing. Acknowledgements for this routine go to James Gillogly & Phil Karn. (whoever, and wherever they are!).

scrunch

protected void scrunch(byte[] outof,
                       int offset,
                       int[] into)
pack 8 bytes from outof into 2 ints.

unscrunch

protected void unscrunch(int[] outof,
                         byte[] into,
                         int offset)
extract 8 bytes from the 2 ints in outof.

desfunc

protected void desfunc(int[] block,
                       int[] keys)
the DES engine.