Skip to content

Commit

Permalink
Create main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 8, 2024
1 parent 89fbed5 commit b5adab7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions projects/PiHE/clients/demo/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from crypto.key_manager import KeyManager
from models.model import Model
from clients.client import Client

def main():
key_manager = KeyManager(key_size=2048, ciphertext_size=2048)
key_manager.generate_keys()

model = Model(HomomorphicEncryption(key_manager.get_public_key(), key_manager.get_private_key()))

client = Client(key_manager, model)

# Generate some sample data
data = [1, 2, 3, 4, 5]

# Perform homomorphic encryption-based machine learning
results = client.perform_homomorphic_ml(data)

print("Results:", results)

if __name__ == "__main__":
main()

0 comments on commit b5adab7

Please sign in to comment.