https://github.com/totalkrill/simplestcrypt
Symmetric encryption in rust with the single goal of being a drop in encryption before any kind of data transfer
https://github.com/totalkrill/simplestcrypt
Last synced: 4 months ago
JSON representation
Symmetric encryption in rust with the single goal of being a drop in encryption before any kind of data transfer
- Host: GitHub
- URL: https://github.com/totalkrill/simplestcrypt
- Owner: TotalKrill
- Created: 2020-11-18T16:10:34.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-21T13:59:51.000Z (almost 2 years ago)
- Last Synced: 2025-03-01T10:17:15.120Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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
``` rust
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));
}
```