Skip to main content

des3_cbc_decrypt

Function des3_cbc_decrypt 

Source
pub fn des3_cbc_decrypt<'py>(
    py: Python<'py>,
    key: &[u8],
    iv: &[u8],
    ciphertext: &[u8],
    unpad: bool,
) -> PyResult<Bound<'py, PyBytes>>
Expand description

Decrypt data using 3DES-EDE-CBC.

key must be 16 bytes (two-key 3DES) or 24 bytes (three-key 3DES). iv must be 8 bytes.

When unpad=True (default) PKCS#7 padding is stripped automatically. When unpad=False raw decrypted bytes are returned.

import synta

pt = synta.des3_cbc_decrypt(key_24, iv_8, ciphertext)