#security #encryption #data #seal #securely #package

crypto-seal

A small utility designed to securely "package" or seal serde-compatible data type that can passed around in an uncompromised manner

10 releases

0.3.0 Dec 27, 2023
0.2.6 Dec 6, 2022
0.2.4 Nov 30, 2022
0.2.3 Sep 4, 2022
0.1.0 Jun 27, 2022

#706 in Cryptography

Download history 31/week @ 2024-02-26 3/week @ 2024-03-11 145/week @ 2024-04-01

148 downloads per month

Apache-2.0 OR MIT

46KB
1K SLoC

crypto-seal

Overview

crypto-seal is a small utility designed to securely "package" or seal serde-compatible data type that can passed around in an uncompromised manner.

Usage

Note: ED25519 is used by default for encryption and signing. If AES256-GCM is used, signing will only supply an encrypted SHA512 hash using the key. This will be replaced in the future as this may not be a desirable option

use crypto_seal::{ToOpen, ToSeal, error::Error};

fn main() -> Result<(), Error> {

    let my_data = b"Hello, World!";

    let (my_key, sealed_data) = my_data.seal()?;

    let unsealed_data = sealed_data.open(&my_key)?;

    assert_eq!(b"Hello, World!", &unsealed_data);
    Ok(())
}

MSRV

The minimum supported rust version is 1.74, which can be changed in the future. There is no guarantee that this library will work on older versions of rust.

License

This crate is licensed under either Apache 2.0 or MIT.

Dependencies

~11MB
~159K SLoC