Skip to main content

aes_encrypt

Function aes_encrypt 

Source
pub fn aes_encrypt(key: &str, data: &str) -> Result<String, Error>
Expand description

Encrypts data using AES-256-GCM-SIV with a static nonce.

§Arguments

  • key - The encryption key
  • data - The plaintext data to encrypt

§Returns

  • Ok(String) - Base64 encoded ciphertext
  • Err(Error) - If encryption fails