# Vehicular Alarm System Using mHealth Data and Lightweight Security Algorithms
## Security Algorithms with Lightweight Security
### Authentication Procedure  
We use the RSA algorithm to generate the asymmetric keys for the authentication process. We assume that there are \(m\) numbers of SUs in the mHealth network. \(ID_{i}\) denotes the unique identity of \(SU_{i}\). Request and Acknowledgement denote the packet request and the packet response, respectively. \(\mathrm{Sign_{A}(0)}\) denotes signature mechanism of user A, \(\mathrm{Cert_{A}}\) denotes the certificate of user A, and \(\mathrm{P_{PK}(. )}\) denotes the encrypting process using the public key (PK). The authentication procedure is shown in Figure 7 for each step. Figure 8 illustrates the workflow of the working procedure using a digital signature to use PU's free spectrum. Figure 6: Flow of trust calculation for member nodes. In this subsection, we present the steps of the authentication procedure as follows. **Step 1**: \(SU_{i}\) generates a random number \(r_{i}\) by pseudo random generator and sends the request packet to SUBS, \(I=(\mathit{Request},\ ID_{i},r_{i})\). Figure 8: Workflow of the procedure with a digital signature. Figure 7: Information flow of the authentication procedure with each step. **Step 2**: SUBS generates the public-private key (\(pu_{i},\;pr_{i}\)) by the RSA algorithm and sends the private key (\(pr_{i}\)) to \(SU_{i}\) by a secure channel. SUBS generate a random number \(r_{SUBS}\) by using a pseudo random generator. SUBS then sends the respond packet to \(SU_{i}\), \(II=P_{pr_{i}}(\;ID_{i},ID_{SUBS},\;r_{i},\;r_{SUBS})\). **Step 3**: \(SU_{i}\) decrypts the data packet by using SUBS's public key \(pu_{i}\) to retrieve the random number \(r_{SUBS}\). \(SU_{i}\) verifies whether the generated random number is similar to the received random number or not. If both numbers are identical, \(SU_{i}\) sends the data packet to SUBS. SU\({}_{i}\)  
\[III=(Cert_{SUi},\;r_{i},\;ID_{SUBS},\;Sign_{SUi}(r_{i},\;r_{SUBS},\;ID_{SUBS}))\]  
SUBS verifies the digital signature of \(SU_{i}\). If it is a valid signature, then \(SU_{i}\) is registered and authenticated to communicate with SUBS and use PU's spectrum. **Step 4**: \(SU_{i}\) sends requests to use the free spectrum of PU to the SUBS. \[IV=\Big{(}Request,\;\;sensing_{info},\;ID_{i},r_{i}\Big{)}\]  
**Step 5**: SUBS sends requests to other secondary users \(SU_{j}\) to send sensing information \(sensing_{info}\) about the primary users. \[V=P_{pr_{i}}\left(ID_{SUBS},\;r_{SUBS},\;ID_{j}\right)\]  
**Step 6**: \(SU_{j}\) decrypts the data packet by using SUBS's public key \((pu_{i})\) to retrieve the random number \(r_{SUBS}\). \(SU_{j}\) sends the data packet to SUBS. \[VI=\Big{(}Cert_{SUj},\;r_{j},\;ID_{SUBS},\;Sign_{SUj}\Big{(}r_{j},\;r_{SUBS}, \;ID_{SUBS},\;sensing_{info}\Big{)}\Big{)}\]  
SUBS verifies both sensing information received from \(SU_{j}\) and \(SU_{i}\). If both are identical, then it will process \(SU_{i}\)'s spectrum request. **Step 7**: SUBS send requests to PUBS for assigning spectrum to \(SU_{i}\). \[VII=(Request,\;ID_{SUBS},\;ID_{i},\;r_{SUBS})\]  
**Step 8**: PUBS send one acknowledgement to SUBS. \[VIII=(\text{ACK},\;\;ID_{PUBS},\;r_{PUBS})\]  
**Step 9**: PUBS send the data packet to SUBS for enquiring \(SU_{i}^{\prime}\)s trust value \(\text{T}_{\text{Sui}}\). \[IX=P_{pu_{j}}(ID_{PUBS},ID_{SUBS},\text{T}_{\text{Sui}},\;r_{SUBS},\;r_{PUBS }).\]  
**Step 10**: PUBS generates the public-private key (\(pr_{j},\;pu_{j}\)) by the RSA algorithm and sends the public key (\(pu_{j}\)) to SUBS by a secure channel. Figure 8:0  
**Step 11**: SUBS sends the respond packet regarding \(\text{T}_{\text{Sui}}\) to PUBS. Figure 8:1  
**Step 12**: PUBS also sends one data packet to CA for enquiring the \(SU_{i}^{\prime}\) trust value \(\text{T}_{\text{Sui}}\). Figure 8:2  
**Step 13**: CA generates the public-private key (\(\text{pr}_{\text{CA}}\), \(\text{pu}_{\text{CA}}\)) by the RSA algorithm and sends the public key (\(\text{pu}_{\text{CA}}\)) to PUBS by a secure channel.