Skip to main content

encrypt_aes_256_cbc

Function encrypt_aes_256_cbc 

Source
pub fn encrypt_aes_256_cbc(
    key: &[u8; 32],
    iv: &[u8; 16],
    data: &[u8],
) -> Vec<u8> ⓘ
Expand description

Encrypt data using CBC-AES-256

§Arguments

  • key - 32-byte encryption key
  • iv - 16-byte initialization vector (must be randomly generated and unique)
  • data - Data to encrypt

§Returns

Encrypted data with PKCS7 padding