This mode is implemented independently of a particular cipher. Ciphers to which this mode should apply (e.g., DES) must be plugged-in using the constructor.
Note
This class does not deal with buffering or padding.
Modifier and Type | Field and Description |
---|---|
private final byte[] | |
protected byte[] | |
private byte[] |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv int | Returns: the length of the decrypted datathe buffer with the input data to be decrypted cipher, int the offset in cipherOffset, int cipherOffset the length of the input data cipherLen, byte[] the buffer for the result plain, int the offset in plainOffset)plain Implements abstract com. |
pack-priv int | Returns: the length of the encrypted datathe buffer with the input data to be encrypted plain, int the offset in plainOffset, int plain the length of the input data plainLen, byte[] the buffer for the result cipher, int the offset in cipherOffset)cipher Implements abstract com. |
pack-priv String | Returns: the stringCBC Implements abstract com. |
private int | |
private int | |
pack-priv void | init(boolean
flag indicating encryption or decryption decrypting, String the algorithm name algorithm, byte[] the key key, byte[] the iv iv)Implements abstract com. |
pack-priv void | reset()
Implements abstract com. |
pack-priv void | restore()
Implements abstract com. |
pack-priv void | save()
Implements abstract com. |
k | back to summary |
---|---|
private final byte[] k |
r | back to summary |
---|---|
protected byte[] r |
rSave | back to summary |
---|---|
private byte[] rSave |
CipherBlockChaining | back to summary |
---|---|
pack-priv CipherBlockChaining(SymmetricCipher embeddedCipher) |
decrypt | back to summary |
---|---|
pack-priv int decrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset) Implements abstract com. Performs decryption operation. The input cipher text It is also the application's responsibility to make sure that
|
encrypt | back to summary |
---|---|
pack-priv int encrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset) Implements abstract com. Performs encryption operation. The input plain text
|
getFeedback | back to summary |
---|---|
pack-priv String getFeedback() Implements abstract com. Gets the name of this feedback mode.
|
implDecrypt | back to summary |
---|---|
private int implDecrypt(byte[] cipher, int cipherOffset, int cipherLen, byte[] plain, int plainOffset)
|
implEncrypt | back to summary |
---|---|
private int implEncrypt(byte[] plain, int plainOffset, int plainLen, byte[] cipher, int cipherOffset)
|
init | back to summary |
---|---|
pack-priv void init(boolean decrypting, String algorithm, byte[] key, byte[] iv) throws InvalidKeyException Implements abstract com. Initializes the cipher in the specified mode with the given key and iv.
|
reset | back to summary |
---|---|
pack-priv void reset() Implements abstract com. Resets the iv to its original value. This is used when doFinal is called in the Cipher class, so that the cipher can be reused (with its original iv). |
restore | back to summary |
---|---|
pack-priv void restore() Implements abstract com. Restores the content of this cipher to the previous saved one. |
save | back to summary |
---|---|
pack-priv void save() Implements abstract com. Save the current content of this cipher. |