cryptix.provider.mode
Class CFB
- FeedbackCipher, Parameterized, SymmetricCipher
Implements a byte-oriented stream cipher using n-bit CFB with an
n-bit-sized block cipher.
The full block size of the supplied cipher is used for the
Cipher Feedback Mode. The bytes supplied are processed and
returned immediately.
References:
- Bruce Schneier,
"Section 9.6 Cipher Feedback Mode," and "Section 9.11 Choosing a Cipher Mode,"
Applied Cryptography, 2nd edition,
John Wiley & Sons, 1996
- sci.crypt FAQ, "Part 5: Product Ciphers,"
ftp://ftp.rtfm.mit.edu/pub/usenet/news.answers/cryptography-faq/part05
- National Bureau of Standards (now NIST),
"DES Modes of Operation,"
NBS FIPS PUB 81,
U.S. Department of Commerce, December 1980
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.5 $
- David Hopwood
- Raif S. Naffah
CFB() - Constructs a CFB mode object.
|
CFB(Cipher cipher) - Constructs a CFB cipher, assuming that the IV will be provided
via
setInitializationVector .
|
CFB(Cipher cipher, byte[] iv) - Constructs a CFB cipher, using an initialization vector
provided in the constructor.
|
blockSize , clone , crypt , crypt , crypt , doFinal , doFinal , doFinal , doFinal , engineBlockSize , engineCiphertextBlockSize , engineCrypt , engineGetParameter , engineInBufferSize , engineInitDecrypt , engineInitEncrypt , engineOutBufferSize , enginePlaintextBlockSize , engineSetPaddingScheme , engineSetParameter , engineUpdate , getAlgorithm , getAlgorithms , getAlgorithms , getCiphertextBlockSize , getInputBlockSize , getInstance , getInstance , getInstance , getMode , getOutputBlockSize , getPadding , getPaddingScheme , getParameter , getPlaintextBlockSize , getProvider , getState , inBufferSize , inBufferSizeFinal , initDecrypt , initEncrypt , isPaddingBlockCipher , outBufferSize , outBufferSizeFinal , setParameter , toString , update , update , update , update |
CFB
public CFB()
Constructs a CFB mode object.
The IV is provided via
setInitializationVector
. This IV
must be unique during the lifetime of the key.
If it is not
unique, at least the first block of the plaintext can be recovered.
CFB
public CFB(Cipher cipher)
Constructs a CFB cipher, assuming that the IV will be provided
via setInitializationVector
.
See the previous constructor for more details.
cipher
- the cipher object to use in CFB mode.
CFB
public CFB(Cipher cipher,
byte[] iv)
Constructs a CFB cipher, using an initialization vector
provided in the constructor.
cipher
- the block cipher to useiv
- the initial value for the shift register (IV)
engineInitDecrypt
protected void engineInitDecrypt(Key newkey)
throws KeyException
- engineInitDecrypt in interface Cipher
engineInitEncrypt
protected void engineInitEncrypt(Key newkey)
throws KeyException
- engineInitEncrypt in interface Cipher
engineUpdate
protected int engineUpdate(byte[] in,
int inOffset,
int inLen,
byte[] out,
int outOffset)
SPI: This is the main engine method for updating data.
It may be called with any size of input.
in
and
out
may be the same array, and the
input and output regions may overlap.
- engineUpdate in interface Cipher
in
- the input data.inOffset
- the offset into in
specifying where
the data starts.inLen
- the length of the subarray.out
- the output array.outOffset
- the offset indicating where to start writing into
the out
array.
- the number of bytes written.
next_block
protected void next_block()
Rotates the IV left by currentByte bytes, to mimic the V2.2
behaviour. This is needed in order to implement the variant of CFB
used by PGP.