mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-07 17:25:03 -04:00
Reorganized
This commit is contained in:
parent
ab54dc8e70
commit
2afd831662
281 changed files with 253 additions and 33 deletions
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from paillier import *
|
||||
|
||||
print "Generating keypair..."
|
||||
priv, pub = generate_keypair(512)
|
||||
|
||||
x = 3
|
||||
print "x =", x
|
||||
print "Encrypting x..."
|
||||
cx = encrypt(pub, x)
|
||||
print "cx =", cx
|
||||
|
||||
y = 5
|
||||
print "y =", y
|
||||
print "Encrypting y..."
|
||||
cy = encrypt(pub, y)
|
||||
print "cy =", cy
|
||||
|
||||
print "Computing cx + cy..."
|
||||
cz = e_add(pub, cx, cy)
|
||||
print "cz =", cz
|
||||
|
||||
print "Decrypting cz..."
|
||||
z = decrypt(priv, pub, cz)
|
||||
print "z =", z
|
||||
|
||||
print "Computing decrypt((cz + 2) * 3) ..."
|
||||
print "result =", decrypt(priv, pub,
|
||||
e_mul_const(pub, e_add_const(pub, cz, 2), 3))
|
Loading…
Add table
Add a link
Reference in a new issue