Skip to content

Commit

Permalink
Create homomorphic.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 8, 2024
1 parent a4b61cf commit c6e60dd
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions projects/PiHE/crypto/homomorphic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Homomorphic encryption library wrapper for PiHE
import tfhe # or seal or helib

class HomomorphicEncryption:
def __init__(self, key_size, polynomial_degree):
self.key_size = key_size
self.polynomial_degree = polynomial_degree
self.he_lib = tfhe # or seal or helib

def generate_keys(self):
# Generate public and private keys for PiHE
pass

def encrypt(self, plaintext):
# Encrypt plaintext using public key for PiHE
pass

def decrypt(self, ciphertext):
# Decrypt ciphertext using private key for PiHE
pass

def evaluate(self, ciphertext, operation):
# Perform homomorphic operation on ciphertext for PiHE
pass

0 comments on commit c6e60dd

Please sign in to comment.