# mohit-hasan/crypt-php architecture

> Architecture diagram of the GitHub repository mohit-hasan/crypt-php, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mohit-hasan/crypt-php
- Repository: https://github.com/mohit-hasan/crypt-php

## Overview

CryptPHP is a desktop PHP protection tool. The user selects project files and protection settings in the GUI, then starts a build that stages the project, applies optional YakPro obfuscation and Layer-2 encoding, merges seed files, and packages protected archives. The implementation excerpt shows build orchestration and seed merging; the README documents the major protection and packaging capabilities. Some stage-to-stage implementation details are unsampled, so those relationships are shown only where documented.

Main entry points: [`src/CryptPHP.cpp`](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp) (Build orchestrator), [`src/main.cpp`](https://github.com/mohit-hasan/crypt-php/blob/main/src/main.cpp) (Desktop GUI), [`src/ResourceManager.cpp`](https://github.com/mohit-hasan/crypt-php/blob/main/src/ResourceManager.cpp) (Embedded resources), [`src/CryptPHP.h`](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.h) (Build settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Desktop interface"]
  node_gui["Desktop GUI<br/>[main.cpp]"]
  node_selection["Project selection<br/>[main.cpp]"]
  node_settings["Build settings<br/>[CryptPHP.h]"]
end

subgraph group_protection["Protection workflow"]
  node_runner["Build orchestrator<br/>[CryptPHP.cpp]"]
  node_staging["Project staging<br/>[CryptPHP.cpp]"]
  node_yakpro["YakPro obfuscation<br/>[CryptPHP.cpp]"]
  node_layer2["Layer-2 encoding<br/>[CryptPHP.cpp]"]
  node_seed["Seed injection<br/>[CryptPHP.cpp]"]
end

subgraph group_outputs["Resources and outputs"]
  node_resources["Embedded resources"]
  node_resource_data["Embedded payload"]
  node_file_ops["File operations<br/>[FileUtil.cpp]"]
  node_archives["Protected ZIPs"]
end

node_user(("Project maintainer"))

node_user -->|"configures project"| node_gui
node_gui -->|"selects files"| node_selection
node_gui -->|"sets options"| node_settings
node_gui -->|"starts build"| node_runner
node_runner -->|"stages project"| node_staging
node_runner -->|"obfuscates files"| node_yakpro
node_runner -->|"encodes files"| node_layer2
node_runner -->|"merges seeds"| node_seed
node_runner -.->|"extracts resources"| node_resources
node_resources -->|"reads payload"| node_resource_data
node_runner -->|"uses file helpers"| node_file_ops
node_runner -->|"packages builds"| node_archives
node_user -->|"deploys output"| node_archives

click node_gui "https://github.com/mohit-hasan/crypt-php/blob/main/src/main.cpp"
click node_selection "https://github.com/mohit-hasan/crypt-php/blob/main/src/main.cpp"
click node_settings "https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.h"
click node_runner "https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp"
click node_staging "https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp"
click node_yakpro "https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp"
click node_layer2 "https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp"
click node_seed "https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp"
click node_resources "https://github.com/mohit-hasan/crypt-php/blob/main/src/ResourceManager.cpp"
click node_resource_data "https://github.com/mohit-hasan/crypt-php/blob/main/src/EmbeddedResources.h"
click node_file_ops "https://github.com/mohit-hasan/crypt-php/blob/main/src/FileUtil.cpp"

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_gui,node_selection,node_settings toneBlue
class node_runner,node_staging,node_yakpro,node_layer2,node_seed toneAmber
class node_resources,node_resource_data,node_file_ops,node_archives toneMint
class node_user toneIndigo
```

## Components

### Desktop interface

- [Desktop GUI](https://github.com/mohit-hasan/crypt-php/blob/main/src/main.cpp): `src/main.cpp`
- [Project selection](https://github.com/mohit-hasan/crypt-php/blob/main/src/main.cpp): `src/main.cpp`
- [Build settings](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.h): `src/CryptPHP.h`

### Protection workflow

- [Build orchestrator](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp): `src/CryptPHP.cpp`
- [Project staging](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp): `src/CryptPHP.cpp`
- [YakPro obfuscation](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp): `src/CryptPHP.cpp`
- [Layer-2 encoding](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp): `src/CryptPHP.cpp`
- [Seed injection](https://github.com/mohit-hasan/crypt-php/blob/main/src/CryptPHP.cpp): `src/CryptPHP.cpp`

### Resources and outputs

- [Embedded resources](https://github.com/mohit-hasan/crypt-php/blob/main/src/ResourceManager.cpp): `src/ResourceManager.cpp`
- [Embedded payload](https://github.com/mohit-hasan/crypt-php/blob/main/src/EmbeddedResources.h): `src/EmbeddedResources.h`
- [File operations](https://github.com/mohit-hasan/crypt-php/blob/main/src/FileUtil.cpp): `src/FileUtil.cpp`
- **Protected ZIPs**

### Other components

- **Project maintainer**

## Connections

- Project maintainer → Desktop GUI: configures project (evidence: `README.md`)
- Desktop GUI → Project selection: selects files (evidence: `README.md`)
- Desktop GUI → Build settings: sets options (evidence: `src/main.cpp`)
- Desktop GUI → Build orchestrator: starts build (evidence: `src/main.cpp`)
- Build orchestrator → Project staging: stages project (evidence: `src/CryptPHP.cpp`)
- Build orchestrator → YakPro obfuscation: obfuscates files (evidence: `README.md`)
- Build orchestrator → Layer-2 encoding: encodes files (evidence: `README.md`)
- Build orchestrator → Seed injection: merges seeds (evidence: `src/CryptPHP.cpp`)
- Build orchestrator → Embedded resources: extracts resources
- Embedded resources → Embedded payload: reads payload (evidence: `src/ResourceManager.cpp`)
- Build orchestrator → File operations: uses file helpers (evidence: `src/CryptPHP.cpp`)
- Build orchestrator → Protected ZIPs: packages builds (evidence: `README.md`)
- Project maintainer → Protected ZIPs: deploys output (evidence: `README.md`)
