simplestcrypt

Crates.iosimplestcrypt
lib.rssimplestcrypt
version0.2.0
created_at2020-11-18 16:12:14.148815+00
updated_at2025-06-18 11:38:00.076498+00
descriptionSimplest way to perform a symmetric encryption, using a preshared key. Very small wrapper around aes-siv crate, with randomly generated nonces, for anything more advanced, use aes-siv instead
homepage
repositoryhttps://github.com/TotalKrill/simplestcrypt
max_upload_size
id313721
size17,714
(TotalKrill)

documentation

README

simplestcrypt

Simplest way to perform a symmetric encryption, using a preshared key. Very small wrapper around aes-siv crate, with randomly generated nonces, for anything more advanced, use aes-siv instead

Example

use std::str;
fn main() {
    let payload = "Hello world!".as_bytes();
    let password = b"hello wooooooooo";

    let encrypted = simplestcrypt::encrypt_and_serialize(&password[..], &payload).unwrap();
    let plain = simplestcrypt::deserialize_and_decrypt(&password[..], &encrypted).unwrap();

    println!("{:?}", str::from_utf8(&plain));
}
Commit count: 12

cargo fmt