# Secure Utilization of Beacons and UAVs in Emergency Response Systems for Building Fire Hazard
## 3 UAV-Assisted Emergency Monitoring and Response System
### AllJoyn Security Platform for UAV-EMOR System  
The AllJoyn system supports a security framework for IoT applications to authenticate each other and send encrypted data between them. Since AllJoyn applications can be installed on the IoT devices, it can be utilized to provide end-to-end application level security between IoT devices, and thus authentication and data encryption are done at the application layer. All of the logic for authentication and encryption except the Auth is implemented in the AllJoyn core library. The Auth Listener is a callback function implemented by the application to provide auth credentials (e.g., PIN or password) or verify auth credentials (e.g., verify the certificate chain in the case of ALLJOYN_ECDHE_ECDSA). The security module manages a key store to save authentication and encryption keys. The AllJoyn security platform makes use of the ECDHE (Elliptic Curve based Diffie-Hellman Key Exchange) [32] algorithm for generating session keys. Furthermore, it utilizes the Simple Authentication and Security Layer (SASL) [33] security framework for authentication and key exchange. It supports the following authentication mechanisms for app-to-app level authentication:  
* ALLJOYN_SRP_KEYX: Secure Remote Password (SRP) key exchange. * ALLJOYN_SRP_LOGON: Secure Remote Password (SRP) log on with username and password. * ALLJOYN_ECDHE_NULL: Elliptic Curve Diffie-Hellman (ephemeral) key exchange with no authentication. * ALLJOYN_ECDHE_PSK: Elliptic Curve Diffie-Hellman (ephemeral) key exchange authenticated with a pre-shared key (PSK). * ALLJOYN_ECDHE_ECDSA: Elliptic Curve Diffie-Hellman (ephemeral) key exchange authenticated with an X.509 ECDSA certificate. We applied the ALLJOYN_ECDHE_PSK mechanism to support authentication and secure communication between all components. Figure 3 shows an overview of the security architecture of our UAV-EMOR system. This ALLJOYN_ECDHE_PSK mechanism provides the pre-shared key-based authenticated ECDHE [32] to share the communication session encryption key between all components. In the setup phase, the control server generates a Pre-shared Secret Key (PSK) with each of the UAVs, the security manager's smartphone and the smart sensors. Each component shares a unique PSK with the control server. In order to generate a session encryption key, the pre-shared key-based authenticated ECDHE protocol should be performed between all components. Since all components such as UAVs, smart sensors, etc., have already been authenticated, a PSK is found in the key store. Therefore, the UAV can directly execute the next step of generating a session key and/or a group key. Each component may generate a session key with the control server by using the ECDHE algorithm based on the pre-shared key authentication. Once the session key is generated, it is used along with the AES (Advanced Encryption Standard) [34] algorithm to encrypt communication messages. This is accomplished by installing the AllJoyn security platform on the control server and the security manager's smartphone, as well as on all of the UAVs and smart sensors. Figure 4 shows the high-level message flow of the end to end security communication between the control server and the UAV as an example. This flow consists of following four steps:  
* Exchange Auth GUIDs (Authentication Group User Identifications): In this step, two peers such as the control server and the UAV exchange Auth GUIDs. The Auth GUID is used to see if the pre-shared key is present for that Auth GUID in the key store. If no pre-shared key is found, the two peers have not authenticated each other. Therefore, the two peers should execute the next app-to-app authentication step. * App-to-app authentication: In this step, two peers perform the authentication mechanism supported by the AllJoyn platform. At the end of this step, the two peers have authenticated each other and share a common pre-shared key. * Generate a session key: In this step, two peers generate a session key for encrypting communication messages between them.