cipher.setAutoPadding([autoPadding])
autoPadding<boolean> 默认:true- 返回:Cipheriv 用于方法链的相同
Cipheriv实例。
在使用使用标准块填充的块加密时,Cipheriv 类会自动将输入数据填充到适当的块大小。要禁用默认填充,请调用 cipher.setAutoPadding(false)。
🌐 When using block ciphers that use standard block padding, the Cipheriv class
will automatically add padding to the input data to the appropriate block size.
To disable the default padding call cipher.setAutoPadding(false).
对于使用标准块填充的块密码,当 autoPadding 是 false 时,整个输入数据的长度必须是密码块大小的倍数,否则 cipher.final() 会报错。禁用自动填充对非标准填充很有用,比如使用 0x0 代替 PKCS 填充。
🌐 For block ciphers that use standard block padding, when autoPadding 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.
cipher.setAutoPadding() 方法必须在 cipher.final() 之前调用。
🌐 The cipher.setAutoPadding() method must be called before
cipher.final().