-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsa.py
1 lines (1 loc) · 802 Bytes
/
rsa.py
1
print((lambda a,r,m: m.get(a[1])(r, *a[2:]) if a[1] in m.keys() else "")(__import__("sys").argv, __import__("random").randint, {"code":(lambda r,g,k,m: pow(int(g),int(k),int(m))), "gen":(lambda r,b: (lambda d,e,l: d((l[0]-1)*(l[1]-1),e((lambda c,a,b: c(c,b,a%b) if a % b else True if b == 1 else False), l + [l[0]*l[1]])))((lambda m,l: l + [list(i if (l[-1]*i)%m != 1 else next(iter(())) for i in range(1,m))[-1] + 1]),(lambda c, l: l + [([16]+list(i if not c(c,i,l[2]) else next(iter(())) for i in range(17,(l[0]-1)*(l[1]-1))))[-1] + 1]),[(lambda r,p,b: ([r-1] + list(i if not p(i) else next(iter(())) for i in range(r, 2**b)))[-1]+1)(r(0, 2**(int(b)-1)),(lambda p: True if len(list(i if p % i else next(iter(())) for i in range(2,(p//2) + 1))) == (p//2)-1 else False),int(b)) for i in range(2)]))}))