Skip to content

Instantly share code, notes, and snippets.

@Peilonrayz
Peilonrayz / RSA.rs
Last active August 29, 2015 13:59
This is a very poorly written RSA alg in Rust. This has very few features, and cannot automate p, q or e on it's own. (Randomly)
extern crate rand;
use std::str;
use rand::{task_rng, Rng};
//A few nice Bool funcs.
struct Bool;
impl Bool{
fn not(b: bool) -> bool{if b{false}else{true}}
fn and(a: u64, b: u64) -> u64{a & b}
fn xor(a: u64, b: u64) -> u64{a ^ b}
fn or(a: u64, b: u64) -> u64{a | b}