How hac1es/nt219-project works
Project type and purpose
• This is a distributed, peer-to-peer (P2P) plus server system for credit scoring using homomorphic encryption and threshold decryption.
• Banks act as clients to generate keys, encrypt customer data, and perform partial decryption. A central server (FinanceOrg HEServer) evaluates encrypted scores and aggregates partial decryptions. A Certificate Authority (CA) issues and signs keys.
File structure
• Top-level directories:
• Banks/…: code each bank runs
• CA/…: certificate authority server and keys
• FinanceOrg/…: central aggregator (HEServer) and its certificates
• Testing/…: proof-of-concept and benchmarks
• install.sh, requirements.txt: deployment scripts and dependencies
• Within Banks/:
• Certificate: CSR and signed CA root certificates
• DBService: customer data lookup service
• HEModule: UI and scripts for key gen, joint key, eval-mult keys, encryption, decryption
• InterbankService: REST API and client for inter-bank communication and forwarding encrypted data to FinanceOrg
• Configuration and build: runAPI.sh, server.py, runServer.sh
README for architecture hints
• Describes sequential processes: key generation → joint public key → eval-mult key contributions → data encryption → server evaluation → threshold decryption
• Emphasizes P2P model among banks plus server aggregation
Main components
a. Certificate Authority (CA service)
• server.py, runServer.sh
• Issues and signs keys (RootCA, sbv.org)
b. Bank Clients (multiple instances)
• Certificate module (requestCert.py)
• HEModule UI (MainWindow.ui + keyGenerator, calculateJointKey, evalMultKey1, evalMultKey2, interactiveEncrypt, multipartyDecrypt)
• DBService (getCustomerInfo.py)
• InterbankService (interbankAPI.py, interbankClient.py, runAPI.sh, sendToFECredit.py)
c. Finance Organization Aggregator
• HEServer.py (receives ciphertexts, performs homomorphic evaluation, returns encrypted score)
• Certificate folder for trust anchors
d. Testing/Benchmarking (PoC.py, PoC_benchmark.py, results)
e. Shared artifacts/repos
• Joint public key files, eval-mult keys, encrypted data blobs, signature files
Relationships and data flows
• Banks request and obtain certificates from CA.
• Each bank generates its own HE key pair via keyGenerator.
• Banks sequentially construct a joint public key (calculateJointKey).
• Banks contribute to eval-mult key in two phases (evalMultKey1, evalMultKey2).
• Banks encrypt customer data via interactiveEncrypt/SerializeData and sign ciphertexts.
• Banks push ciphertexts through their InterbankService to the FinanceOrg HEServer.
• HEServer performs homomorphic computations and returns encrypted results.
• Each bank executes partial decryptions via multipartyDecrypt/decryptEncryptedText and finally the aggregator reconstructs the plaintext score.
Architectural patterns and design principles
• P2P key-exchange and threshold cryptography
• Micro-services per bank: separate modules for certificate, encryption, interbank communication, database access
• Central evaluation service (FinanceOrg)
• REST API pattern for interbank/federated communication
• UI layer (Qt .ui file) separate from CLI scripts
• Secure channels and signing for data integrity