Wikipedia defines ANSI X.923 padding as follows:
In ANSI X.923 bytes filled with zeros are padded and the last byte defines the padding boundaries or the number of padded bytes.
Example: In the following example the block size is 8 bytes, and padding is required for 4 bytes (in hexadecimal format)
... | DD DD DD DD DD DD DD DD | DD DD DD DD 00 00 00 04 |
So far so good.
Java Bouncycastle provider supports X932Padding
, but it does it differently; instead of filling the unused bytes with zeros it fills them with random bytes.
I've got interested and started to search for ANSI X.923 official standard in internet and did not find it; instead I've found ANSI X9.23 description, and it says The standard defines that any other added bytes, or pad characters, be random.
So Bouncycastle implementation follows ANSI X9.23.
The question is : does the ANSI X.923 standard as it is defined in Wikipedia really exist?