/n software Connectors for MuleSoft

Questions / Feedback?

PaddingMode Property

Used by the cipher to pad the last block of input text.

Data Type

Enumeration

Possible Values

None (1)
PKCS7 (2)
Zeros (3)
ANSIX923 (4)
ISO10126 (5)

Default Value

2

Remarks

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:

NoneNo padding will be performed.
PKCS7The data is padded with by a series of bytes that are each equal to the number of bytes used (eg: 03 03 03)
ZerosThe data is padded by several null bytes (eg: 00 00 00).
ANSIX923The data is padded by a sequence of null bytes followed by the number of bytes in the padding.
ISO10126The data is padded by a sequence of random bytes followed by the number of bytes in the padding.

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.

Copyright (c) 2022 /n software inc. - All rights reserved.
/n software Connectors for MuleSoft - Version 20.0 [Build 8165]