|
For the latest news and information visit The GNU Crypto project |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The basic visible methods of any block cipher mode.
Block ciphers encrypt plaintext in fixed size n-bit blocks. For messages larger than n bits, the simplest approach is to segment the message into n-bit blocks and process (encrypt and/or decrypt) each one separately (Electronic Codebook or ECB mode). But this approach has disadvantages in most applications. The block cipher modes of operations are one way of working around those disadvantages.
A Mode always employs an underlying block cipher for processing its input. For all intents and purposes, a Mode appears to behave as any other block cipher with the following differences:
Possible additional initialisation values for an instance of that type are:
IllegalStateException
will
be thrown if any method, other than reset()
is invoked on the
instance.
Field Summary | |
static int |
DECRYPTION
Constant indicating the instance is being used for decryption. |
static int |
ENCRYPTION
Constant indicating the instance is being used for encryption. |
static java.lang.String |
IV
Property name of the initialisation vector to use, if required, with this instance. |
static java.lang.String |
MODE_BLOCK_SIZE
Property name of the block size in which to operate this mode. |
static java.lang.String |
STATE
Property name of the state in which to operate this mode. |
Fields inherited from interface gnu.crypto.cipher.IBlockCipher |
CIPHER_BLOCK_SIZE, KEY_MATERIAL |
Method Summary | |
void |
update(byte[] in,
int inOffset,
byte[] out,
int outOffset)
A convenience method. |
Methods inherited from interface gnu.crypto.cipher.IBlockCipher |
blockSizes, clone, currentBlockSize, decryptBlock, defaultBlockSize, defaultKeySize, encryptBlock, init, keySizes, name, reset, selfTest |
Field Detail |
public static final java.lang.String STATE
Property name of the state in which to operate this mode. The value
associated to this property name is taken to be an Integer
which
value is either ENCRYPTION
or DECRYPTION
.
public static final java.lang.String MODE_BLOCK_SIZE
Property name of the block size in which to operate this mode. The
value associated with this property name is taken to be an Integer
.
If it is not specified, the value of the block size of the underlying
block cipher, used to construct the mode instance, shall be used.
public static final java.lang.String IV
Property name of the initialisation vector to use, if required, with this instance. The value associated with this property name is taken to be a byte array. If the concrete instance needs such a parameter, and it has not been specified as part of the initialissation parameters, an all-zero byte array of the appropriate size shall be used.
public static final int ENCRYPTION
Constant indicating the instance is being used for encryption.
public static final int DECRYPTION
Constant indicating the instance is being used for decryption.
Method Detail |
public void update(byte[] in, int inOffset, byte[] out, int outOffset) throws java.lang.IllegalStateException
A convenience method. Effectively invokes the encryptBlock()
or decryptBlock()
method depending on the operational state
of the instance.
in
- the plaintext.inOffset
- index of in
from which to start considering
data.out
- the ciphertext.outOffset
- index of out
from which to store result.
java.lang.IllegalStateException
- if the instance is not initialised.
|
For the latest news and information visit The GNU Crypto project |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |