Package com.trilead.ssh2.crypto.cipher
Class DES
- java.lang.Object
-
- com.trilead.ssh2.crypto.cipher.DES
-
- All Implemented Interfaces:
BlockCipher
- Direct Known Subclasses:
DESede
public class DES extends java.lang.Object implements BlockCipher
DES.
-
-
Constructor Summary
Constructors Constructor Description DES()standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddesFunc(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.java.lang.StringgetAlgorithmName()intgetBlockSize()voidinit(boolean encrypting, byte[] key)initialise a DES cipher.voidreset()voidtransformBlock(byte[] in, int inOff, byte[] out, int outOff)
-
-
-
Method Detail
-
init
public void init(boolean encrypting, byte[] key)initialise a DES cipher.- Specified by:
initin interfaceBlockCipher- Parameters:
encrypting- whether or not we are for encryption.key- the parameters required to set up the cipher.- Throws:
java.lang.IllegalArgumentException- if the params argument is inappropriate.
-
getAlgorithmName
public java.lang.String getAlgorithmName()
-
getBlockSize
public int getBlockSize()
- Specified by:
getBlockSizein interfaceBlockCipher
-
transformBlock
public void transformBlock(byte[] in, int inOff, byte[] out, int outOff)- Specified by:
transformBlockin interfaceBlockCipher
-
reset
public void reset()
-
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!).
-
desFunc
protected void desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)the DES engine.
-
-