How numillyash/coursework works
Main Components
• Command-Line Interface (CLI): Represented as the entry point where the user invokes the application with various flags (genkey, sign, check, encrypt, and decrypt).
• Core Cryptographic Engine:
• RSA Key Generation Module: Handles the generation of public/private keys, making use of various prime files and key size parameters.
• Signature Module: Computes and verifies digital signatures.
• Encryption/Decryption Module: Provides the logic for encrypting and decrypting files.
• Optimization and Math Modules:
• Algorithm-level Optimizations (e.g., FFT-based multiplication)
• Machine-independent and machine-specific (assembly) optimization routines
• Underlying Mathematical Computations (Karatsuba multiplication and other routines)
• File I/O and Utility Module:
• Reads and writes files (plain text, encrypted data, keys, and signatures)
• Parsing configuration and command-line arguments (likely involving helper routines as seen in files like help.h)
• Testing and Validation Suite:
• Test Scripts and Input Files: Organized under the tests directory and separate input files for validating encryption, decryption, signing, and key generation.
• Build and Configuration:
• Makefile and configuration headers (config.h) that indicate build-time configurations and dependencies.
Relationships and Interactions
• User calls the CLI which routes to the appropriate module (key generation, signing, checking, encryption, or decryption).
• The CLI layer passes file paths and parameters to the core engine.
• The Core Engine processes input files using the cryptographic algorithms (with internal callouts to optimized math routines).
• Optimized routines (whether in C or inline assembly) are called as sub-components within the engine for critical operations.
• The File I/O module interacts with the system to load input data (plain text, keys, etc.) and produce output files.
• Testing components validate that the chain of operations (from CLI inputs to cryptographic result and file outputs) works as expected.
Architectural Patterns and Design Principles
• Modular Design: Each major functionality (key generation, encryption, decryption, signing, verifying) is encapsulated within its own module. This organizes the code logically and makes it easier to maintain.
• Separation of Concerns: The project separates user interaction (CLI) from the cryptographic engine and from the optimization logic.
• Extensibility: The design anticipates the possibility of integrating or changing optimization routines (e.g., switching between Karatsuba and FFT methods).
• Emphasis on Testing: A dedicated test suite indicates a test-driven approach to ensure each module performs correctly.