PaddingMode Property
Used by the cipher to pad the last block of input text.
Data Type
EnumerationPossible Values
None (1)PKCS7 (2)
Zeros (3)
Default Value
2Remarks
PaddingMode is used by the cipher to pad the final input block to guarantee that it is the correct size required for the cipher's input. Each mode pads the data differently:
None | No padding will be performed. |
PKCS7 | The data is padded with by a series of bytes that are each equal to the number of bytes used (eg: 03 03 03) |
Zeros | The data is padded by several null bytes (eg: 00 00 00). |
Note: unless the length of input is an exact multiple of the cipher's input block size (16 bytes for AES), the final block of plaintext may be lost if None is used. In order to avoid this, the default PaddingMode is PKCS7.