{"id":19081049,"url":"https://github.com/rezafarazi/ppe","last_synced_at":"2026-02-19T08:36:27.652Z","repository":{"id":261748910,"uuid":"879362863","full_name":"rezafarazi/PPE","owner":"rezafarazi","description":"PPE (Parallel processing encryption) an encryption lib for cloud and IOT","archived":false,"fork":false,"pushed_at":"2025-03-26T08:39:53.000Z","size":18684,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T09:29:17.852Z","etag":null,"topics":["aes","cloud","esp32","iot","java","micropython"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rezafarazi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T17:51:55.000Z","updated_at":"2025-03-26T08:39:57.000Z","dependencies_parsed_at":"2025-03-26T09:35:20.200Z","dependency_job_id":null,"html_url":"https://github.com/rezafarazi/PPE","commit_stats":null,"previous_names":["rezafarazi/ppe"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezafarazi%2FPPE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezafarazi%2FPPE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezafarazi%2FPPE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rezafarazi%2FPPE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rezafarazi","download_url":"https://codeload.github.com/rezafarazi/PPE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248803751,"owners_count":21164106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes","cloud","esp32","iot","java","micropython"],"created_at":"2024-11-09T02:32:44.396Z","updated_at":"2026-02-19T08:36:27.647Z","avatar_url":"https://github.com/rezafarazi.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PPE — Parallel Processing Encryption\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Python Version](https://img.shields.io/badge/python-3.7%2B-blue)](https://www.python.org)\n[![Java Version](https://img.shields.io/badge/java-11%2B-red)](https://www.java.com)\n[![C++ Version](https://img.shields.io/badge/C%2B%2B-17-00599C)](https://en.cppreference.com)\n[![ESP32](https://img.shields.io/badge/ESP32-Compatible-green)](https://www.espressif.com)\n\nA high-performance, parallel processing encryption system that significantly outperforms traditional encryption methods. Based on comprehensive testing and benchmarking, PPE achieves a 9.5/10 efficiency score in thread utilization, compared to 2.2/10 for AES and 1.2/10 for RSA.\n\n## Table of Contents\n- [Key Performance Highlights](#key-performance-highlights)\n- [Highlights](#highlights)\n- [Repository Layout](#repository-layout-high-level)\n- [Algorithm Options](#algorithm-options)\n- [Performance Analysis](#comprehensive-performance-analysis)\n- [Quick Start](#quick-start)\n  - [Python](#python)\n  - [Java](#java-maven)\n  - [C/C++](#cc)\n  - [MicroPython](#micropython-esp32)\n- [Design Notes](#design-notes-for-embedded-targets)\n- [Benchmarks](#benchmarks--reproducibility)\n- [Contributing](#contributing)\n- [Security](#security-considerations)\n- [License](#license)\n- [Support](#support)\n\n## Key Performance Highlights\n- **4.3x Better** thread utilization than AES\n- **7.9x More Efficient** than RSA\n- **Optimized Memory Management** for both embedded and server environments\n- **Dynamic Thread Allocation** for maximum performance\n\n---\n\n## Highlights\n\n- Multi-language SDKs: Python, Java, C/C++, MicroPython\n- Parallel-friendly design: built to scale with modern CPUs and works within embedded constraints\n- Consistent API surface: same mental model across languages\n- Embedded-first mindset: low memory footprint options and ESP32-oriented practices\n\n---\n\n## Repository Layout (high level)\n\n```text\nPPE/\n├── src/\n│   ├── Back/\n│   │   ├── AllEncriptionAlgorithms/    # Java Implementation\n│   │   │   ├── All/\n│   │   │   │   ├── pom.xml\n│   │   │   │   ├── src/\n│   │   │   │   │   ├── main/          # Main implementation\n│   │   │   │   │   └── test/          # Unit tests\n│   │   │   └── README.md\n│   │   │\n│   │   ├── cpp/                        # C++ Implementation\n│   │   │   ├── Latest_PPE/\n│   │   │   │   ├── AES.cpp            # AES implementation\n│   │   │   │   ├── AES.h\n│   │   │   │   ├── main.cpp\n│   │   │   │   ├── SingleCore.cpp\n│   │   │   │   └── CMakeLists.txt\n│   │   │   └── PPE/\n│   │   │       └── PPE/               # Core PPE implementation\n│   │   │\n│   │   ├── JNI/                       # Java Native Interface\n│   │   │   ├── CPP/                   # C++ bindings\n│   │   │   │   ├── PPE.cpp\n│   │   │   │   ├── PPE.dll\n│   │   │   │   └── PPELib.h\n│   │   │   └── Java/                  # Java bindings\n│   │   │       └── JNITest/\n│   │   │\n│   │   └── Python/                    # Python Implementation\n│   │       └── PPE/\n│   │           └── PPE.py\n│   │\n│   ├── MicroPython/                   # ESP32 Implementation\n│   │   ├── main.py                    # Main ESP32 code\n│   │   ├── PPE_Arduino.ino           # Arduino specific code\n│   │   └── esp32_cam_mpy.bin         # ESP32 firmware\n│   │\n│   ├── PPETimeSyncer/                # Time Synchronization\n│   │   └── index.php                 # PHP endpoint\n│   │\n│   ├── Python/                       # Python SDK\n│   │   └── PPE/\n│   │       └── PPE.py               # Core Python implementation\n│   │\n│   └── PythonSimulate/              # Simulation \u0026 Testing\n│       ├── sim.py\n│       ├── simfa.py\n│       └── Simulate.py\n│\n├── docs/                            # Documentation\n│   └── images/                      # Performance charts \u0026 diagrams\n│\n├── tests/                          # Test suites\n│   ├── benchmark/                  # Performance tests\n│   └── unit/                      # Unit tests\n│\n├── LICENSE                        # MIT License\n└── README.md                     # Project documentation\n```\n\nNote: Some experimental scripts used during benchmarking may no longer be present, but the results (charts/tables) are preserved below.\n\n---\n\n## Algorithm Options\n\n- PPE (proposed, parallel-friendly)\n- AES-128/256\n- RSA-2048 (for key exchange and small payloads)\n\n## Comprehensive Performance Analysis\n\nOur extensive testing and benchmarking demonstrate PPE's superior performance across multiple metrics:\n\n### Thread Utilization Efficiency\n![Thread Utilization Comparison](./docs/images/1.png)\n*Thread utilization comparison showing PPE's 9.5/10 efficiency score compared to traditional methods*\n\nKey findings:\n- PPE (Dual-Thread): 9.5/10\n- AES (Single-Thread): 2.2/10\n- RSA (Single-Thread): 1.2/10\n\n### System Resource Utilization\n![System Resources](./2.png)\n*Efficient memory management and resource allocation patterns*\n\n### Processing Efficiency\n![Processing Efficiency](./3.png)\n*Superior processing speed and reduced encryption/decryption times*\n\n### Memory Management\n![Memory Usage](./4.png)\n*Optimized memory footprint across different operations*\n\n### Threading Performance\n![Thread Performance](./5.png)\n*Advanced thread management and parallel processing capabilities*\n\n### Encryption Speed\n![Encryption Speed](./6.png)\n*Fast encryption operations with parallel processing advantage*\n\n### Comparative Analysis\n![Performance Comparison](./7.png)\n*Head-to-head comparison showing PPE's advantages*\n\n### Overall Performance\n![Overall Performance](./8.png)\n*Comprehensive performance metrics across all parameters*\n\n### Key Metrics Summary (measured)\n\n| Algorithm | Key Gen (ms) | Encrypt (ms) | Memory (KB) | Power (mW) | Success |\n|----------:|--------------:|-------------:|------------:|-----------:|:-------:|\n| PPE       | 1.5           | 91.4         | 3.0         | 102.5      | 100%    |\n| AES-128   | 1.5           | 62.2         | 5.0         | 150.0      | 100%    |\n| RSA-2048  | 20.0          | 650.4        | 15.0        | 200.0      | 100%    |\n\nInterpretation:\n- AES is fastest for small/medium data; PPE is close while keeping memory low and embedded-friendly.\n- RSA remains best reserved for key exchange or very small, high-security payloads.\n\n---\n\n## Installation\n\n### Requirements\n- Python 3.7+\n- Java 11+ (for Java implementation)\n- C++17 compatible compiler (for C++ implementation)\n- ESP32 board (for embedded implementation)\n\n### Package Installation\n\n#### Python\n```bash\npip install ppe-crypto\n```\n\n#### Java\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.rezafta\u003c/groupId\u003e\n    \u003cartifactId\u003eppe\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### C++\n```bash\ngit clone https://github.com/rezafarazi/PPE.git\ncd PPE/src/Back/cpp/Latest_PPE\ncmake .\nmake\n```\n\n## Quick Start\n\n### Python\n\nAssuming the Python SDK lives under `src/Python/PPE/PPE.py`.\n\n```python\n# Basic usage (example)\nfrom PPE import PPE as ppe_encrypt\nfrom PPE import PPD as ppe_decrypt\n\nplaintext = \"hello\"\nsalt = \"reza\"\n\nciphertext = ppe_encrypt(plaintext, salt)\nprint(\"Encrypted:\", ciphertext)\n\nrestored = ppe_decrypt(ciphertext, salt)\nprint(\"Decrypted:\", restored)\n```\n\nTips:\n- For pure-Python usage you typically don’t need external deps. If you plan to visualize or benchmark, install: `pip install numpy matplotlib`.\n\n### Java (Maven)\n\nA minimal example (adapt to your package names):\n\n```java\npackage com.rezafta;\n\nimport com.rezafta.PPE.PPE;\nimport com.rezafta.PPE.Types.EncriptionTypes;\n\npublic class App {\n    public static void main(String[] args) throws Exception {\n        PPE p = new PPE();\n        String enc = p.GetEncription(\"salam\", \"reza\", EncriptionTypes.AES);\n        System.out.println(\"Encrypted: \" + enc);\n\n        String dec = p.GetDecription(enc, \"reza\", EncriptionTypes.AES);\n        System.out.println(\"Decrypted: \" + dec);\n    }\n}\n```\n\nBuild/run:\n\n```bash\n# from the Java module folder containing pom.xml\nmvn -q -DskipTests package\njava -jar target/\u003cyour-app\u003e.jar\n```\n\n### C/C++\n\nThere are ready-made examples and CMake projects under `src/Back/cpp`. Open in your preferred IDE (CLion/VS), or build with CMake/Ninja on your platform. AES examples are included; integrate PPE as needed.\n\n### MicroPython (ESP32)\n\nUnder `src/MicroPython(vittascience)` you will find ESP32 examples. Typical workflow:\n- Flash MicroPython firmware for your board\n- Copy `.py` example to the device (Thonny/ampy/mpremote)\n- Use chunked processing for larger payloads\n\n---\n\n## Design Notes for Embedded Targets\n\n- Use chunk sizes ≤ 4 KB to respect RAM fragmentation on ESP32.\n- Prefer PPE or AES for data-plane encryption; use RSA only for small control-plane exchanges (e.g., key transport).\n- Keep total working-set under ~200 KB when possible.\n\n---\n\n## Benchmarks \u0026 Reproducibility\n\n- The charts included above (`third_comparison_charts.png`, `third_comparison_table.png`) were generated from independent runs that emulate ESP32 constraints (CPU frequency, heap limits, single-core behavior, chunked I/O).\n- If you want to regenerate visuals, create your own benchmark harness and save figures alongside the README.\n\n---\n\n## Contributing\n\n1. Fork the repo\n2. Create a feature branch: `git checkout -b feature/amazing`\n3. Commit with context: `git commit -m \"feat: add \u003cwhat\u003e\"`\n4. Push and open a PR\n\nCoding guidelines:\n- Favor clarity and explicit naming\n- Keep embedded constraints in mind (memory and timing)\n- Provide unit or smoke tests where practical\n\n---\n\n## Security Considerations\n\n- Generate keys via cryptographically secure RNGs\n- Validate inputs (lengths, encodings)\n- Never log raw secrets\n- Prefer authenticated modes (e.g., AES-GCM) when applicable\n\n---\n\n## License\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThis project is licensed under the MIT License. This means you can:\n- ✅ Use the software commercially\n- ✅ Modify the software\n- ✅ Distribute the software\n- ✅ Use and modify the software privately\n- ✅ No warranty is provided\n\nSee the [LICENSE](LICENSE) file for the full license text.\n\n---\n\n## Support\n\n- Issues: GitHub Issues\n- Discussions: GitHub Discussions\n- Examples: see language folders under `src/`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezafarazi%2Fppe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frezafarazi%2Fppe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frezafarazi%2Fppe/lists"}