|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.logi.crypto.Crypto
org.logi.crypto.modes.EncryptMode
Descendants of EncryptMode encrypt arbtrarily large arrays of plaintext. A corresponding DecryptMode should be used for decryption.
Most EncryptModes use a CipherKey object to do actual encryption and do additional computations to mask repetitions in the plaintext.
DecryptMode
Field Summary |
Fields inherited from class org.logi.crypto.Crypto |
BIT, cdsPath, EMPTY_ARRAY, FOUR, keySource, NIBBLE, ONE, primeCertainty, random, TWO, ZERO |
Constructor Summary | |
EncryptMode()
|
Method Summary | |
void |
close()
Close files and kill threads owned by the object. |
abstract byte[] |
encrypt(byte[] source,
int i,
int length)
Send bytes to the EncryptMode for encryption. |
void |
finalize()
This finalizer calls close(). |
abstract byte[] |
flush()
Pads the internal buffer, encrypts it and returns the ciphertext. |
byte[] |
flush(byte[] source,
int i,
int length)
Equivalent to calling encrypt(source,i,length)
followed by flush() . |
abstract CipherKey |
getKey()
Return the key used for encryption. |
abstract int |
plainBlockSize()
Return the size of the blocks of plaintext encrypted by this object. |
abstract void |
setKey(CipherKey key)
Set the key to use for encryption. |
Methods inherited from class org.logi.crypto.Crypto |
binString, binString, equal, equalRelaxed, equalSub, fromHexNibble, fromHexString, fromString, fromString, hexString, hexString, hexString, hexString, hexString, initRandom, initRandom, makeClass, makeInt, makeLong, makeSessionKey, pastSpace, pickBits, pickBits, readBlock, readInt, writeBytes, writeBytes, writeInt |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EncryptMode()
Method Detail |
public abstract CipherKey getKey()
public abstract void setKey(CipherKey key)
public abstract int plainBlockSize()
public abstract byte[] flush()
public byte[] flush(byte[] source, int i, int length)
encrypt(source,i,length)
followed by flush()
.
public abstract byte[] encrypt(byte[] source, int i, int length)
Encrypt length
bytes from source
,
starting at i
and return the ciphertext. Data may be
encrypted in blocks in which case only whole blocks of ciphertext
are written to dest
. Any remaining plaintext will be
stored and prepended to source
in the next call to
encrypt
.
public void close()
public void finalize()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |