Ejemplo n.º 1
0
import hec

n = 42698584543886360061486842200382003313624169085301946559663494615494833625919
g = 913326067085406944159077752059680922182858227942518126068162286667180140466107648842572565613813229372396932441628644186755601564075513741425077638718840
l = 21349292271943180030743421100191001656603342573794468515864801413886865646400
u = 17288039927630418853048986923739837980030231648803406440389082766106280079017

hec.init (str(n), str(g))

v = hec.new()
print v

for i in range(123):
	v = hec.inc (v, 1)

for i in range(56):
	v = hec.inc (v, 0)

hec.quit()

count = hec.get (v, str(n), str(l), str(u))
print count

Ejemplo n.º 2
0
def inc_number(enc_number, amount):
    """
    Return the encryption of decryption(enc_number) + amount.
    """
    return hec.inc(str(enc_number), amount)