All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----cryptix.security.BlockCipher
This is an abstract superclass for ciphers that encrypt and decrypt a fixed length block with a secret key.
BlockCipher objects support only the Cryptix v2.2 API.
Note: compatibility with Cryptix 2.2 applies only to clients of this class. Subclasses must be rewritten as JCE algorithms.
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.4 $
protected Cipher cipher
protected int blockSize
protected BlockCipher(Cipher cipher,
byte userKey[])
public final int blockLength()
blockSize(),
getPlaintextBlockSize() or
getCiphertextBlockSize() instead.
public final int keyLength()
The JCE equivalent is to call getEncoded() on the Key
object, and find the length of the resulting byte array. It is not
possible to directly get the key object that has been used to
initialize a Cipher.
public final void encrypt(byte buf[])
initEncrypt(key) and
update(buf, 0, buf.length, text, 0) instead.
buf.length must be equal to the block size.
public final void encrypt(byte in[],
byte out[])
initEncrypt(key) and
update(in, 0, in.length, out, 0) instead.
in.length and out.length must be equal to the
block size.
public void encrypt(byte in[],
int inOffset,
byte out[],
int outOffset)
initEncrypt(key) and update(in, inOffset,
blockSize, out, outOffset) instead.
in[inOffset..inOffset+blockSize-1]
is encrypted, and the resulting ciphertext is written to
out[outOffset..outOffset+blockSize-1].
Note that there must be sufficient bytes left in each array.
The in and out arrays can be the same, in which case the behaviour is the same as if the input array was copied before any output is written.
in
out
public final void decrypt(byte text[])
initDecrypt(key) and
update(buf, 0, buf.length, text, 0) instead.
buf.length must be equal to the block size.
public final void decrypt(byte in[],
byte out[])
initDecrypt(key) and
update(in, 0, in.length, out, 0) instead.
in.length and out.length must be equal to the
block size.
public void decrypt(byte in[],
int inOffset,
byte out[],
int outOffset)
initDecrypt(key) and update(in, inOffset,
blockSize, out, outOffset) instead.
in[inOffset..inOffset+blockSize-1]
is decrypted, and the resulting plaintext is written to
out[outOffset..outOffset+blockSize-1].
Note that there must be sufficient bytes left in each array.
The in and out arrays can be the same, in which case the behaviour is the same as if the input array was copied before any output is written.
in
out
All Packages Class Hierarchy This Package Previous Next Index