RSA encryption: c = m^e mod n
(pub_key: &PublicKey, message: u64)
| 63 | |
| 64 | // RSA encryption: c = m^e mod n |
| 65 | fn encrypt(pub_key: &PublicKey, message: u64) -> u64 { |
| 66 | mod_exp(message, pub_key.e, pub_key.n) |
| 67 | } |
| 68 | |
| 69 | // RSA decryption: m = c^d mod n |
| 70 | fn decrypt(priv_key: &PrivateKey, ciphertext: u64) -> u64 { |