com.trilead.ssh2.crypto.cipher

Class DES

Implemented Interfaces:
BlockCipher
Known Direct Subclasses:
DESede

public class DES
extends java.lang.Object
implements BlockCipher

DES.

Constructor Summary

DES()
standard constructor.

Method Summary

protected void
desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)
the DES engine.
protected int[]
generateWorkingKey(boolean encrypting, byte[] key, int off)
generate an integer based working key based on our secret key and what we processing we are planning to do.
String
getAlgorithmName()
int
getBlockSize()
void
init(boolean encrypting, byte[] key)
initialise a DES cipher.
void
reset()
void
transformBlock(byte[] in, int inOff, byte[] out, int outOff)

Constructor Details

DES

public DES()
standard constructor.

Method Details

desFunc

protected void desFunc(int[] wKey,
                       byte[] in,
                       int inOff,
                       byte[] out,
                       int outOff)
the DES engine.

generateWorkingKey

protected int[] generateWorkingKey(boolean encrypting,
                                   byte[] key,
                                   int off)
generate an integer based working key based on our secret key and what we processing we are planning to do. Acknowledgements for this routine go to James Gillogly & Phil Karn. (whoever, and wherever they are!).

getAlgorithmName

public String getAlgorithmName()

getBlockSize

public int getBlockSize()
Specified by:
getBlockSize in interface BlockCipher

init

public void init(boolean encrypting,
                 byte[] key)
initialise a DES cipher.
Specified by:
init in interface BlockCipher
Parameters:
encrypting - whether or not we are for encryption.
key - the parameters required to set up the cipher.

reset

public void reset()

transformBlock

public void transformBlock(byte[] in,
                           int inOff,
                           byte[] out,
                           int outOff)
Specified by:
transformBlock in interface BlockCipher