First commit
This commit is contained in:
commit
43a72c3fb7
12 changed files with 213 additions and 0 deletions
16
tests.py
Normal file
16
tests.py
Normal file
|
@ -0,0 +1,16 @@
|
|||
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)
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue