Project for the course of Cybersecurity, master degree in Computer Engineering @ Università degli Studi di Salerno.
This repository contains the proposed solution for the assigned final project for the course of Cybersecurity, master degree in Computer Engineering @ Università degli Studi di Salerno.
The project concerns the simulation of a contact tracing application, in order to limit the spread of the SARS-COV2 virus.
Before starting, you need to generate some certificates necessary for operation. The project simulates connections to servers using the TLS protocol.
keytool -genkeypair -alias INSERT_ALIAS -keyalg EC -keysize 256 -sigalg SHA256withECDSA -validity 365 -storetype JKS -keystore ct_keystore.jks -storepass INSERT_PASS
keytool -export -alias INSERT_ALIAS -storepass INSERT_PASS -file ct_server.cer -keystore ct_keystore.jks
keytool -import -v -trustcacerts -alias INSERT_ALIAS -file ct_server.cer -keystore user_truststore.jks -keypass INSERT_PASS -storepass INSERT_PASS
keytool -import -v -trustcacerts -alias INSERT_ALIAS -file ct_server.cer -keystore ha_truststore.jks -keypass INSERT_PASS -storepass INSERT_PASS
keytool -genkeypair -alias INSERT_ALIAS -keyalg EC -keysize 256 -sigalg SHA256withECDSA -validity 365 -storetype JKS -keystore ha_keystore.jks -storepass INSERT_PASS
keytool -export -alias INSERT_ALIAS -storepass INSERT_PASS -file ha_server.cer -keystore ha_keystore.jks
keytool -import -v -trustcacerts -alias INSERT_ALIAS -file ha_server.cer -keystore ct_truststore.jks -keypass INSERT_PASS -storepass INSERT_PASS
In order to launch the simulation, you have to:
java -Djavax.net.ssl.keyStore=ct_keystore.jks -Djavax.net.ssl.keyStorePassword=INSERT_PASS -Djavax.net.ssl.trustStore=ct_truststore.jks -Djavax.net.ssl.trustStorePassword=INSERT_PASS CTServer
java -Djavax.net.ssl.trustStore=user_truststore.jks -Djavax.net.ssl.trustStorePassword=INSERT_PASS Simulation
To simulate the passage of time, in the Simulation class there is the variable t that
indicates the time expressed in minutes. Therefore, the execution cycle is divided into periods of one minute.
It is possible to set some parameters of the simulation in the Simulation.java file:
The simulation creates a number of smartphones equal to NUM_SMARTPHONE with a random position within the space. Any smartphone for simplicity receives the list of all smartphones in the simulation. The simulation is scanned a 1-minute periods in which the simulateRoutine() method of the class is invoked Smartphone, for each smartphone of the simulation, which operates as follows:
ProjectCybersecurity-DIEM_UNISA
├─ README.md
└─ src
├─ ByteArrayWrapper.java
├─ ClientUtils.java
├─ ContactTime.java
├─ CTServer.java
├─ HAServer.java
├─ Position.java
├─ Server.java
├─ Simulation.java
├─ Smartphone.java
└─ Utils.java