In [13]:
a=bin(9)[2:]

In [1]:
from Pyfhel import Pyfhel, PyPtxt, PyCtxt

In [2]:
HE = Pyfhel()           # Creating empty Pyfhel object
HE.contextGen(p=65537, m=1024, flagBatching=True)  # Generating context. The value of p is important.
                        #  There are many configurable parameters on this step
                        #  More info in Demo_Context.py, and in the docs of
                        #  the function (link to docs in README).
HE.keyGen()             # Key Generation.

In [23]:
integer1 = 127
integer2 = -2
ctxt1 = HE.encryptInt(integer1) # Encryption makes use of the public key
ctxt2 = HE.encryptInt(integer2) # For integers, encryptInt function is used.

In [3]:
import numpy as np

In [5]:
ctxt = HE.encryptArray(np.array([1,2,3]))

In [6]:
str(ctxt)


Out[6]:
'<Pyfhel Ciphertext, encoding=BATCH, size=2>'