Closed pingponghero12 closed 2 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:
Bro, it may look like shit, but at least it's not 2000 lines in one file bro. it's just a test
You got me here bro.
Bro why rust bro? You for real with this shit?