All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----is.hi.logir.cryptonite.Cryptonite | +----is.hi.logir.cryptonite.EncryptMode | +----is.hi.logir.cryptonite.EncryptCBC
Because CBC mode encrypts one block at a time, encryption is only performed when a full block of data has been sent to the object. This also means that when you call the flush() method, random data is appended to the block before encryption. This can be avoided in two ways: Either by flushing regularly and sending the size of the data packets to the reciever, or by using the CFB mode.
length
bytes from source
,
starting at i
and return the ciphertext.
public EncryptCBC(CipherKey key)
public EncryptCBC()
setKey()
method has been called.
public CipherKey getKey()
public void setKey(CipherKey key)
public synchronized byte[] flush()
public synchronized byte[] encrypt(byte source[], int i, int length)
length
bytes from source
,
starting at i
and return the ciphertext. Data is
encrypted in blocks and only whole blocks of ciphertext are
written to dest
. Any remaining data will be stored
and prepended to source
in the next call to
encrypt
.
All Packages Class Hierarchy This Package Previous Next Index