This project was developed as part of my Master's degree in Industrial Safety and Security at the Technical University of Applied Sciences Augsburg (https://www.tha.de/).
As part of the Master's Seminar course, I conducted an experiment to evaluate the effectiveness of artificial intelligence in solving cybersecurity-related tasks. The focus of the research was vulnerability discovery in C/C++ codebases using an AI-powered security review agent.
To support the experiment, I developed a moderately complex test application and intentionally introduced a number of security vulnerabilities. The AI agent defined in c-cpp-security-reviewer.agent.md was then tasked with identifying these vulnerabilities through automated code review.
The results, methodology, and findings of the study are documented in the accompanying paper:
Vulnerability_discovery_in_C++_code_The_Agentic_AI_Approach.pdf
pdf_archiver is a C++20 command line tool that archives PDF files into encrypted ZIP payloads, stores metadata in SQLite, fetches UTC timestamps over HTTP, and logs operations with spdlog.
The application shall be called pdf_archiver and provide a command-line interface for securely archiving and retrieving PDF documents.
The tool shall accept the following arguments:
- A name
- A PDF file
- A password
Example:
./build/pdf_archiver <name> <pdf-file> <password>When executed, the application shall:
-
Archive the provided PDF file into a ZIP archive.
- The archive must be created using the libarchive library.
- The archive must be encrypted using the provided password.
- Encryption must be implemented using the OpenSSL library.
-
Store metadata about the operation in a local SQLite database.
- The name provided by the user.
- The path to the generated ZIP archive.
- The timestamp of the operation.
- The password used for encryption.
- Database operations must be implemented using the sqlite3 library.
-
Retrieve the current UTC timestamp from a public time service.
- The timestamp must be obtained via an HTTP request to a public API.
- HTTP communication must be implemented using the libcurl library.
-
Log all relevant operations and events.
- Logging must be implemented using the spdlog library.
The application shall also support retrieval of previously archived PDF files.
Example:
./build/pdf_archiver --get <name> <password>When executed in retrieval mode, the application shall:
-
Search the SQLite database for the specified name.
-
Verify that the provided password matches the password stored in the database.
-
If the password is valid:
- Locate the corresponding encrypted ZIP archive.
- Decrypt and extract the archive.
- Restore the original PDF file.
-
If the password is invalid:
- Log an appropriate error message.
- Terminate the application without extracting the file.
main.cpp: CLI entry point and top-level error handlingsrc/util: utility library for argument parsing and filesystem helperssrc/adapters: C++ wrapper classes aroundlibarchive,OpenSSL,sqlite3, andlibcurlsrc/app: application service that orchestrates store and retrieve flows
cmake -S . -B build
cmake --build build./build/pdf_archiver <name> <pdf-file> <password>
./build/pdf_archiver --get <name> <password>| Dependency | Version |
|---|---|
| gcc | 13.3.0 (Ubuntu 13.3.0-6ubuntu2~24.04.1) |
| build-essential | 12.10ubuntu1 |
| cmake | 3.28.3-1build7 |
| libarchive-dev | 3.7.2-2ubuntu0.6 |
| libcurl4-openssl-dev | 8.5.0-2ubuntu10.9 |
| libspdlog-dev | 1:1.12.0+ds-2build1 |
| libsqlite3-dev | 3.45.1-1ubuntu2.5 |
| libssl-dev | 3.0.13-0ubuntu3.9 |
sudo apt install \
build-essential \
cmake \
gcc \
libarchive-dev \
libcurl4-openssl-dev \
libspdlog-dev \
libsqlite3-dev \
libssl-devShort descriptions of the agent configuration files included in this repository:
/.github/agents/c-cpp-security-reviewer.agent.md: Agent definition for the C/C++ security review (persona, goals and review workflow)./.github/agents/c-cpp-coding.agent.md: Agent definition for a C/C++ coding assistant used for implementation and fixes./.github/prompts/c-cpp-security-review.prompt.md: Prompt template that invokes the security-review agent with repository-specific instructions./.github/instructions/c-cpp.instructions.md: Editing and review guidance that agents follow when working with C/C++ sources and CMake files./.github/skills/*: Skill modules used by agents for concrete tasks (compilation, static analysis, etc.). Each skill contains tooling and usage notes.
These files configure the agent personas, prompts, and helper skills used during automated code review and related experiments.
To run the C/C++ security review prompt:
- In the VS Code copilot chat start a session and call
/c-cpp-security-review