How aitorcm2000/spc_tra5_aitor works
Project Type and Purpose
• The project is an assignment for learning secure file management.
• Its functionality covers hashing, AES and RSA encryption/decryption, digital signing, and includes a graphical user interface.
• The assignment is meant to show a practical implementation of various cryptographic tools in Java.
Analyzing the File Structure
• The "src/main/java/com/aitor/ra5" directory is the core source code.
• Subdirectories:
• "controller": Contains the central Controller.java, indicating a class that manages the flow of data and interactions between the UI and the internal encryption tools.
• "main": Hosts the main entry point of the application (AitorCarrenoMarquesTraRA52024.java) where the application launches.
• "tools": Contains various utility classes that implement cryptographic functions:
▪ "DigitalSigningTool.java" – handles digital signing.
▪ "HashTool.java" – handles hashing operations.
▪ "PasswordValidator.java" – might be used for security checks.
• "tools/aes": Implements AES specific functionalities (encryption, key generation, salt handling), along with a notes file for additional context.
• "tools/rsa": Implements RSA specific functionalities (encryption, key generation/management) alongside another notes file.
• "vista": Contains the GUI components (MainFrame.java and its form configuration) which present an interface to the user.
• There is also an RSAkeys folder at the top level containing public and secret keys, indicating external storage of cryptographic keys.
Components
a. Main Components:
• Application Entry Point: The main class in the "main" package.
• Graphical User Interface (GUI): Represented by MainFrame in the "vista" package which provides user interactions.
• Controller Layer: The Controller (in the "controller" package) manages application logic and acts as a mediator between the UI and the underlying cryptographic tools.
• Cryptography Toolkit: This is composed of two branches:
▪ AES Tools: For key generation and file encryption/decryption (AESFileEncryption, AESKeyGen, and Salt).
▪ RSA Tools: For RSA key pair generation, encryption/decryption, and key management (RSAEncryption, RSAKeyPairGenerator, and RSAKeyPairManager).
• Utility Services: Other cryptographic functions such as hashing (HashTool) and digital signing (DigitalSigningTool) as well as password validation (PasswordValidator).
• External Key Storage: The RSAkeys directory that holds predefined keys used by various RSA functionalities.
b. Relationships and Interactions:
• The GUI interacts with the Controller via user commands.
• The Controller orchestrates the cryptographic operations by invoking corresponding classes from the Tools module.
• AES and RSA tool modules interact with each other minimally but are independent services handling their own algorithms.
• There could also be logging or error reporting mechanisms (as described in the goals) that should be symbolically connected (e.g., error flows from the Controller back to the GUI, or logs being stored separately).
Architectural Patterns and Design Principles
• A loosely Model-View-Controller (MVC) pattern is evident. The view is the GUI, the controller manages operations, and the utilities (tools) effectively act as the business logic (or model) performing encryption, hashing, and digital signing.
• Separation of concerns is important: UI, business logic, and cryptographic operations are distinctly separated.
• Components are modular, allowing each cryptographic functionality (AES, RSA, hashing, signing) to be maintained or extended without affecting the entire system.