# Secure Transmission for Buffer-Aided Relay Networks in the Internet of Things
## Appendix C  
We first define \(Z_{1}=\underset{1\leq k\leq K}{\max}\left(\frac{P_{R_{2}}\left|h_{R^{*}E_{k}} \right|^{2}}{1+P_{J_{2}}\left|h_{JE_{k}}\right|^{2}}\right)\), and the CDF of \(Z_{1}\) can be expressed as  
\[F_{Z_{1}}\left(z\right)=\Pr\left[\underset{1\leq k\leq K}{\max}\left(\frac{P_ {R_{2}}\left|h_{R^{*}E_{k}}\right|^{2}}{1+P_{J_{2}}\left|h_{JE_{k}}\right|^{2} }\right)<z\right]=\prod_{K}\Pr\left(\frac{P_{R_{2}}\left|h_{R^{*}E_{k}}\right| ^{2}}{1+P_{J_{2}}\left|h_{JE_{k}}\right|^{2}}<z\right). \tag{16}\]  
In view of the selection of a relay sensor that is independent of the eavesdroppers' channel, we have the PDF of \(\left|h_{R^{*}E_{k}}\right|^{2}\) and \(\left|h_{JE_{k}}\right|^{2}\) as follows:  
\[f_{\left|h_{R^{*}E_{k}}\right|^{2}}\left(x\right)=\lambda_{RE}e^{-\lambda_{RE} x}, \tag{17}\]  
and  
\[f_{\left|h_{JE_{k}}\right|^{2}}\left(x\right)=\lambda_{JE}e^{-\lambda_{JE}x}. \tag{18}\]  
By substituting Equations (17) and (18) into Equation (16), the CDF of \(Z_{1}\) can be easily obtained, which is given by  
\[F_{Z_{1}}\left(z\right)=\left(1-\frac{P_{R_{2}}\lambda_{JE}}{P_{R_{2}}\lambda_ {JE}+P_{J_{2}}\lambda_{RE}z}e^{-\frac{\lambda_{RE}z}{P_{R_{2}}}}\right)^{K}. \tag{19}\]Next, we can derive the PDF of \(Z_{1}\) by taking the derivative of \(F_{Z_{1}}\left(z\right)\) with respect \(z\). We also denote \(X_{2}=\left|h_{R_{M_{2n}}^{\prime\prime}D}\right|^{2}\) and the CDF of \(X_{2}\) can be easily derived by making a substitution of some parameters. Following a similar approach, the CDF of \(\gamma_{E2}^{SCJ}\) under the NCE scenario can be given by  
\[F_{\gamma_{E2}^{SCJ}}\left(x\right)=\Pr\left(\frac{1+X_{2}}{1+Z_{1}}<x\right)= \int_{0}^{\infty}F_{X_{2}}\left(xz+x-1\right)f_{z_{1}}\left(z\right)dz. \tag{10}\]  
Substituting the CDF of \(X_{2}\) and the PDF of \(Z_{1}\) into Equation (10), and denoting \(\beta=\frac{\lambda_{IE}P_{R_{2}}}{\lambda_{RE}P_{I_{2}}}\), \(\mu\left(t\right)=\frac{\lambda_{RE}x+\lambda_{RE}\left(t+1\right)}{P_{R_{2}}}\), the CDF of \(\gamma_{E2}^{SCJ}\) can be further expressed as  
\[ \begin{split} F_{\gamma_{E2}^{SCJ}}\left(x\right)& =K\sum_{s=0}^{M_{2n}}\sum_{t=0}^{K-1}\left(\begin{array}{c}M_{2,n}\\ s\end{array}\right)\left(\begin{array}{c}K-1\\ t\end{array}\right)\left(-1\right)^{s+t}\beta^{t}\\ &\times e^{-\frac{\lambda_{RE}\mu^{\prime}\left(x-1\right)}{P_{R_{2}}} \left[\frac{\lambda_{IE}}{P_{I_{2}}}\underbrace{\int_{0}^{\infty}\frac{e^{- \mu\left(t\right)yd}}{\left(y+\beta\right)^{t+1}}}_{I_{1}\left(t\right)}+ \beta\underbrace{\int_{0}^{\infty}\frac{e^{-\mu\left(t\right)yd}y}{\left(y+ \beta\right)^{t+2}}}_{I_{2}\left(t\right)}\right].\end{split}  \tag{11}\]  
For item \(I_{1}\left(t\right)\), there are two cases to consider, i.e., \(t=0\) and \(t>0\). We can obtain the corresponding terms for two cases according to the equalities [40] (eq. (3.352.4)) and [40] (eq. (3.353.2)), respectively. Similarly, the item \(I_{2}\left(t\right)\) can be easily derived when we utilize [40] (eq. (3.353.2)) to solve the corresponding integral. Finally, the desired results in **Theorem 4** can be easily obtained after some mathematical manipulations. **Appendix D**  
Denoting \(Y_{3}=\left\|\mathbf{h}_{R^{*}E}\right\|^{2}\) and \(Z_{2}=\left\|\mathbf{h}_{IE}\right\|^{2}\), the CDF of \(\gamma_{E2}^{SCJ}\) under the CE scenario can be given by  
\[ \begin{split} F_{\gamma_{E2}^{SCJ}}\left(x\right)& =\Pr\left(\frac{1+P_{R_{2}}X_{2}}{1+\frac{P_{R_{2}}Y_{3}}{1+P_{I_ {2}}Z_{2}}}<x\right)\\ &=\int_{0}^{\infty}\int_{0}^{\infty}F_{X_{2}}\left(\frac{x-1}{P_ {R_{2}}}+\frac{xy}{1+P_{I_{2}}z}\right)f_{Y_{3}}\left(y\right)dyf_{Z_{2}}\left( z\right)dz.\end{split}  \tag{12}\]  
By invoking the PDF of \(Y_{3}\) and \(Z_{2}\) and the CDF of \(X_{2}\) into Equation (12), we can obtain the expression as follows:  
\[