Skip to main content

encrypt_string

Function encrypt_string 

Source
pub fn encrypt_string(
    plain_text: &str,
    secret_key: &str,
) -> Result<String, String>
Expand description

Encrypts a string using AES-256-CBC and returns the base64 encoded ciphertext.

§Arguments

  • plain_text - The plaintext string to encrypt.
  • secret_key - The secret key used for encryption (should be kept secret). “Secret key must be 32 characters long for AES-256”,