async_symm_crypto

Crates.ioasync_symm_crypto
lib.rsasync_symm_crypto
version
sourcesrc
created_at2025-01-08 15:16:39.216876
updated_at2025-01-08 21:16:48.584521
descriptionAn async openssl symmetric cryptography.
homepagehttps://github.com/didoloan/async-symm-crypto.git
repositoryhttps://github.com/didoloan/async-symm-crypto.git
max_upload_size
id1508676
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`
size0
(didoloan)

documentation

README

Async-Symm-Crypto

A crate that wraps around openssl providing very convenient async interfaces to openssl's symmetric cryptography functions. It is:

Crates.io Crates.io Docs Build MIT licensed

Website | API Docs

Example

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

Contributing

:balloon: Contributions are very welcome to improve the project.

License

This project is licensed under the MIT license.

Contribution

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.

I'm looking to get hired

If you like my work, please let me know by recommending me for rust jobs.

Commit count: 6

cargo fmt