Message-Id: <2.2.32.19970607182719.008fe1f0@idssoftware.com>
Date: Sat, 07 Jun 1997 11:27:19 -0700
To: java-security@web2.javasoft.com
From: Michael Chen <michaelc@idssoftware.com>
Subject: JCE cipher blocksize
In the JCE Early Access documentation, the following description
appears many times in the Cipher class but seems unclear to me:
Throws: IllegalBlockSizeException
if the number of bytes in the array is not a multiple of the
block size, and the cipher is not a padding cipher in ENCRYPT
mode.
What exactly is "padding cipher"? If a cipher requires a fixed
block size, then padding is needed for arbitrary length input,
thus makes it a "padding cipher"? Then isn't every block cipher
a "padding cipher", and a stream cipher is a non-padding cipher?
The sentence after the comma does not make any sense to me. Why
only in ENCRYPT mode should it complain about illegal block size?
A different question is about the Cipher.outBlockSize(int iLen)
method. Can I assume that for stream ciphers or block ciphers
with iLen equal to a multiple of block size:
outBlockSize(iLen) == iLen
A different question is about the Cipher.outBlockSize(int iLen)
method. Can I assume that for stream ciphers or block ciphers
with iLen equal to a multiple of the block size:
outBlockSize(iLen) == iLen
If this is true, then this method is not very useful since all 3
crypt() methods do not allow accumulative (buffered) operations.
I can understand the usefulness of enginOutBlockSize() but not
this one.
All helps are appreciated.
--Michael