All Packages Class Hierarchy This Package Previous Next Index
Class is.logi.crypto.modes.DecryptOFB
java.lang.Object
|
+----is.logi.crypto.Crypto
|
+----is.logi.crypto.modes.DecryptMode
|
+----is.logi.crypto.modes.DecryptOFB
- public class DecryptOFB
- extends DecryptMode
Use this class to decrypt ciphertext generated by EncryptOFB.
Note that unlike ECB or CBC mode, OFB mode uses teh same
key to encrypt and decrypt, even with asymmetric ciphers.
- Author:
- Logi Ragnarsson
(logir@hi.is)
- See Also:
- EncryptOFB
-
DecryptOFB(CipherKey, int)
- Create a new OFB-mode decrypt session with the specified
key
.
-
DecryptOFB(int)
- Create a new OFB-mode decrypt session with no key.
-
decrypt(byte[], int, int)
- Send bytes to the DecryptCFB object for encryption.
-
flush()
- Padds the internal buffer, encrypts it and returns the ciphertext.
-
getKey()
- Return the key used for encryption.
-
setKey(CipherKey)
- Set the key to use for encryption.
DecryptOFB
public DecryptOFB(CipherKey key,
int bufSize)
- Create a new OFB-mode decrypt session with the specified
key
. A buffer of bufSize
bytes is created
to hold a pre-calculated xor-stream.
DecryptOFB
public DecryptOFB(int bufSize)
- Create a new OFB-mode decrypt session with no key. No
encryption can be performed until the
setKey()
method has been called.
A buffer of bufSize
bytes is created to hold a
pre-calculated xor-stream.
getKey
public CipherKey getKey()
- Return the key used for encryption.
- Overrides:
- getKey in class DecryptMode
setKey
public void setKey(CipherKey key)
- Set the key to use for encryption.
- Overrides:
- setKey in class DecryptMode
flush
public synchronized byte[] flush()
- Padds the internal buffer, encrypts it and returns the ciphertext.
Since CBF mode doesn't use an internal buffer, an empty array is
returned.
decrypt
public synchronized byte[] decrypt(byte source[],
int i,
int length)
- Send bytes to the DecryptCFB object for encryption.
Decrypt length
bytes from source
,
starting at i
and return the plaintext.
- Overrides:
- decrypt in class DecryptMode
All Packages Class Hierarchy This Package Previous Next Index