|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.vattp.data.DES
Untamed:
Field Summary | |
private static int |
BLOCK_SIZE
|
private static boolean |
DEBUG
|
private static int |
debuglevel
|
private static int |
DECRYPT
|
private static int |
ENCRYPT
|
private int |
encryptDecryptState
State for encrypt/decrypt/uninitialized. |
private static String |
HEXSTR
|
private static int |
INTERNAL_KEY_LENGTH
|
private static int |
KEY_LENGTH
|
private static int |
ROUNDS
|
private static int[] |
SKB
Table for PC2 permutations in key schedule computation. |
private int[] |
sKey
The internal key schedule. |
private static int[] |
SP_TRANS
Table for S-boxes and permutations, used in encrypt_base. |
private static String[][] |
tests
|
private static int |
UNINITIALIZED
|
Constructor Summary | |
DES()
Enabled: Constructs a DES cipher object, in the UNINITIALIZED state. |
Method Summary | |
private static boolean |
areEqual(byte[] a,
byte[] b)
|
int |
blockSize()
Enabled: SPI: Returns the length of an input block, in bytes. |
Object |
clone()
Suppressed: Always throws a CloneNotSupportedException (cloning of ciphers is not supported for security reasons). |
byte[] |
crypt(byte[] data)
Enabled: |
private void |
decrypt_base(int[] io)
Implements DES decryption without IP and FP. |
private void |
des(byte[] in,
int inOffset,
byte[] out,
int outOffset,
boolean encrypt)
Encrypts/decrypts a block, of length BLOCK_SIZE. |
private void |
encrypt_base(int[] io)
Implements DES encryption without IP and FP. |
private static void |
finalPermutation(int[] io)
|
private static String |
getAlgorithm()
|
private static byte[] |
hexFromString(String s)
|
void |
initDecrypt(byte[] key)
Enabled: SPI: Initializes this cipher for decryption, using the specified key. |
void |
initEncrypt(byte[] key)
Enabled: SPI: Initializes this cipher for encryption, using the specified key. |
private static void |
initialPermutation(int[] io)
|
static void |
main(String[] argv)
Enabled: Entry point for self_test. |
private void |
makeKey(byte[] userkey)
Expands a user-key to a working key schedule. |
private static void |
self_test()
|
int |
update(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)
Enabled: SPI: This is the main method for updating data. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final boolean DEBUG
private static final int debuglevel
private static final int ROUNDS
private static final int BLOCK_SIZE
private static final int KEY_LENGTH
private static final int INTERNAL_KEY_LENGTH
private int encryptDecryptState
private static final int UNINITIALIZED
private static final int ENCRYPT
private static final int DECRYPT
private static final int[] SKB
private final int[] sKey
private static final int[] SP_TRANS
private static final String[][] tests
private static final String HEXSTR
Constructor Detail |
public DES()
Method Detail |
public final Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
java.lang.Cloneable
public int blockSize()
public void initEncrypt(byte[] key) throws InvalidKeyException
key
- the key to use for encryption.
InvalidKeyException
- if one of the following occurs: public void initDecrypt(byte[] key) throws InvalidKeyException
key
- the key to use for decryption.
InvalidKeyException
- if one of the following occurs: public byte[] crypt(byte[] data)
public int update(byte[] in, int inOffset, int inLen, byte[] out, int outOffset)
in and out may be the same array, and the input and output regions may overlap.
in
- the input data.inOffset
- the offset into in specifying where the data starts.inLen
- the length of the subarray.out
- the output array.outOffset
- the offset indicating where to start writing into
the out array.
private void makeKey(byte[] userkey) throws InvalidKeyException
userkey
- the user-key object to use.
InvalidKeyException
- if one of the following occurs: private void des(byte[] in, int inOffset, byte[] out, int outOffset, boolean encrypt)
in
- an array containing the input blockinOffset
- the starting offset of the input blockout
- an array containing the output blockencrypt
- true to encrypt, false to decryptprivate void encrypt_base(int[] io)
private void decrypt_base(int[] io)
private static void initialPermutation(int[] io)
private static void finalPermutation(int[] io)
private static String getAlgorithm()
public static void main(String[] argv)
private static void self_test() throws Exception
Exception
private static boolean areEqual(byte[] a, byte[] b)
private static byte[] hexFromString(String s)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |