net.sourceforge.jtds.util
public class DESEngine extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static int[] |
bigbyte |
protected static int |
BLOCK_SIZE |
(package private) static short[] |
bytebit |
(package private) static short[] |
Df_Key
what follows is mainly taken from "Applied Cryptography", by
Bruce Schneier, however it also bears great resemblance to Richard
Outerbridge's D3DES...
|
(package private) static byte[] |
pc1 |
(package private) static byte[] |
pc2 |
(package private) static int[] |
SP1 |
(package private) static int[] |
SP2 |
(package private) static int[] |
SP3 |
(package private) static int[] |
SP4 |
(package private) static int[] |
SP5 |
(package private) static int[] |
SP6 |
(package private) static int[] |
SP7 |
(package private) static int[] |
SP8 |
(package private) static byte[] |
totrot |
private int[] |
workingKey |
Constructor and Description |
---|
DESEngine()
standard constructor.
|
DESEngine(boolean encrypting,
byte[] key)
mdb: convenient 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)
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.
|
int |
processBlock(byte[] in,
int inOff,
byte[] out,
int outOff) |
void |
reset() |
protected static final int BLOCK_SIZE
private int[] workingKey
static short[] Df_Key
static short[] bytebit
static int[] bigbyte
static byte[] pc1
static byte[] totrot
static byte[] pc2
static int[] SP1
static int[] SP2
static int[] SP3
static int[] SP4
static int[] SP5
static int[] SP6
static int[] SP7
static int[] SP8
public DESEngine()
public DESEngine(boolean encrypting, byte[] key)
public void init(boolean encrypting, byte[] key)
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()
public int processBlock(byte[] in, int inOff, byte[] out, int outOff)
public void reset()
protected int[] generateWorkingKey(boolean encrypting, byte[] key)
protected void desFunc(int[] wKey, byte[] in, int inOff, byte[] out, int outOff)
Generated on March 22 2014