Crates.io | crypticy |
lib.rs | crypticy |
version | 0.2.2 |
source | src |
created_at | 2024-03-19 19:16:04.042624 |
updated_at | 2024-03-21 18:48:20.927527 |
description | A simple cryptography library in Rust |
homepage | |
repository | |
max_upload_size | |
id | 1179568 |
size | 3,832 |
This Rust crate provides functionalities for AES encryption using AES256 and SHA256 hashing.
Add this crate to your Cargo.toml
file:
[dependencies]
crypticy = "*"
Then, you can use the crate in your Rust code as follows:
extern crate aes_encryption;
use aes_encryption::{generate_aes_key, aes_encrypt, aes_decrypt, sha256_hash};
fn main() {
// Generate a random AES key
let key = generate_aes_key();
// Encrypt data using AES256
let plaintext = b"Your data here";
let ciphertext = aes_encrypt(plaintext, &key);
// Decrypt data using AES256
let decrypted = aes_decrypt(&ciphertext, &key).unwrap();
// Compute SHA256 hash
let data = b"Your data here";
let hash = sha256_hash(data);
}
This crate is licensed under the MIT License.