wojteq18 / Cryptography

0 stars 0 forks source link

Fr Rust bro? #1

Closed pingponghero12 closed 2 days ago

pingponghero12 commented 4 days ago

Bro why rust bro? You for real with this shit?

pingponghero12 commented 4 days ago
mod RSA;
mod encryption;
mod unencryption;
fn main() 
{
    let (p, q, n, fi_n) = RSA::generate_rsa_values();
    println!("p: {}, q: {}, n: {}, fi_n: {}", p, q, n, fi_n);
    let (e) = RSA::generate_e(fi_n);
    println!("Wprowadź wiadomość, którą chcesz zaszyfrować: ");
    let mut massage = String::new();
    std::io::stdin().read_line(&mut massage).expect("Błąd wczytyania danych");
    let massage = massage.trim();
    let ascii = encryption::to_ascii(massage);
    let encryption = encryption::encrypt(massage, e, n);
    println!("Wiadomość w postaci ASCII: {:?}", ascii);
    println!("Zaszyfrowana wiadomość: {:?}", encryption);
    let mut d: u128 = unencryption::find_d(e, fi_n);
    let decryption = unencryption::decrypt(encryption, n, e, d);
    println!("Odszyfrowana wiadomość: {:?}", decryption);
}

Bro bro.

Still you got this bro bro, I belive in you! :muscle: :+1:

wojteq18 commented 2 days ago

Bro, it may look like shit, but at least it's not 2000 lines in one file bro. it's just a test

pingponghero12 commented 2 days ago

You got me here bro.