Skip to content

Instantly share code, notes, and snippets.

View wildduck2's full-sized avatar

wildduck wildduck2

View GitHub Profile
@wildduck2
wildduck2 / rsa.rs
Created October 30, 2025 12:39
RSA DEMO EXPLAINATION
use std::collections::HashMap;
pub fn run_prime_test() {
// two prime numbers (small for demo only)
let p: i64 = 61;
let q: i64 = 53;
// modulus and totient
let n = p * q; // 3233
let phi = (p - 1) * (q - 1); // 3120