# mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud architecture

> Architecture diagram of the GitHub repository mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud
- Repository: https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud

## Overview

CR-SHE is a prototype for privacy-preserving keyword search and homomorphic analytics over multi-cloud IoT data. An authorized user creates a keyword query; the system derives a pseudonymous index address, splits the point query into DPF keys, and combines provider results into matching record IDs. The user can then compute encrypted sums or weighted sums over matched fields. The README describes replicated provider storage and user-only decryption; the sampled implementation models search in memory and does not implement provider networking or a decryption workflow.

Main entry points: [`crshe.py`](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py) (Provider evaluation), [`dpf.py`](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/dpf.py) (Generate DPF keys)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_index["Indexing"]
  node_index_builder["Build index<br/>[crshe.py]"]
  node_address["PRF address<br/>[crshe.py]"]
  node_index_data[("Membership index<br/>[crshe.py]")]
end

subgraph group_search["Private Search"]
  node_query["Search query<br/>[crshe.py]"]
  node_dpf_gen["Generate DPF keys<br/>[dpf.py]"]
  node_provider_eval["Provider evaluation<br/>[crshe.py]"]
  node_dpf_eval["Evaluate DPF point<br/>[dpf.py]"]
  node_combine["Combine shares<br/>[crshe.py]"]
  node_matches["Matched record IDs<br/>[crshe.py]"]
end

subgraph group_compute["Encrypted Analytics"]
  node_field_encrypt["Encrypt fields<br/>[crshe.py]"]
  node_encrypted_fields[("Encrypted fields<br/>[crshe.py]")]
  node_aggregate["Homomorphic aggregate<br/>[crshe.py]"]
end

node_user(("Authorized user"))
node_providers(("Cloud providers"))
node_paillier["Paillier library"]

node_index_builder -->|"derives addresses"| node_address
node_index_builder -->|"writes index"| node_index_data
node_user -->|"requests search"| node_query
node_query -->|"derives address"| node_address
node_query -->|"generates keys"| node_dpf_gen
node_dpf_gen -->|"supplies keys"| node_provider_eval
node_index_data -->|"provides index"| node_provider_eval
node_provider_eval -->|"evaluates points"| node_dpf_eval
node_providers -.->|"holds replicas"| node_provider_eval
node_provider_eval -->|"returns shares"| node_combine
node_combine -->|"reconstructs matches"| node_matches
node_matches -->|"returns IDs"| node_user
node_user -->|"supplies fields"| node_field_encrypt
node_field_encrypt -->|"encrypts with"| node_paillier
node_field_encrypt -->|"stores ciphertexts"| node_encrypted_fields
node_user -->|"requests aggregate"| node_aggregate
node_encrypted_fields -->|"provides ciphertexts"| node_aggregate
node_aggregate -->|"uses operations"| node_paillier
node_aggregate -->|"returns ciphertext"| node_user

click node_index_builder "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_address "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_index_data "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_query "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_dpf_gen "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/dpf.py"
click node_provider_eval "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_dpf_eval "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/dpf.py"
click node_combine "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_matches "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_field_encrypt "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_encrypted_fields "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"
click node_aggregate "https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_index_builder,node_address,node_index_data,node_user toneBlue
class node_query,node_dpf_gen,node_provider_eval,node_dpf_eval,node_combine,node_matches toneAmber
class node_field_encrypt,node_encrypted_fields,node_aggregate toneMint
class node_providers,node_paillier toneIndigo
```

## Components

### Indexing

- [Build index](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [PRF address](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [Membership index](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`

### Private Search

- [Search query](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [Generate DPF keys](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/dpf.py): `dpf.py`
- [Provider evaluation](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [Evaluate DPF point](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/dpf.py): `dpf.py`
- [Combine shares](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [Matched record IDs](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`

### Encrypted Analytics

- [Encrypt fields](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [Encrypted fields](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`
- [Homomorphic aggregate](https://github.com/mazharulmd/collusion-resilient-searchable-homomorphic-encryption-multicloud/blob/main/crshe.py): `crshe.py`

### Other components

- **Authorized user**
- **Cloud providers**
- **Paillier library**

## Connections

- Build index → PRF address: derives addresses
- Build index → Membership index: writes index
- Authorized user → Search query: requests search
- Search query → PRF address: derives address
- Search query → Generate DPF keys: generates keys
- Generate DPF keys → Provider evaluation: supplies keys
- Membership index → Provider evaluation: provides index
- Provider evaluation → Evaluate DPF point: evaluates points
- Cloud providers → Provider evaluation: holds replicas
- Provider evaluation → Combine shares: returns shares
- Combine shares → Matched record IDs: reconstructs matches
- Matched record IDs → Authorized user: returns IDs
- Authorized user → Encrypt fields: supplies fields
- Encrypt fields → Paillier library: encrypts with
- Encrypt fields → Encrypted fields: stores ciphertexts
- Authorized user → Homomorphic aggregate: requests aggregate
- Encrypted fields → Homomorphic aggregate: provides ciphertexts
- Homomorphic aggregate → Paillier library: uses operations
- Homomorphic aggregate → Authorized user: returns ciphertext
