pub fn encrypt_file(
password: &str,
input: &Path,
output: Option<&Path>,
) -> Result<PathBuf>Expand description
Encrypts input into a .krf container.
password- the encryption password.input- file to encrypt.output- destination path; whenNonea random-looking hashed name ending in.krfis generated (the original filename never appears on disk unencrypted).
Returns the path of the written container. Output is produced atomically (temp file + rename) with owner-only permissions on Unix.
use std::path::Path;
let out = krypton::encrypt_file("correct horse", Path::new("document.pdf"), None).unwrap();