How dangduongminhnhat/cryptography-and-network-security-hcmut works
Main Components
• Entry Point (main.py): This file is the starting point of the program. It likely handles user input, orchestrates key generation, encryption, decryption, and displays results.
• RSA Implementation Module (rsa_implement.py): This module contains the core RSA algorithm logic, from key generation to encryption and decryption routines.
• Prime Number Generator (sieve_base.py): As suggested by its name, this module probably implements the Sieve of Eratosthenes (or related algorithm) to generate prime numbers, which are essential for choosing the RSA keys.
• Supporting / Auxiliary Files:
• README.md provides documentation and instructions.
• The images folder contains demo screenshots, which might be referenced in the project documentation but do not affect runtime logic.
• __pycache__ is auto-generated for performance optimization and doesn’t represent a design component.
Relationships and Interactions
• The program flow begins in main.py where the user runs the program (via “python main.py”).
• main.py calls functions in rsa_implement.py to manage the RSA logic (e.g., generating keys, encryption, decryption).
• Within rsa_implement.py, when prime numbers are required for key generation, the module delegates responsibility to sieve_base.py.
• The data flow is essentially sequential: user input -> main controller -> RSA processing -> use of sieve-based prime generation -> output.
• You may also include error handling paths or logging if there are dedicated functions, though these are not immediately visible from the file tree.
Architectural Patterns and Design Principles
• Modularity: The separation of concerns is clear. The project divides the RSA algorithm implementation (rsa_implement.py) from its helper function for prime generation (sieve_base.py), which allows for easier maintenance and potential reusability.
• Reusability and Encapsulation: Each module is dedicated to a specific task, adhering to single responsibility principles.
• Procedural Flow: It follows a relatively simple procedural or layered architecture – a main controller orchestrating calls to helper modules for mathematical operations.
Incorporate Relevant Technology
• Python is the primary programming language.
• There is no explicit usage of external libraries mentioned in the README, so the focus is on standard Python modules.
• The use of __pycache__ indicates standard Python optimization practices.
Essential Architectural Elements
• Clearly separate the orchestration (main.py) from the computational logic (rsa_implement.py and sieve_base.py).