# rafeabd/path-oram architecture

> Architecture diagram of the GitHub repository rafeabd/path-oram, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rafeabd/path-oram
- Repository: https://github.com/rafeabd/path-oram

## Overview

- Client Module:
- Server Module:
- “Bucket/BucketHeap” where each bucket holds several data “Blocks”.
- That the server does not perform any decryption and only handles the data structures.
- ORAM Data Elements:
- “Block” component: Represent individual data units with attributes like a unique identifier, leaf position indicator, data content, and an indicator for dummy blocks.
- “Bucket”: A container for blocks that enforces fixed capacities and manages block organization especially dummy block handling.
- Encryption and Security:
- Secure random number generation as a part of the encryption process.

##### Architectural Patterns and Variants
- Client-Server Architecture by clearly separating the client-specific and server-specific responsibilities.
- The “Path ORAM disc” variant (in path_oram_disc)
- The “rORAM” extension (in rORAM_paper), highlighting enhancements like multiple tree management, batch evictions, and range query optimizations.
- Mention the experimental implementations in altORAMs, noting that they illustrate variations such as an in-memory (non-disc based) version or a “chunked eviction” method.

##### Technology and Infrastructure
- Make a note or an annotation that the implementation is in C++ (set as a core technology) using C++17 standards.
- Dependencies such as the OpenSSL library (for encryption) and CMake (for building the project).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Legend
    subgraph "Legend"
        L1["Client Module (core)"]
        L2["Server Module (core)"]
        L3["Encryption Module"]
        L4["Variant/Experimental"]
        L5["Technology/Infra"]
    end

    %% Client Module
    subgraph "Client Module" 
        C["Client"]:::client
        PM["Position Map"]:::client
        ST["Stash"]:::client
        ENC["AES-256-CBC Encryption<br/>(+ Secure RNG)"]:::encryption
        C -->|"manages"| PM
        C -->|"uses"| ST
        C -->|"secures"| ENC
        PM -->|"influences"| ST
    end

    %% Server Module
    subgraph "Server Module"
        S["Server"]:::server
        OT["ORAM Tree Structure"]:::server
        BKT["Bucket/BucketHeap"]:::server
        BLK["Block"]:::server
        S -->|"stores"| OT
        OT -->|"contains"| BKT
        BKT -->|"holds"| BLK
    end

    %% Communication between Client and Server
    C ---|"fetch/write operations (obfuscated)"| S
    S ---|"response"| C

    %% Variant Implementations
    subgraph "Variant Implementations"
        POR["Path ORAM disc variant"]:::variant
        rOR["rORAM extension"]:::variant
    end
    %% Dashed connections to indicate alternative implementations (experimental)
    C ---|"alternative client logic"| POR
    C ---|"alternative client logic"| rOR
    S ---|"alternative server logic"| POR
    S ---|"alternative server logic"| rOR

    %% Technology and Infrastructure Note
    Tech["C++17<br/>OpenSSL<br/>CMake<br/>Makefiles"]:::tech

    %% Position Tech note below variants
    POR --- Tech
    rOR --- Tech

    %% Click Events for Client Module
    click C "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/cpp/client.cpp"
    click C "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/include/client.h"
    click C "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/cpp/client.cpp"
    click C "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/include/client.h"
    click C "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/cpp/client.cpp"
    click C "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/include/client.h"

    %% Click Events for Server Module
    click S "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/cpp/server.cpp"
    click S "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/include/server.h"
    click S "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/cpp/server.cpp"
    click S "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/include/server.h"
    click S "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/cpp/server.cpp"
    click S "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/include/server.h"

    %% Click Events for Block Component
    click BLK "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/cpp/block.cpp"
    click BLK "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/include/block.h"
    click BLK "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/cpp/block.cpp"
    click BLK "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/include/block.h"
    click BLK "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/cpp/block.cpp"
    click BLK "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/include/block.h"

    %% Click Events for Bucket Component
    click BKT "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/cpp/bucket.cpp"
    click BKT "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/include/bucket.h"
    click BKT "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/cpp/bucket.cpp"
    click BKT "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/include/bucket.h"
    click BKT "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/cpp/bucket.cpp"
    click BKT "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/include/bucket.h"

    %% Click Events for Encryption Module
    click ENC "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/cpp/encryption.cpp"
    click ENC "https://github.com/rafeabd/path-oram/blob/main/altORAMs/path_oram/include/encryption.h"
    click ENC "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/cpp/encryption.cpp"
    click ENC "https://github.com/rafeabd/path-oram/blob/main/altORAMs/rORAM/include/encryption.h"
    click ENC "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/cpp/encryption.cpp"
    click ENC "https://github.com/rafeabd/path-oram/blob/main/rORAM_paper/include/encryption.h"

    %% Click Events for Variant Implementations
    click POR "https://github.com/rafeabd/path-oram/tree/main/path_oram_disc/cpp/"
    click rOR "https://github.com/rafeabd/path-oram/tree/main/rORAM_paper/cpp/"

    %% Styles
    classDef client fill:#A9DADC,stroke:#1B4F72,stroke-width:2px;
    classDef server fill:#F6D55C,stroke:#1B4F72,stroke-width:2px;
    classDef encryption fill:#92A8D1,stroke:#1B4F72,stroke-width:2px;
    classDef variant fill:#FFB347,stroke:#D11149,stroke-width:2px;
    classDef tech fill:#C9CBA3,stroke:#777,stroke-width:1px;
```
