encrypt_data_symmetric

Function encrypt_data_symmetric 

Source
pub fn encrypt_data_symmetric(
    precomputed_key: &PrecomputedKey,
    nonce: &Nonce,
    plain: &[u8],
) -> Vec<u8> 
Expand description

Returns encrypted data from plain, with length of plain + 16 due to padding.

Encryption is done using precomputed key (from the public key (32 bytes) of receiver and the secret key of sender) and a 24 byte nonce.

sodiumoxide takes care of padding the data, so the resulting encrypted data has length of plain + 16.

A wrapper for the seal_precomputed() function from sodiumoxide.