How emanorabi254/rsa works
Project Type and Purpose
• This is an embedded‐systems/cryptography demonstration project targeting an 8051‐class microcontroller, simulated in Proteus.
• Purpose: implement RSA encryption/decryption (optimized with CRT) and exchange ciphertext over a UART link.
File Structure
• Top level:
• Proteus/ (simulation project file: RSA.pdsprj)
• README.md (project description)
• code/ (all C source and headers plus Keil/UVision project files)
• In code/:
• main.c (application entry point: orchestrates key generation, encryption, decryption, UART I/O)
• rsa.h (RSA routines: keygen, encrypt, CRT‐based decrypt)
• uart.h (UART initialization and transmit/receive APIs)
• project.uvproj / uvopt / uvgui.Original (Keil project configs)
Extract Architecture Insights from README
• Four logical stages:
1. Key Generation
2. Encryption
3. UART Communication
4. Decryption (CRT‐optimized)
• Hardware constraints: 8051 limited RAM/compute, requiring custom big‐integer handling and CRT optimization.
• Simulation environment: Proteus ties together virtual 8051, UART terminal, and possible external peripherals.
Main Components and Their Relationships
a. Hardware Layer
• 8051 MCU (CPU + on‐chip RAM/ROM)
• UART transceiver (pins TX/RX)
• Proteus virtual terminal or external UART device
b. Software Layer (on the MCU)
• Application (main.c)
• Crypto Module (rsa.h + implementation)
– KeyGen subcomponent
– Encrypt subcomponent
– CRT‐Decrypt subcomponent
• UART Module (uart.h + implementation)
– Init UART
– Send/Receive routines
c. Simulation Environment
• Proteus simulator orchestrating clock, wires, and virtual terminal
d. Data Flows & Interactions
1. At startup, Application invokes Crypto.KeyGen → generates public/private keys.
2. Application takes plaintext → Crypto.Encrypt → ciphertext.
3. UART.Tx → sends ciphertext over serial link.
4. UART.Rx → receives ciphertext (could loop back in Proteus).
5. Crypto.CRT_Decrypt → recovers plaintext.
6. Application outputs decrypted text to terminal/display.
Architectural Patterns and Design Principles
• Layered Separation: hardware abstraction (UART module), crypto logic (RSA module), application logic (main).
• Modularity: each header/source pair encapsulates one concern.
• Optimization: CRT is a performance optimization sub‐layer within the crypto component.
Step‐by‐Step for the Principal Software Engineer
2. In Simulation lane, place a “Proteus” container around the Hardware blocks.
5. Connect:
6. Notes or stereotypes for CRT optimization inside the RSA Module, and mention 8051 resource constraints next to the MCU block.
Essential Elements
• Clear, unique labels for each block (e.g., “8051 MCU”, “RSA Module”)
• Callouts or side notes for key design points (CRT, big‐integer handling, UART baud rate/config)