Updating Zencrypt Algorithms and Data Structures:
Updating Zencrypt Algorithms and Data Structures:
┌─────────────────────────────┐
│ START (v5) │
└─────────────────────────────┘
│
▼
┌─────────────────────────────────────────────┐
│1. USER CHOOSES ENCRYPTION/HASHING METHOD │
│ - "Encrypt Large File," "ECC Mode," │
│ "Argon2 Hash," etc. │
└─────────────────────────────────────────────┘
│
┌───────┴───────────────────────────────────────────┐
│2A. USE ECC / ARGON2? (ADV. ALGORITHMS) │
│ (If user selected ECC, Argon2, or other adv.) │
└───────────────────────────────────────────────────┘
│
┌──────────────────┴──────────────────┐
│ Yes (ECC / Argon2) │ No (Fallback: AES/SHA)
▼ ▼
┌──────────────────────────────────┐ ┌────────────────────────────────┐
│Initialize ECC or Argon2 logic │ │Initialize AES, SHA-256, etc. │
│ - ECC Keygen or Argon2 hashing │ │ (Existing cipher/hash logic) │
│ - Prepare any required params │ │ │
└──────────────────────────────────┘ └────────────────────────────────┘
│ │
└─────────── Both paths eventually converge ────────────┘
│
│
▼
┌────────────────────────────────────────────────────────────────┐
│3. CHECK IF CONCURRENCY IS ENABLED FOR LARGE FILE ENCRYPTION │
│ (Multithreading or Multiprocessing) │
└────────────────────────────────────────────────────────────────┘
│
┌─────────────┴─────────────────────┐
│Yes (Use concurrency / chunking) │
│ (Optimized path) │
└───────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│4A. SPLIT FILE INTO CHUNKS │
│ - Read file in fixed-size blocks (for example, using │
│ 2MB or 4MB for each file) │
│ - Store them in a work queue or list │
└─────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────────┐
│5A. LAUNCH THREAD POOL / MULTIPROCESS WORKERS │
│ For each chunk in queue: │
│ - Encrypt/Hash chunk with chosen algorithm (ECC, AES, │
│ Argon2, etc.) │
│ - Store partial results (ciphertext, checksums) │
└──────────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────────────────────┐
│6A. REASSEMBLE CHUNKS │
│ - Combine encrypted chunks or hashed results │
│ - If streaming approach, write partial chunks to output │
│ file as they finish │
└───────────────────────────────────────────────────────────┘
│
▼
┌───────────────────────────────────────────┐
│No (Single-threaded or small file) │
│ (Straight-line path) │
└───────────────────────────────────────────┘
│
│
│
▼
┌─────────────────────────────────────────────────────────┐
│4B/5B/6B. SINGLE-PASS ENCRYPT/HASH │
│ - If concurrency is off or file is small, process in │
│ one pass with standard logic (AES/ECC, etc.) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────┐
│7. RETURN/STORE FINAL OUTPUT │
│ - Write final ciphertext or hash to file/db, etc. │
│ - Provide success message or handle errors │
└─────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────┐
│ END │
└─────────────────────────┘Last updated
