ch.ethz.ssh2.crypto.cipher
public class DES extends java.lang.Object implements BlockCipher
Constructor and Description |
---|
DES()
standard constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
java.lang.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) |
public void init(boolean encrypting, byte[] key)
init
in interface BlockCipher
encrypting
- whether or not we are for encryption.key
- the parameters required to set up the cipher.java.lang.IllegalArgumentException
- if the params argument is inappropriate.public java.lang.String getAlgorithmName()
public int getBlockSize()
getBlockSize
in interface BlockCipher
public void transformBlock(byte[] in, int inOff, byte[] out, int outOff)
transformBlock
in interface BlockCipher
public void reset()
protected int[] generateWorkingKey(boolean encrypting, byte[] key, int off)
protected void desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)