16 lines
344 B
Python
16 lines
344 B
Python
import lib.rsa as rsa
|
|
import lib.arithmetics as arithm
|
|
import lib.miller_rabin as miller
|
|
|
|
for i in range(100):
|
|
for j in range(100):
|
|
assert arithm.modpow(i, j, 20) == pow(i, j, 20)
|
|
|
|
for i in range(3, 100):
|
|
if miller.is_prime(i): print(i)
|
|
|
|
e, d, n = rsa.get_keys(2048)
|
|
c = rsa.encrypt(22, e, n)
|
|
m = rsa.decrypt(c, d, n)
|
|
print(m)
|
|
|