The Rust Unique Secure Talk (T.R.U.S.T.) is a secure chat application with a terminal user interface (TUI), developed in Rust. This project focuses on exploring secure communication principles and implementing a robust end-to-end encryption system for reliable and private messaging.
The core of the project revolves around the Extended Triple Diffie-Hellman (X3DH) protocol for secure key establishment and Double Ratchet protocol for frequent key update. Once a shared secret is established, the application switches to AES-GCM for symmetric message encryption. Together, these algorithms ensure end-to-end confidentiality and integrity of all communications.
- Clone the repository:
git clone https://github.com/christiansassi/advanced-programming-of-cryptographic-methods-project
- Navigate to the project directory:
cd advanced-programming-of-cryptographic-methods-project
Modify the config.toml file located in the config directory to adjust the application settings:
server_ip
: The IP address of the server (default:server
). If you do not plan to use Docker (see Installation from Source), set this to127.0.0.1
or another valid IP address.server_port
: The port on which the server listens (default:3333
).log_level
: The logging level (default:info
).
Warning
Do not modify private_key_server
and public_key_server
. These values are automatically generated by the updater.
You can choose between installing the project using Docker (the default and recommended method) or building the executables manually. The Docker-based approach is recommended because it minimizes compatibility issues by encapsulating all dependencies within containers. Local installation is less user-friendly but still fully functional. All installation methods offer the same features. Choose the one that best fits your environment and preferences.
Note
If you prefer not to use Docker and want to avoid building everything from source, pre-built binaries are available in the target/release folder, except for macOS. If you are using macOS, you will need to build the source files manually. See Installation from Source.
- Verify that Docker is installed by running:
docker --version
- Build the Docker image:
docker compose build --no-cache
- Run the updater to generate server keys:
docker compose run --rm updater
- Start the server and clients:
docker compose up server client1 client2
- Open a new terminal and attach to the TUI of
client1
:
docker container attach client1
- Repeat the previous step for
client2
, if desired. - To stop the containers, press
CTRL+C
in the terminal where you randocker compose up
, or rundocker compose down
.
- Ensure that Rust and Cargo are installed by running:
rustc --version
cargo --version
- Build all components (server, tui, updater) by running the following command from the root fo the repository:
cargo build --release
-
The built executables will be located in the target/release folder.
- First, update the server keys by running the
updater
executable. - Then, start the server by running the
server
executable. - Finally, run any number of clients (as needed) using the
tui
executable.
- First, update the server keys by running the
Warning
The executables require access to the config.toml file. Therefore, you must run them from the root directory of the repository.
The client operates in two modes:
-
NORMAL: Entered by pressing the
ESC
key. This mode allows interaction with the TUI. For a list of available key combinations, check the bottom of the TUI for instructions relevant to the current window. -
INPUT: Entered by pressing the
i
key. As the name suggests, this mode allows you to input text into the application’s input fields.
Before using the client, you need to register by choosing a unique username. Usernames must be non-empty and unique—multiple users cannot share the same username simultaneously.
After registration, you'll be taken to the main window. Initially, your chats list will be empty.
To start chatting, you can add new friends at any time by pressing the a
key in NORMAL
mode.
Warning
The person you want to chat with must be online.
While in NORMAL
mode:
- Use the left/right arrow keys to switch between the chats list and the selected chat.
- In the chats list:
- Use the up/down arrow keys to navigate through your chats.
- Press
ENTER
to select a chat and start messaging.
The Rust Unique Secure Talk (T.R.U.S.T.)
Matteo Bordignon - [email protected]
Alessandro Perez - [email protected]
Christian Sassi - [email protected]
