All Packages Class Hierarchy This Package Previous Next Index
Class is.hi.logir.cryptonite.EncryptCFB
java.lang.Object
|
+----is.hi.logir.cryptonite.Cryptonite
|
+----is.hi.logir.cryptonite.EncryptMode
|
+----is.hi.logir.cryptonite.EncryptCFB
- public class EncryptCFB
- extends EncryptMode
This class implements 8-bit Cipherblock FeedBack mode which encrypts
a whole block for each plaintext character. This makes it much slower
than ECB or CBC mode, but it can be used for streaming and no garbage
is ever inserted.
- Author:
- Logi Ragnarsson
(logir@hi.is)
- See Also:
- DecryptCFB
-
EncryptCFB()
- Create a new CBF-mode encrypt session with no key.
-
EncryptCFB(CipherKey)
- Create a new CBF-mode encrypt session with the specified key.
-
encrypt(byte[], int, int)
- Encrypt
length
bytes from source
,
starting at i
and return the ciphertext.
-
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.
EncryptCFB
public EncryptCFB(CipherKey key)
- Create a new CBF-mode encrypt session with the specified key.
EncryptCFB
public EncryptCFB()
- Create a new CBF-mode encrypt session with no key. No
encryption can be performed until the
setKey()
method has been called.
getKey
public CipherKey getKey()
- Return the key used for encryption.
- Overrides:
- getKey in class EncryptMode
setKey
public void setKey(CipherKey key)
- Set the key to use for encryption. Do not call this method
when there may be data in the internal buffer.
- Overrides:
- setKey in class EncryptMode
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.
- Overrides:
- flush in class EncryptMode
encrypt
public synchronized byte[] encrypt(byte source[],
int i,
int length)
- Encrypt
length
bytes from source
,
starting at i
and return the ciphertext. All data
is encrypted immediately.
- Overrides:
- encrypt in class EncryptMode
All Packages Class Hierarchy This Package Previous Next Index