# Multi-Device Security Application for Unmanned Surface and Aerial Systems
## 3 Methods and Materials
### Experiment One Application--MAUI Chat  
The development of MAUI chat in phase one allows us to understand and test the baseline requirements to implement the MLS functionality. The MAUI chat application was developed and run in Ubuntu virtual environments to simulate the UxS environment. We test the three primary components of the MLS protocol: create user, create group, and group  
Figure 4: The MAUI Metrics of interest. maintenance. During this testing, we monitored the communication via WireShark to assess the packet contents to ensure the encryption of plaintext. The following components are necessary for the initial application to create a secure chat session between two clients: MLS Functionality, Networking Functionality, and Message Exchange. The source code for MAUI chat is available in our GitHub repository named mls_chat [20]. To enable MLS functionality, we added the compiled MLS library to the development root folder containing the main.cpp file. **MLS Functionality**  
To access the MLS API library needed for our implementation, we added the following MLS header files throughout our code:  
#include <mls/credential.h>  #include <mls/crypto.h>  #include <mls/session.h>  #include <mls/messages.h>  
These header files provide access to required MLS classes and data types: **mls:Client, mls:Session, mls:=PendingJoin**, and **bytes_ns:bytes**. All members of an MLS group are initialized by the client class that contains the required user credentials for that specific user. These stored credentials are then used to create or join a group for that user through the Session class. The Session class maintains a list of all groups initialized by a user and any groups joined by the user, managed by the MLS maintenance cycle functions (ADD, REMOVE, UPDATE, and COMMIT). For members to be added to the group, a user key package is created by the PendingJoin class. Once a user is added and committed to a group, that user receives the group's WELCOME message containing all the required artifacts to communicate with the group. This information is then saved to that user's session information. Once the groups are established, members can securely communicate over the chosen network. To effectively encrypt and decrypt data across all our MLS applications, the functions **protect** and **unprotect** from the MLS library are used. These functions require data to be in type **bytes**; therefore, we need to convert other data types to and from **bytes**. To this end, we created a **convert** class that contains the necessary conversion functions for our application. These functions are **bytes_to_char**, **char_to_bytes**, **str_to_bytes**, and **bytes_to_str**. **Network Functionality**  
The MAUI chat application uses the Transmission Control Protocol (TCP) to establish server and client connections over an ad-hoc wireless network. The user creating the MLS group acts as the server for the TCP connection, in our case, the ScanEagle. Any other users trying to JOIN the group are denoted in our application as clients. To connect, every client needs to know the server's IP address. This IP address is entered at runtime. TCP was selected as the transport layer protocol because of the packet delivery guarantees inherent to the protocol. These guarantees allow us to implement MAUI chat connection in a more stable environment which mitigates packet loss that can adversely affect the sequencing of the MLS maintenance cycle [21]. For future work, a User Datagram Protocol (UDP) network can be implemented with the packet delivery guarantees at the application layer (using an appropriate MLS delivery service) to improve the group key management performance since UDP allows for the broadcast of messages [22]. **Message Exchange**  
Following the initial group setup and the established TCP connection between server and client, the client then requests to join the group. If the client is added to the group, it receives the **welcome** message and joins the MLS group.