Crates.io | async_symm_crypto |
lib.rs | async_symm_crypto |
version | |
source | src |
created_at | 2025-01-08 15:16:39.216876 |
updated_at | 2025-01-08 21:16:48.584521 |
description | An async openssl symmetric cryptography. |
homepage | https://github.com/didoloan/async-symm-crypto.git |
repository | https://github.com/didoloan/async-symm-crypto.git |
max_upload_size | |
id | 1508676 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
A crate that wraps around openssl providing very convenient async interfaces to openssl's symmetric cryptography functions. It is:
Basic example of stream cryptography
Make sure openssl is installed on the operating
[dependencies]
async_symm_crypto = "0.1.1"
Then, on your main.rs:
use async_symm_crypto::AsyncEncryption;
use futures::StreamExt;
use std::ops::Deref;
use tokio;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let crypto = AsyncEncryption::new(
openssl::symm::Cipher::des_ede3_cbc(),
TEST_KEY,
Some(b"bcff0511"),
);
let mut enc_stream = crypto.encrypt_stream(get_text_byte_stream());
let mut enc_bytes = Vec::new();
while let Some(Ok(part)) = enc_stream.next().await {
enc_bytes.extend_from_slice(part.deref());
}
}
:balloon: Contributions are very welcome to improve the project.
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, shall be licensed as MIT, without any additional terms or conditions.
If you like my work, please let me know by recommending me for rust jobs.