Skip to main content

encrypt_blob

Function encrypt_blob 

Source
pub fn encrypt_blob(
    zone_name: &str,
    zone_key: &ZoneKey,
    plaintext: &[u8],
) -> Vec<u8> 
Expand description

Encrypt content for a zone in the Git-filter blob format (JOY-014B-09):

JOYCRYPT || version (1) || zone-name-len (1) || zone-name || nonce (12) || ciphertext+tag.

The magic header is required so the filter (joy crypt-filter clean) can refuse to operate on plaintext that was already encrypted, and the textconv path can short-circuit on already-plaintext history objects.