#encryption #symmetric-encryption #encryption-key #nonce #pre-shared #symmetric-key #aes-siv

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

6 releases

0.2.0 Jun 18, 2025
0.1.4 Aug 21, 2024
0.1.3 Mar 24, 2022
0.1.2 Nov 19, 2020

#673 in Cryptography

Download history 4/week @ 2025-06-25 21/week @ 2025-07-16 9/week @ 2025-07-23 8/week @ 2025-08-20 7/week @ 2025-09-03 4/week @ 2025-09-17 2/week @ 2025-09-24 165/week @ 2025-10-08

171 downloads per month

MIT license

8KB
79 lines

The only goal of this library is to provide the easiest way to encrypt and decrypt a message to a computer, its a very very minimal and provides no choices for the user to increase performance or security.

It is a minimal wrapper for the crate aes_siv and anyone wanting anything more advanced than what this library provides should look in that crate where ALL the heavy lifting is performed.

Encryption and decryption example:

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

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

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

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));
}

Dependencies

~2–2.9MB
~62K SLoC