cipher.setAutoPadding()

cipher.setAutoPadding(auto_padding=true)

When using block encryption algorithms, the Cipher class will automatically add padding to the input data to the appropriate block size. To disable the default padding call cipher.setAutoPadding(false).

When auto_padding is false, the length of the entire input data must be a multiple of the cipher's block size or cipher.final() will throw an Error. Disabling automatic padding is useful for non-standard padding, for instance using 0x0 instead of PKCS padding.

The cipher.setAutoPadding() method must be called before cipher.final().

doc_Nodejs
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.