|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--de.bb.security.BlockCipher
|
+--de.bb.security.DES
| Fields inherited from class de.bb.security.BlockCipher |
blockSize |
| Constructor Summary | |
|
DES()
Creates a new DesCipher object for en- and decrypting |
protected |
DES(int kl)
for derived classes as DES2 (2-key 3-DES) and DES3 (3-key 3-DES) |
| Method Summary | |
void |
decrypt(byte[] cipherText,
int cipherOff,
byte[] clearText,
int clearOff)
Decrypt one block of |
void |
encrypt(byte[] clearText,
int clearOff,
byte[] cipherText,
int cipherOff)
Encrypt one block of |
static void |
establishParity(byte[] key)
Add an odd parity to the given key. |
byte[] |
generateKey()
Create a new DES key and ensure that it is not a weak key. |
static boolean |
isOdd(byte _v)
isOdd |
static boolean |
keyIsWeak(byte[] key)
Check if the given key is a weak key. |
protected void |
makeKeyData(byte[] key)
|
void |
setKey(byte[] key)
Set the key for encryption and decryption. |
void |
setKeyUnchecked(byte[] key)
Set the key for encryption and decryption. |
| Methods inherited from class de.bb.security.BlockCipher |
blockSize, decryptCBC, decryptCBCAndPadd, decryptECB, encryptCBC, encryptCBCAndPadd, encryptECB, getBufferLength |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DES()
protected DES(int kl)
| Method Detail |
public void setKeyUnchecked(byte[] key)
key - the given key, an array with 8 bytesprotected void makeKeyData(byte[] key)
public void setKey(byte[] key)
setKey in class BlockCipherkey - the given key, an array with 8 bytes
public void encrypt(byte[] clearText,
int clearOff,
byte[] cipherText,
int cipherOff)
encrypt in class BlockCipherclearText - input data which is encryptedclearOff - offset into input datacipherText - output data which is encrypted.cipherOff - offset into output data
public void decrypt(byte[] cipherText,
int cipherOff,
byte[] clearText,
int clearOff)
decrypt in class BlockCiphercipherText - output data which is encrypted.cipherOff - offset into output dataclearText - input data which is encryptedclearOff - offset into input datapublic static final boolean keyIsWeak(byte[] key)
key - this key is testes against the known weak keys.public static final void establishParity(byte[] key)
key - this key is made odd.public static final boolean isOdd(byte _v)
public byte[] generateKey()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||