Skip to content

Instantly share code, notes, and snippets.

View mesiriak's full-sized avatar
🏀
\\

Max mesiriak

🏀
\\
  • treeum
  • Lutsk, Ukraine
  • 00:02 (UTC +03:00)
  • X @mesirisk
View GitHub Profile
@mesiriak
mesiriak / rsa-mini.py
Last active August 15, 2021 16:43
so, i tried to do it. Hope in future it'll be easier to do cryptographic alghorithms
def GCD(a,b):
g = [max(a,b),min(a,b)]
mass = [[max(a,b),min(a,b)]]
while g[0] != 0 and g[1] != 0:
g[0], g[1] = g[1], g[0] % g[1]
mass.append([g[0],g[1]])
return mass, g[0]
def euclid_ext(a, b):
if b == 0:
import random
from math import pow
a = random.randint(2, 10)
def gcd(a, b):
if a < b:
return gcd(b, a)
elif a % b == 0:
return b;