The ACSQL system is designed to manage university data related to students, courses, and their enrollments. It provides functionality to query, update, delete, and securely store the information using a simple encryption scheme.
The core database structure containing:
- List of all students (
studenti) - List of all courses (
materii) - Enrollment details linking students to courses (
inrolari)
Fields:
id- Unique student identifiernume- Full name of the studentan_studiu- Year of study (1 to 4)statut- Type of study program ('b' for budget/state-funded, 't' for tax/self-funded)medie_generala- General average grade
Fields:
id- Unique course IDnume- Course namenume_titular- Lead instructor's name
Represents a many-to-many relationship between students and courses:
id_student- Student IDid_materie- Course IDnote- Grades array:[lab, midterm, final]
- 1.1 Load database from file: Function to read and load the database dynamically.
- 1.2 Add student: Add a new student to the database.
- 1.3 Free memory: Properly free allocated memory to prevent leaks.
-
2.1 Queries:
- Simple queries (SELECT fields FROM table;)
- Filtered queries (WHERE condition)
- Complex filtered queries (two conditions joined by AND)
-
2.2 Updates & Deletes:
- Update fields (except IDs) based on conditions.
- Delete entries based on conditions.
- Implement a simplified Cipher Block Chaining (CBC) encryption on the students array before saving.
- Use a substitution-permutation network (SPN) with an S-box (XOR with key) and a P-box permutation.
- Split data into 4 equal-sized blocks, pad last block if necessary.
- XOR first block with IV, subsequent blocks XOR’d with previous ciphertext block.
Message: "Ana are mere!"
Key: pclp1
IV: ab
Steps:
- Convert message to bytes.
- Split into 4 blocks and pad last block.
- XOR first block with IV repeated.
- Apply S-box (XOR with key).
- Apply P-box permutation.
- Repeat for remaining blocks, chaining with previous ciphertext.
- Compile and run the ACSQL system.
- Use the provided commands for querying, updating, deleting.
- Encryption protects sensitive student data on disk.
Your Name
Specify your license here.