pub fn encrypt_data(data: &[u8], key: &[u8]) -> Result<Vec<u8>, CloudError>Expand description
Encrypts data using AES-256-GCM.
The nonce is prepended to the ciphertext, so the output format is:
nonce (12 bytes) || ciphertext || tag (16 bytes)
§Arguments
data- The plaintext data to encryptkey- The 32-byte encryption key
§Returns
The encrypted data with prepended nonce, suitable for base64 encoding.