pub fn pkcs7_pad<'py>(
py: Python<'py>,
data: &[u8],
block_size: usize,
) -> PyResult<Bound<'py, PyBytes>>Expand description
Apply PKCS#7 padding to data.
block_size is the cipher block size in bytes (16 for AES, 8 for 3DES).
Raises :exc:ValueError if block_size is 0 or greater than 255.
import synta
padded = synta.pkcs7_pad(b"hello", 8) # → b"hello\x03\x03\x03"