W3C home > Mailing lists > Public > xml-encryption@w3.org > November 2001

Re: What padding do we use?

From: Donald E. Eastlake 3rd <dee3@torque.pothole.com>
Date: Fri, 02 Nov 2001 09:09:33 -0500
Message-Id: <200111021409.JAA0000086428@torque.pothole.com>
To: "Takeshi Imamura" <IMAMU@jp.ibm.com>
cc: "Donald E. Eastlake 3rd" <dee3@torque.pothole.com>, Christian Geuer-Pollmann <geuer-pollmann@nue.et-inf.uni-siegen.de>, XML Encryption WG <xml-encryption@w3.org>

True, this padding is not normative. But it is the only padding given
for "byte data". The other method suggested is for "bit data", where
the number of bits is not necessarily a multiple of 8, although it
would also work for bytes... Since all our stuff and most modern
cryptography is byte oriented and no one has objected, I plan to
document the style of padding I describe below.

It is more or less the same padding as in PKCS#5 which I think is
quite old and was in PEM (see RFC 1423). The only difference is that
most of these other descriptions unnecessarily require all the padding
bytes to have the same value as the final padding count byte.


From:  "Takeshi Imamura" <IMAMU@jp.ibm.com>
To:  "Donald E. Eastlake 3rd" <dee3@torque.pothole.com>
Cc:  Christian Geuer-Pollmann <geuer-pollmann@nue.et-inf.uni-siegen.de>,
            XML Encryption WG <xml-encryption@w3.org>
Message-ID:  <OF47AAE325.EF27ACBB-ON49256AF8.001EFDF9@LocalDomain>
Date:  Fri, 2 Nov 2001 14:59:06 +0900

>>FIPS-81, DES Modes of operations, in Appendix C on CBC with byte data
>>specified that it is to be padded by placing in the last byte of the
>>last cblock of input data the number of padding bytes (including this
>>count byte) and filling remaining pad bytes with anything.  I.E., if
>>there were 5 bytes of data in the last block, these would be left
>>justified, the bottom byte set to 0x03, and the two bytes between the
>>data and this "3" byte set to any pad characters. If the data exactly
>>fills the last block, an additional block is added with 0x08 in the
>>bottom byte and its remaining 7 bytes filled with any pad character.
>>Since this seems to be sort of part of the definition of CBC, would
>>there be any objection to explicitly specifying this for XML ENC?
>I studied FIPS-81 and found that the padding method you had pointed is
>given just as an example.  Moreover another padding method is given, which
>may lead to a misunderstanding.  So I believe that we should specify the
>padding method explicitly or use standard padding methods like the PKCS#5
>Takeshi IMAMURA
>Tokyo Research Laboratory
>IBM Research
Received on Friday, 2 November 2001 09:11:57 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:32:02 UTC