# Enabling Trustworthy Multicast Wireless Services through D2D Communications in 5G Networks
## 3 Background
### Diffie-Hellman Solution for Security  
A direct communication between devices over the wireless insecure channel is vulnerable to various types of attacks. Some basic security requirements have to be met in order to protect transmitted data and users' privacy. Among these, there are data confidentiality and integrity, authentication, non-repudiation, and reliability. According to [PERSON] and [PERSON], cryptography is the best way to  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**CQI Index**} & \multirow{2}{*}{**Modulation Scheme**} & **Efficiency D2D** & **Minimum Rate D2D** & **Efficiency Cellular** & **Minimum Rate Cellular** \\  & & **(bit/s/Hz)** & **(kbps)** & **(bit/s/Hz)** & **(kbps)** \\ \hline
1 & QPSK & 0.1667 & 28.00 & 0.1523 & 25.59 \\
2 & QPSK & 0.2222 & 37.33 & 0.2344 & 39.38 \\
3 & QPSK & 0.3333 & 56.00 & 0.3770 & 63.34 \\
4 & QPSK & 0.6667 & 112.00 & 0.6016 & 101.07 \\
5 & QPSK & 1.0000 & 168.00 & 0.8770 & 147.34 \\
6 & QPSK & 1.2000 & 201.60 & 1.1758 & 197.53 \\
7 & 16-QAM & 1.3333 & 224.00 & 1.4766 & 248.07 \\
8 & 16-QAM & 2.0000 & 336.00 & 1.9141 & 321.57 \\
9 & 16-QAM & 2.4000 & 403.20 & 2.4063 & 404.26 \\
10 & 64-QAM & 3.0000 & 504.00 & 2.7305 & 458.72 \\
11 & 64-QAM & 3.0000 & 504.00 & 3.3223 & 558.72 \\
12 & 64-QAM & 3.6000 & 604.80 & 3.9023 & 655.59 \\
13 & 64-QAM & 4.5000 & 756.00 & 4.5234 & 759.93 \\
14 & 64-QAM & 5.0000 & 840.00 & 5.1152 & 859.35 \\
15 & 64-QAM & 5.5000 & 924.00 & 5.5547 & 933.19 \\ \hline \hline \end{tabular}
\end{table}
Table 1: CQI-MCS mapping in LTE-A.  
Figure 1: eMBMS architecture.  
satisfy most of these requirements. In [23], they proposed a public key distribution system suited to the scenario of two peers that have to exchange data in a secure way. Starting from the knowledge of two public keys, they can generate the same secret key to be used for both encrypting and decrypting data. The strength of the proposed technique is due to the difficulty of computing logarithms over a finite field (Galois Field) \(GF(q)\) with a prime number \(q\) of elements. Let:  
\[Y=\alpha^{X}\bmod q,\qquad\text{for }1\leq X\leq q-1, \tag{1}\]  
where \(\alpha\) is a fixed primitive element of \(GF(q)\) known to both users involved in the D2D communication, and \(X\) is the logarithm of \(Y\) to the base \(\alpha\), mod \(q\), so that it can be computed as:  
\[X=\log_{\alpha}Y\bmod q,\qquad\text{for }1\leq Y\leq q-1. \tag{2}\]  
While computing \(Y\) from \(X\) is easy, the calculation of \(X\) from \(Y\) can be much more difficult. It is necessary to choose a number \(q\) consisting of many digits in order to make the system more robust. The security of the technique crucially depends on the difficulty of computing logarithms mod \(q\). When users \(i\) and \(j\) want to communicate privately, first of all, they must agree on the values of \(q\) and \(\alpha\). Then, each user generates an independent random number \(X_{i}\), uniformly chosen from the set of integers \(\{1,2,3,...,q-1\}\), and keeps it secret. \(X_{i}\) is the logarithm of \(Y_{i}\) to the base \(\alpha\), mod \(q\), where \(Y_{i}\) is the public key that user \(i\) must compute and send to \(j\), computed as:  
\[Y_{i}=\alpha^{X_{i}}\bmod q. \tag{3}\]  
The key used for both enciphering and deciphering by the two users is:  
\[K_{ij}=\alpha^{X_{i}X_{j}}\bmod q. \tag{4}\]  
User \(i\) obtains \(K_{ij}\) by obtaining \(Y_{j}\) from user \(j\) and letting:  
\[K_{ij}=Y_{j}^{Xi}\bmod q=(\alpha^{X_{j}})^{Xi}\bmod q=\alpha^{X_{i}X_{j}} \bmod q. \tag{5}\]  
Similarly, user \(j\) obtains \(K_{ij}\) as:  
\[K_{ij}=Y_{i}^{X_{j}}\bmod q. \tag{6}\]  
For an untrusted third party, it is impossible to generate the same key \(K_{ij}\), since it can not know \(X_{i}\) and \(X_{j}\) in any way because they are kept secret by users [23]. In addition to the DHKE algorithm, the use of message authentication can help to avoid the man-in-the-middle attack, which represents the main vulnerability of the DHKE algorithm.