Skip to content

Instantly share code, notes, and snippets.

@avalonalex
avalonalex / RSA.py
Last active March 6, 2021 10:46
A implementation of RSA public key encryption algorithms in python, this implementation is for educational purpose, and is not intended for real world use. Hope any one want to do computation like (a^b mode n) effectively find it useful.
#!/usr/bin/env python
import argparse
import copy
import math
import pickle
import random
from itertools import combinations
@basavesh
basavesh / RSA.py
Created October 13, 2012 18:06 — forked from avalonalex/RSA.py
A implementation of RSA public key encryption algorithms in python
import random
import math
import copy
def euclid(a,b):
'''returns the Greatest Common Divisor of a and b'''
a = abs(a)
b = abs(b)