A secure log, to describe the state of an institute: the guests and employees who have entered and left, and persons that are in campus in different buildings or rooms, is implemented in this project. The log will be used by two programs. One program, logappend
, will append new information to this file, and the other, logread
, will read from the file and display the state of the institute according to a given query over the log. Both programs will use an authentication token, supplied as a command-line argument, to authenticate each other. Specifications for these two programs are described in more detail here: logappend
and logread
.
All the source files and Makefile
are located in the build
directory. After building, the executables logappend
and logread
will be created within the build
directory.
The project uses the libsodium
library for cryptographic operations and nlohmann-json
for JSON parsing.
This project requires:
libsodium
- for cryptographic functions.nlohmann-json
- for JSON parsing.
sudo apt update
sudo apt install libsodium-dev
sudo apt install nlohmann-json3-dev
If you are a root user omit sudo
from above commands.
brew install libsodium
brew install nlohmann-json
For this project, we recommend setting up the required libraries (libsodium
and nlohmann-json
) using MSYS2 due to its simplicity of setup:
-
Ensure that MSYS2 is installed on your system.
-
Open the MSYS2 terminal and run:
pacman -Syu
-
Install
libsodium
:pacman -S mingw-w64-x86_64-libsodium
-
Install
nlohmann-json
:pacman -S mingw-w64-x86_64-nlohmann-json
-
Compilation Instructions: To compile the project (before running
make
), ensure the correct include and library paths are specified for your compiler. The following flags are used:- Include Path (
-I
): Specifies the directory for header files required by the project. (For exapmle, "C:/msys64/mingw64/include" for MinGW64) - Library Path (
-L
): Specifies the directory containing the necessary libraries. (For example, "C:/msys64/mingw64/lib" for MinGW64)
- Include Path (
To build the project, follow these steps:
- Clone the repository:
git clone https://github.com/Shr-Agr/Secure_Logger.git
- Navigate to the build directory:
cd Secure_Logger
cd build
- Run make to compile the executables:
make
This will create two executable files in the build directory:
logappend
logread
After building the project, you can run the executables from the build directory.
Running logappend
./logappend [options]
Running logread
./logread [options]
Details about [options] is provided here: logappend
and logread
.