
PYthon For Homomorphic Encryption Libraries, Pyfhel implements functionalities of multiple Homomorphic Encryption libraries such as addition, multiplication, exponentiation or scalar product in Python. Pyfhel uses a syntax similar to normal arithmetics (+,-,*). This library is useful both for simple Homomorphic Encryption Demos as well as for complex problems such as Machine Learning algorithms.
Pyfhel is built on top of Afhel, an Abstraction For Hmomorphic Encryption Libraries in C++. Afhel serves as common API for all backends.
Version: 3.4.1.
Status: STABLE.
Language: Python (3.5+) & Cython on top of C++17.
OS: Windows (tested with
MSVC2017
,MSVC2019
) and Linux / WSL (tested ongcc6
,gcc8
). MacOS not supported.
Dependencies: There are two possible backends (both shipped alongside Pyfhel), HE libraries in C++:
Note
The current version supports SEAL only
Index¶
- Getting started
- Tutorials
- API reference
- Pyfhel
Pyfhel
Pyfhel.__init__()
Pyfhel.context_params
Pyfhel.key_gen
Pyfhel.pub_key_file
Pyfhel.sec_key_file
Pyfhel.__repr__()
Pyfhel.add()
Pyfhel.add_plain()
Pyfhel.align_mod_n_scale()
Pyfhel.batchEnabled()
Pyfhel.contextGen()
Pyfhel.cumul_add()
Pyfhel.decode()
Pyfhel.decodeABGV()
Pyfhel.decodeAComplex()
Pyfhel.decodeAFrac()
Pyfhel.decodeAInt()
Pyfhel.decodeBGV()
Pyfhel.decodeComplex()
Pyfhel.decodeFrac()
Pyfhel.decodeInt()
Pyfhel.decrypt()
Pyfhel.decryptABGV()
Pyfhel.decryptAComplex()
Pyfhel.decryptAFrac()
Pyfhel.decryptAInt()
Pyfhel.decryptAPtxt()
Pyfhel.decryptBGV()
Pyfhel.decryptComplex()
Pyfhel.decryptFrac()
Pyfhel.decryptInt()
Pyfhel.decryptPtxt()
Pyfhel.empty_poly()
Pyfhel.encode()
Pyfhel.encodeABGV()
Pyfhel.encodeAComplex()
Pyfhel.encodeAFrac()
Pyfhel.encodeAInt()
Pyfhel.encodeBGV()
Pyfhel.encodeComplex()
Pyfhel.encodeFrac()
Pyfhel.encodeInt()
Pyfhel.encrypt()
Pyfhel.encryptABGV()
Pyfhel.encryptAComplex()
Pyfhel.encryptAFrac()
Pyfhel.encryptAInt()
Pyfhel.encryptAPtxt()
Pyfhel.encryptBGV()
Pyfhel.encryptComplex()
Pyfhel.encryptFrac()
Pyfhel.encryptInt()
Pyfhel.encryptPtxt()
Pyfhel.flip()
Pyfhel.from_bytes_context()
Pyfhel.from_bytes_public_key()
Pyfhel.from_bytes_relin_key()
Pyfhel.from_bytes_rotate_key()
Pyfhel.from_bytes_secret_key()
Pyfhel.get_nSlots()
Pyfhel.get_plain_modulus()
Pyfhel.get_poly_modulus_degree()
Pyfhel.get_qi()
Pyfhel.get_scheme()
Pyfhel.is_context_empty()
Pyfhel.is_public_key_empty()
Pyfhel.is_relin_key_empty()
Pyfhel.is_rotate_key_empty()
Pyfhel.is_secret_key_empty()
Pyfhel.keyGen()
Pyfhel.load_context()
Pyfhel.load_public_key()
Pyfhel.load_relin_key()
Pyfhel.load_rotate_key()
Pyfhel.load_secret_key()
Pyfhel.maxBitCount()
Pyfhel.mod_switch_to_next()
Pyfhel.mod_switch_to_next_ctxt()
Pyfhel.mod_switch_to_next_ptxt()
Pyfhel.multDepth()
Pyfhel.multiply()
Pyfhel.multiply_plain()
Pyfhel.negate()
Pyfhel.noise_level()
Pyfhel.poly_add()
Pyfhel.poly_from_ciphertext()
Pyfhel.poly_from_coeff_vector()
Pyfhel.poly_from_plaintext()
Pyfhel.poly_invert()
Pyfhel.poly_multiply()
Pyfhel.poly_subtract()
Pyfhel.poly_to_ciphertext()
Pyfhel.poly_to_plaintext()
Pyfhel.polys_from_ciphertext()
Pyfhel.power()
Pyfhel.relinKeyGen()
Pyfhel.relinearize()
Pyfhel.rescale_to_next()
Pyfhel.rotate()
Pyfhel.rotateKeyGen()
Pyfhel.save_context()
Pyfhel.save_public_key()
Pyfhel.save_relin_key()
Pyfhel.save_rotate_key()
Pyfhel.save_secret_key()
Pyfhel.scalar_prod()
Pyfhel.scalar_prod_plain()
Pyfhel.sizeof_context()
Pyfhel.sizeof_public_key()
Pyfhel.sizeof_relin_key()
Pyfhel.sizeof_rotate_key()
Pyfhel.sizeof_secret_key()
Pyfhel.square()
Pyfhel.sub()
Pyfhel.sub_plain()
Pyfhel.to_bytes_context()
Pyfhel.to_bytes_public_key()
Pyfhel.to_bytes_relin_key()
Pyfhel.to_bytes_rotate_key()
Pyfhel.to_bytes_secret_key()
Pyfhel.n
Pyfhel.qi
Pyfhel.qi_sizes
Pyfhel.scale
Pyfhel.scheme
Pyfhel.sec
Pyfhel.t
Pyfhel.total_coeff_modulus_bit_count
- PyCtxt
PyCtxt
PyCtxt.__init__()
PyCtxt.copy_ctxt
PyCtxt.pyfhel
PyCtxt.fileName
PyCtxt.bytestring
PyCtxt.scheme
PyCtxt.__add__()
PyCtxt.__bytes__()
PyCtxt.__invert__()
PyCtxt.__mul__()
PyCtxt.__neg__()
PyCtxt.__pow__()
PyCtxt.__repr__()
PyCtxt.__rshift__()
PyCtxt.__sub__()
PyCtxt.copy()
PyCtxt.decrypt()
PyCtxt.encode_operand()
PyCtxt.encrypt()
PyCtxt.from_bytes()
PyCtxt.get_multiplicative_inverse()
PyCtxt.load()
PyCtxt.round_scale()
PyCtxt.save()
PyCtxt.set_scale()
PyCtxt.size()
PyCtxt.sizeof_ciphertext()
PyCtxt.to_bytes()
PyCtxt._pyfhel
PyCtxt.capacity
PyCtxt.mod_level
PyCtxt.noiseBudget
PyCtxt.scale
PyCtxt.scale_bits
PyCtxt.scheme
- PyPtxt
PyPtxt
PyPtxt.other_ptxt
PyPtxt.__init__()
PyPtxt.copy_ctxt
PyPtxt.pyfhel
PyPtxt.fileName
PyPtxt.scheme
PyPtxt.__repr__()
PyPtxt.decode()
PyPtxt.encode()
PyPtxt.from_bytes()
PyPtxt.is_ntt_form()
PyPtxt.is_zero()
PyPtxt.load()
PyPtxt.save()
PyPtxt.set_scale()
PyPtxt.to_bytes()
PyPtxt.to_poly_string()
PyPtxt._pyfhel
PyPtxt.mod_level
PyPtxt.scale
PyPtxt.scale_bits
PyPtxt.scheme
- PyPoly
PyPoly
PyPoly.other_ptxt
PyPoly.__init__()
PyPoly.other
PyPoly.ref
PyPoly.size_t
PyPoly.ptxt
PyPoly.__add__()
PyPoly.__invert__()
PyPoly.__mul__()
PyPoly.__repr__()
PyPoly.__sub__()
PyPoly.check_afpoly()
PyPoly.from_bytes()
PyPoly.from_coeff_list()
PyPoly.get_coeff()
PyPoly.load()
PyPoly.save()
PyPoly.set_coeff()
PyPoly.to_bytes()
PyPoly.to_coeff_list()
PyPoly._pyfhel
PyPoly._scheme
- Scheme_t
- Backend_t
- Pyfhel
- API serialized