#rsa #encryption #security #aes #crypto

bin+lib cross-crypto-rs

Librería de criptografía en Rust compatible con Python y JavaScript

1 unstable release

new 0.1.0 Mar 20, 2025

#1799 in Cryptography

Apache-2.0

12KB
136 lines

cross-crypto-rs 🚀

Librería de criptografía en Rust compatible con Python y JavaScript.

📌 Instalación

Agrega la librería en Cargo.toml:

[dependencies]
cross-crypto-rs = "0.1"

🔹 Uso

use cross_crypto_rs::{generate_rsa_keys, encrypt_hybrid, decrypt_hybrid};

fn main() {
    let (private_key, public_key) = generate_rsa_keys();
    let mensaje = "Hola desde Rust";

    let encrypted = encrypt_hybrid(mensaje, &public_key);
    let decrypted = decrypt_hybrid(&encrypted, &private_key);

    println!("🔐 Mensaje desencriptado: {}", decrypted);
}

🔥 Características

✅ Interoperabilidad con Python (cross-crypto-py) y JavaScript (cross-crypto-ts). ✅ Cifrado híbrido con RSA + AES-GCM. ✅ Seguro y eficiente con openssl, aes-gcm y rand.

📝 Licencia

MIT

🔗 Enlaces a las librerias interoperables

Python: https://github.com/acadyne/cross-crypto-py JavaScript/TypeScript: https://github.com/acadyne/cross-crypto-ts Rust: https://github.com/acadyne/cross-crypto-rs

Dependencies

~4.5–6.5MB
~128K SLoC