**5. Discussion**

In practice, the first step to guarantee transmission security is to determine whether attackers exist instead of determining how to resist attackers. Therefore, before using unique techniques (such as AN), we should adopt a specific measure to detect the existence of an attacker, otherwise, many resources will be wasted. Recent work in [30] can successfully distinguish the suspicious objects from the ordinary environment through measuring the incoming signal. Here, we consider the possibility of increasing the beam directivity or enlarging the aperture of the receiver to guarantee the security. In this paper, the diameter of the THz beam is larger than the aperture of the receiver. Thus, Eves can utilize the edge of the beam to realize an attack. However, if the receiver has the ability to capture all of the transmitted THz wave without any leakage, any eavesdroppers trying to put an object in the beam will cause an extensive power reduction on Bob' side. In this case, if Eves still wants to implement an attack, she needs to either utilize the misalignment effect between Alice and Bob which may also induce a leakage or pretend to be irrelevant moving objects. Nevertheless, either way, Eves' strategy to implement an attack would be significantly more complicated and harder to implement. Another purpose of increasing the directivity is to resist the interference. Transceivers on the same unlicensed bandwidth may have interacted with each other. Additionally, jammers can also take advantage of this large bandwidth in the THz band for interference [45]. Increasing their directivity gains can make irrelevant transceivers and jammers either less effective or need to increase their transmit power.

In some cases, Eves are not afraid of being found because they are intended to block the signal power of Bob (reduce the secrecy capacity at the same time). As a countermeasure, multiple IRS-assisted THz systems with opportunistic connectivity may be a choice since Alice can choose different ways to transmit the signal and design unique beamforming schemes to maximize the secrecy rate performance. Researchers have found that opportunistic connectivity [46] with well-designed beamforming schemes can significantly boost the secrecy rate performance and reduce blocking probability.

## **6. Conclusions**

In this paper, we investigated the secure transmission of THz waves in the indoor environment against randomly distributed eavesdroppers. We established the PLS model for this THz communication system, where Bob's channel is featured by a highly directive beam while Eve's channel scatters THz waves. Particularly, we characterize both channels with stochastic small-scale fading in order to accommodate the random variation in practice such as scattering on aerosols or the movement of objects. The security performance of traditional beamforming and AN beamforming in both non-colluding and colluding cases are analyzed by deriving the STP and ESC. Based on our analysis, we reveal that Eves can indeed take different strategies to degrade the secrecy performance, for instance, by changing the size or the distance of the scatter and increasing the density. To deal with this issue, an AN beamforming technique with a well-designed power allocation can be an effective candidate to counterbalance this adverse effect. Our study can not only serve as an inspiration for eavesdropping scenes but also for a widespread network scenario. Future work may extend this point-to-point communication scene to an indoor THz wireless local area networks (WLANs) which seem more appealing.

**Author Contributions:** Design, fabrication, and data analysis, Y.H. and X.Y.; software, Y.H. and L.Z., writing—original draft preparation, Y.H.; writing—review and editing, S.L. and H.Z.; supervision, X.Y. All authors have read and agreed to the published version of the manuscript.

**Funding:** This work was supported by the National Key Research and Development Program of China (2020YFB1805700), in part by the Natural National Science Foundation of China under Grant 62101483, in part by the Natural Science Foundation of Zhejiang Province under Grant LQ21F010015, the Fundamental Research Funds for the Zhejiang Lab (no. 2020LC0AD01), the State Key Laboratory of Advanced Optical Communication Systems and Networks of Shanghai Jiao Tong University and in part by Zhejiang Lab (NO. 2020LC0AA03).

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

### **Appendix A**

When the incident field *Ei* strikes the surface of PEC, it provokes surface current *JZ* on PEC, which in turn generates a scattered field *Es* which is given by:

$$E\_s(\rho) = -\frac{k\eta\_0}{4} \int\_{\mathcal{C}} J\_Z(\rho') H\_0^{(2)}(k|\rho - \rho'|) dS',\tag{A1}$$

where *<sup>ρ</sup>* is the field point on the plane, *<sup>ρ</sup>* is the source point on the surface and *<sup>H</sup>*(2) <sup>0</sup> is the Hankel function of the second kind of zero order. The integral in Equation (A1) is along the surface *C* which is divided into *NC* segments. According to the property of PEC, the incident field of segment *n Ei*(*ρ <sup>n</sup>*) is given by:

$$E\_i(\rho'\_{\;\;n}) = -\frac{k\eta\_0}{4} \Sigma\_{m=1}^N I\_Z(\rho\_m \;') H\_0^{(2)}(k|\rho'\_{\;\;n} - \rho\_m \;'|) \Delta \mathbb{C}\_{m\nu} \tag{A2}$$

where *ρ <sup>n</sup>*, *ρ <sup>m</sup>* is, respectively, the midpoint of segment *n* and *m* and Δ*Cm* is the length of segment *m*. By applying Equation (A2) to all the segments, there are totally *NC* equations and all the equations can be cast in matrix form as:

$$
\begin{bmatrix} E\_i(\rho'\_1) \\ \cdots \\ E\_i(\rho'\_{N\_\mathbb{C}}) \end{bmatrix} = \begin{bmatrix} A\_{11} & \cdots & A\_{1N\_\mathbb{C}} \\ \cdots & \cdots & \cdots \\ A\_{N\_\mathbb{C}1} & \cdots & A\_{N\_\mathbb{C}N\_\mathbb{C}} \end{bmatrix} \begin{bmatrix} J(\rho'\_1) \\ \cdots \\ J(\rho'\_{N\_\mathbb{C}}) \end{bmatrix} \tag{A3}
$$

where the elements of impedance matrix **A** are influenced by the PEC itself and the incident field of segment *n Ei*(*ρ <sup>n</sup>*) is also given by *Ei*(*ρ <sup>n</sup>*) = <sup>2</sup>*η*0*PGt*/4*πD*<sup>2</sup> *<sup>n</sup>*, where *Dn* = *d*<sup>3</sup> + *acosθ<sup>n</sup>* is the distance between Alice and the segment *n*. Finally, we can calculate the scatter field *Es* by substituting *Ei*(*ρ <sup>n</sup>*) and Equation (A3) into Equation (A2):

$$\begin{split} E\_s(\rho) &= \frac{-k\eta\_0}{4} \begin{bmatrix} H\_0^{(2)}(k|\rho-\rho'\_1|) \Delta \mathbf{C}\_1 \\ \cdots \\ H\_0^{(2)}(k|\rho-\rho'\_{N\_\mathbb{C}}|) \Delta \mathbf{C}\_{N\_\mathbb{C}} \end{bmatrix}^T \mathbf{A}^{-1} \begin{bmatrix} E\_i(\rho'\_1) \\ \cdots \\ E\_i(\rho'\_{N\_\mathbb{C}}) \end{bmatrix} \\ &\stackrel{(e)}{=} \frac{-k\eta\_0}{4\pi} \sqrt{\frac{\eta\_0 P \mathbf{G}\_t}{k d\_2}} \exp\{-j(k d\_2 - \frac{\pi}{4})\} \mathbf{C}^T \mathbf{A}^{-1} \mathbf{D}, \end{split} \tag{A4}$$

where **C** = [Δ*C*<sup>1</sup> ··· Δ*CNC* ], **D** = [1/*D*<sup>1</sup> ··· Δ1/*DNC* ] *<sup>T</sup>*, (e) holds for *kd*<sup>2</sup> 1 in the THz band so that approximations can be made with |*ρ* − *ρ* | ≈ *d*2.
