|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lava.security.des.DesCbcCoder | +--lava.security.des.DesCbcDecoder
DES decryption in Cipher Block Chaining (CBC) mode.
Details: DesCbcEncoder
performs DES decryption in Cipher Block Chaining (CBC) mode. See superclass documention for more details.
DesCbcEncoder
Constructor Summary | |
DesCbcDecoder(DesKey key,
long iv)
Specifies encryption key and initialization vector. |
|
DesCbcDecoder(IBlockCipher64 engine,
long iv)
Specifies initialization vector and encryption function. |
Method Summary | |
void |
beginTransform()
Resets transform. |
int |
continueTransform(byte[] input,
byte[] output,
int length)
Encrypts blocks using byte arrays. |
int |
continueTransform(java.lang.Object input,
java.lang.Object output,
int length)
Processes text. |
Methods inherited from class lava.security.des.DesCbcCoder |
completeTransform,
getTransformInputWidth,
getTransformOutputWidth |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public DesCbcDecoder(IBlockCipher64 engine, long iv)
Details: This constructor initializes a new instance with the given block cipher and initialization vector.
engine
- the block cipheriv
- the initialization vectorpublic DesCbcDecoder(DesKey key, long iv)
Details: This constructor initializes a standard DES CBC cipher with the given initialization vector and DES encryption key.
key
- the encryption keyiv
- the initialization vectorMethod Detail |
public final void beginTransform()
Details: beginTransform
initializes this transform in preparation for processing a new input text stream.
public final int continueTransform(java.lang.Object input, java.lang.Object output, int length)
Details: continueTransform
consumes input text and produces output text. Input is retrieved from the provided source array (src), while output is stored in the provided destination array (dest). The return value normally indicates the number of symbols written into the destination array (see note below).
Depending on the particular transformation represented by this implementation, the number of output symbols produced per call may always be equal to the number of input symbols consumed (for example, if the transformation performs text compression). Similarly, a call to this method may cause the production of more elements than the supplied destination array can store. It is the caller's responsibility to make sure the supplied destination array is large enough to receive the symbols produced.
If the destination array is too short, the implementation may, at its option, discard the overflow. However, an implementation may also choose to retain the overflow portion and make it available in a subsequent call to this method. (Check the implementation documentation to see which approach is taken.) If the overflow is discarded, the return value must indicate the number of symbols written into the array plus the number of overflow symbols discarded.
It is legal to call this method with src set to null
so long as length is also set to 0. This might be useful in situations where a transform is expected to produce output symbols even when the caller has no input symbols to supply (i.e., to recover buffered overflow from a previous call).
continueTransform
always writes as much data into dest as can be computed from the current input history. However, because some data may not be computable until the transformation sees the last symbol (such as in checksum algorithms), it may be necessary to obtain the rest of the output data by calling completeTransform
.
The results of continueTransform
are undefined if it is called after completeTransform
but before beginTransform
.
src
- the source arraydest
- the destination arraylength
- number of symbols to processpublic final int continueTransform(byte[] input, byte[] output, int length)
Details: This method is not part of the ITextTransform
API, but it is provided to facilitate symbol processing where the symbols are stored in big endian byte arrays.
The length parameter and return value count byte
s, not 64-bit blocks. Results are undefined if length is positive and not a multiple of 8.
input
- the input blocksoutput
- buffer for output blockslength
- number of input array elements to process
|
Sharkysoft home | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |