Function encrypt_data

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

Encrypts data using AES-GCM with a deterministic IV derived from the key

This function is compatible with the Go implementation’s encryptData function.

§Arguments

  • data - The data to encrypt (will be JSON serialized)
  • key - The encryption key

§Returns

Base64-encoded encrypted data