|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--de.bb.security.BlockCipher
| Field Summary | |
protected int |
blockSize
|
| Constructor Summary | |
BlockCipher(int _blockSize)
Creates a new BlockCipher object. |
|
| Method Summary | |
int |
blockSize()
Query the used block size. |
abstract void |
decrypt(byte[] cipherText,
int cipherOff,
byte[] clearText,
int clearOff)
Decrypt one block of |
void |
decryptCBC(byte[] iv,
byte[] cipherText,
byte[] clearText)
Decrypt a complete byte array wihthout padding in CBC mode. |
byte[] |
decryptCBCAndPadd(byte[] iv,
byte[] cipherText)
Decrypt a complete byte array wiht padding in CBC mode. |
void |
decryptECB(byte[] cipherText,
byte[] clearText)
Decrypt a complete byte array without padding in ECB mode. |
abstract void |
encrypt(byte[] clearText,
int clearOff,
byte[] cipherText,
int cipherOff)
Encrypt one block of |
void |
encryptCBC(byte[] iv,
byte[] clearText,
byte[] cipherText)
Encrypt a complete byte array without padding in CBC mode. |
byte[] |
encryptCBCAndPadd(byte[] iv,
byte[] clearText)
Encrypt a complete byte array wiht padding in CBC mode. |
void |
encryptECB(byte[] clearText,
byte[] cipherText)
Encrypt a complete byte array without padding in ECB mode. |
protected int |
getBufferLength(int plaintextLength)
Calculate the buffer length for padding |
abstract void |
setKey(byte[] keyData)
Set a givem key. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int blockSize
| Constructor Detail |
public BlockCipher(int _blockSize)
_blockSize - defines the size of the smalles encryptable block| Method Detail |
public final int blockSize()
public abstract void setKey(byte[] keyData)
keyData - the bytes which are used for the key
public abstract void encrypt(byte[] clearText,
int clearOff,
byte[] cipherText,
int cipherOff)
clearText - input data which is encryptedclearOff - offset into input datacipherText - output data which is encrypted.cipherOff - offset into output data
public abstract void decrypt(byte[] cipherText,
int cipherOff,
byte[] clearText,
int clearOff)
cipherText - output data which is encrypted.cipherOff - offset into output dataclearText - input data which is encryptedclearOff - offset into input data
public final void encryptECB(byte[] clearText,
byte[] cipherText)
clearText - input data which is encryptedcipherText - output data which is encrypted.
public final void decryptECB(byte[] cipherText,
byte[] clearText)
cipherText - output data which is encrypted.clearText - input data which is encrypted
public final void encryptCBC(byte[] iv,
byte[] clearText,
byte[] cipherText)
iv - the initialization vector.clearText - input data which is encryptedcipherText - output data which is encrypted.
public final void decryptCBC(byte[] iv,
byte[] cipherText,
byte[] clearText)
iv - the initialization vector.cipherText - output data which is encrypted.clearText - input data which is encryptedprotected int getBufferLength(int plaintextLength)
plaintextLength - length of input data
public final byte[] encryptCBCAndPadd(byte[] iv,
byte[] clearText)
iv - the initialization vector.clearText - input data which is encrypted
public final byte[] decryptCBCAndPadd(byte[] iv,
byte[] cipherText)
iv - the initialization vector.cipherText - output data which is encrypted.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||