All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.provider.mode.PCBC
java.lang.Object
|
+----java.security.IJCE_Traceable
|
+----java.security.Cipher
|
+----java.security.Mode
|
+----cryptix.provider.mode.FeedbackMode
|
+----cryptix.provider.mode.PCBC
- public class PCBC
- extends FeedbackMode
Implements a block cipher in PCBC mode. The block size is the same as
that of the underlying cipher.
References:
- Bruce Schneier,
"Section 9.10 Other Block-Cipher Modes,"
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
Copyright © 1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.5 $
- Author:
- David Hopwood, Raif S. Naffah
-
PCBC()
- Constructs a PCBC cipher, assuming that the IV will be provided
via
setInitializationVector
.
-
PCBC(Cipher)
- Constructs a PCBC cipher, assuming that the IV will be provided
via
setInitializationVector
.
-
PCBC(Cipher, byte[])
- Constructs a PCBC cipher, using an initialization vector
provided in the constructor.
-
engineBlockSize()
- SPI: Returns the length of a block, in bytes.
-
engineInitDecrypt(Key)
- SPI: Initializes this cipher for decryption, using the
specified key.
-
engineInitEncrypt(Key)
- SPI: Initializes this cipher for encryption, using the
specified key.
-
engineSetCipher(Cipher)
- SPI: Sets the underlying cipher.
-
engineUpdate(byte[], int, int, byte[], int)
- SPI: This is the main engine method for updating data.
PCBC
public PCBC()
- Constructs a PCBC cipher, assuming that the IV will be provided
via
setInitializationVector
.
The IV value should be random, but unlike
CFB mode, it is not
absolutely required to be unique.
PCBC
public PCBC(Cipher cipher)
- Constructs a PCBC cipher, assuming that the IV will be provided
via
setInitializationVector
.
See the previous constructor for more details.
- Throws: NullPointerException
- if cipher == null
- Throws: IllegalBlockSizeException
- if cipher.getPlaintextBlockSize() !=
cipher.getCiphertextBlockSize()
PCBC
public PCBC(Cipher cipher,
byte iv[])
- Constructs a PCBC cipher, using an initialization vector
provided in the constructor.
The IV value 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.
- Parameters:
- cipher - the block cipher to use
- iv - the initial value for the shift register (IV)
- Throws: NullPointerException
- if cipher == null
engineSetCipher
protected void engineSetCipher(Cipher cipher)
- SPI: Sets the underlying cipher.
- Overrides:
- engineSetCipher in class FeedbackMode
engineBlockSize
protected int engineBlockSize()
- SPI: Returns the length of a block, in bytes.
- Overrides:
- engineBlockSize in class Cipher
engineInitEncrypt
protected void engineInitEncrypt(Key newkey) throws KeyException
- SPI: Initializes this cipher for encryption, using the
specified key.
- Overrides:
- engineInitEncrypt in class Cipher
engineInitDecrypt
protected void engineInitDecrypt(Key newkey) throws KeyException
- SPI: Initializes this cipher for decryption, using the
specified key.
- Overrides:
- engineInitDecrypt in class 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.
- Parameters:
- 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.
- Returns:
- the number of bytes written.
- Overrides:
- engineUpdate in class Cipher
All Packages Class Hierarchy This Package Previous Next Index