Optimal Element Allocation for RIS-Aided Physical Layer Security

In this paper, we investigate an innovative physical layer security (PLS) scheme for an uncertain recon ﬁ gurable intelligent surface-(RIS-) assisted communication system under eavesdropping attack. Speci ﬁ cally, in our proposed system, we consider that the uncertain RIS is known to the legitimate user while not to the eavesdropper (Eve). In this manner, the re ﬂ ective elements of the uncertain RIS are adjusted to strengthen the keen signals for the legitimate user while suppressing the signals for Eve via jamming. We analyze the system by assuming legitimate and wiretap channels, respectively, where the secrecy capacity maximization problem is formulated and its exact closed-form expression is derived. Simulation results verifying the accuracy of our analysis demonstrate the validity and superiority of the uncertain RIS-assisted communication system against its counterparts.


Introduction
Due to the fast development of the mobile communication network, the continuous emergence of new services, and the fulminic growth of information interaction, the fifthgeneration (5G) wireless communications are anticipated to provide massive data transmissions and wide-area coverage as a new type of communication network [1]. For the upcoming applications of 5G, future wireless communication systems are anticipated to support more efficient, lower latency, more reliable, and secure designs. With the rapid evolution of science, lots of technologies have been implemented in 5G communication network to satisfy its diverse application scenarios, e.g., multiple access technology [2], deep learning (DL) [3], and beamforming [4]. Meanwhile, due to the explosive growth of information dissemination and massive information interaction, public communication networks and private communication networks are often mixed, which makes information security issues more important [5].
Physical layer security (PLS) enhancement has aroused extensive attentions in both industry and academia thanks to its superb capability of light-weight authentication on received signals against eavesdropping attacks [6]. Since the PLS takes advantage of the natural peculiarities and physical properties of propagation environment to promote the security performance of 5G communication network and secure the data transmission, it has attracted extensive attention in the academia and industry circles [7]. Several dimensions of designing PLS schemes have been identified in the literature, via nonorthogonal multiple access (NOMA) [8], artificial noise (AN), and cooperative interference [9]. Although effective, they may consume extra power and/or incur additional hardware cost, thus forming significant barriers in the real implementations.
Fortunately, with the rapid evolution of metamaterial technology, a low cost and energy efficient device named reconfigurable intelligent surface (RIS) offers an available way to strengthen the PLS [10]. The RIS is an artificial electromagnetic surface consisting a great many cheap passive reflecting elements governed by a preprogrammed controller, which can skillfully change the amplitude and/or phase shift of arriving galvanomagnetic signals to make the direction and strength of the signal greatly controllable at the destination. Thus, the RIS cannot only strengthen the required signals and restrain the undesirable signals by befittingly tuning the phase shifts of all reflecting components but also effectively improves the radio transmission environment leading to the random channel state information (CSI) controllable [11,12]. Therefore, it can be anticipated that the RIS will occupy an important position in the 5G wireless communication network [13].
With such characteristics, RIS has recently been considered to enable the PLS of wireless communication system to promote the secrecy capacity [14][15][16][17][18]. In [14], the minimum secrecy rate maximization problem of one downlink multiple-input singleoutput (MISO) broadcasting communication model was formulated and optimized via alternating optimization (AO) and path tracing algorithm. The authors in [15] introduced an RIS-based secure transmission framework aiming to obtain the minimum value of its communication network energy consumption within the scenarios of two different access point-(AP-) RIS channel models. In [16], the joint optimization of transmitter beamforming and RIS phase shifts by block coordinate descending (BCD) and majorization-minimization (MM) methods was studied to maximize the system security capacity for the secure wireless communication assisted with RIS. Cui et al. [17] considered a stronger eavesdropping channel than the legal one, where the AO and semidefinite relaxation (SDR) algorithms were explored to derive the maximum value of the security capacity in the secure wireless communication system. Wang et al. [18] investigated an RIS-aided MISO communication network with the unknown eavesdropping CSI, where the oblique manifold (OM) and MM algorithms were designed to promote the security of the communication network.
Note that the above mentioned studies [14][15][16][17][18] simply focused their attention on one function of RIS, i.e., enhancing or jamming, but the unknown situation of RIS was not considered. This paper investigates RIS-assisted secure wireless communication with the main contributions listed as follows: (i) We propose a novel PLS communication system with an uncertain RIS aiming to enhance the secrecy rate, where the components of RIS are separated into two functional parts, one assisting the legitimate user and the other suppressing the achievable rate of eavesdropper as a jammer.
(ii) The optimal result of elements allocation for RIS is analyzed, and its exact closed-form expression is concluded to confirm the superiority of our proposed scheme.
(iii) Numerical results verifying the correctness of the derived expression show the advantage and validity of the designed scheme compared with its counterparts, especially under a great many reflecting elements.

System Model
An uncertain RIS-assisted secure communication system is considered, which consists of a source (S), a legitimate user (B), an eavesdropper (Eve), and an RIS, as depicted in Figure 1. To improve the secure wireless communication, the RIS with N reflecting elements is placed near by S, B, and Eve which are equipped with a single antenna. For the uncertain RIS, the size of each element is considered a lot smaller than the wavelength of RF signals resulting in that the reflecting element scatters the received signal in whole directions with approximately constant gain [19], and the phase shift of each passive units is controlled dynamically by RIS via an intelligent controller. It is also supposed that both S and B have the knowledge of the location information of RIS, while Eve is unable to acquire the location information of RIS, and that the CSI of the uncertain RIS is entirely known to S and B, but not for the Eve. The direct links of S ⟶ B and S ⟶ Eve are considered, which are expressed by h SB ∈ ℂ and h SE ∈ ℂ, respectively. Considering that the number of components is fixed to N, we divide the surface of RIS into two sectors, in which the one with η elements is used to serve as a jammer to Eve and the other with ðN − ηÞ elements is applied to promote the information signals from S to B via high-quality virtual links. The source transmits the signal to legitimate user via the RIS to promote the information transmission for the legitimate user, and the channel coefficients of the links S ⟶ RIS and RIS ⟶ B are expressed by h SR 1 ∈ ℂ η×1 and h R 1 B ∈ ℂ η×1 , respectively. Since the eavesdropper attempts to wiretap the signal from S, it is assumed that the eavesdropper does not know the location of RIS, and hence, the reflected signals from RIS will be treated as jamming signals for the Eve, with the available links S ⟶ RIS and RIS ⟶ Eve denoted as h SR 2 ∈ ℂ ðN−ηÞ×1 and h R 2 E ∈ ℂ ðN−ηÞ×1 , respectively. Furthermore, it is assumed that each channel of the system follows independent Rayleigh fading distribution. Thus, the received signals at B and Eve are separately expressed as where s and P mean the data symbol and the transmit power for S and E½jsj 2 = 1. Θ 1 = α diag ðe jψ 1 ,⋯,e jψ N−η Þ and α ∈ ð0, 1 stand for the channel coefficient matrix of the RIS sector serving B and the amplitude of the reflection coefficient, where α = 1 represents the lossless reflection; ψ i ∈ ½0, 2πÞ is the phase-shift produced by the i-th element for i = 1, ⋯, N − η. Θ 2 = α diag ðe jϕ 1 ,⋯,e jϕ η Þ stands for the channel coefficients matrix of the RIS sector allocated for Eve, ϕ j ∈ ½0, 2πÞ is the phase-shift produced by the j-th element for j = 1, ⋯, η. In addition, n 1 and n 2~C N ð0, σ 2 Þ are the additive white Gaussian noise (AWGN). Since the signal from RIS will be treated as interference by the Eve because of the unknown CSI of RIS, the achievable SNR at B and SINR at Eve can be, respectively, obtained from

Wireless Communications and Mobile Computing
For any given Θ 1 and Θ 2 , the data rate expressions for B and Eve can be achieved from the Shannon theory as From above observations, the secrecy capacity (SC) in our proposed scheme can be expressed as where ½x + = max ð0, xÞ. Considering that the deterministic channels for B and Eve are fully known for S, with the optimized phase shift variables, the SC optimization of the proposed uncertain RIS-assisted communication system is formulated as Clearly, it is quite challenging to solve this optimization problem straightforwardly. Thus, we turn to analyze its security performance with optimal elements allocation and derive the corresponding optimal solutions.

Performance Analysis
In the section, the optimization problem of maximizing SC for the proposed system is analyzed under the optimal elements allocation of RIS, and then we derive the optimal solution for such problem. Since the maximum SC must be nonnegative, the ½· + operation can be omitted without loss of optimality. With the monotonic function logð·Þ, the objective function in P 1 is reexpressed as For simplicity, the reflective passive beamforming with perfect CSI of RIS is taken into account, and we also assume entire elements of the RIS are with the same reflection amplitude [20]. Thus, we have h H In the case that S knows the CSI of all channels completely, the optimal reflection phase shift can be obtained through channels. In addition, the optimal phase shift can be derived via the proposition as follows. Proposition 1. The optimal RIS phase shift of the communication network is expressed as As a result, the maximum achievable SNR can be obtained if the phase shifts satisfy ψ i = arg ðh SB Þ − arg ð½h SR 1 i ½h R 1 B i Þ and ϕ j = arg ðh SE Þ − arg ð½h SR 2 j ½h R 2 E j Þ, which means that the cascaded links via RIS are with the same phase as the corresponding direct links [21]. Therefore, we have From Equations (10) and (11), it is easy to see that the SNR of B and SINR of Eve only rely on the amplitudes of the reflective elements, not on their phases. Therefore, we can reformulate the optimization problem as Clearly, P 2 is nonconvex and hard to obtain its optimal result. Therefore, we turn to derive its closed form in an approximate way. Assuming the equivalent size for each RIS element, thus, it follows that all elements in h SR , h R 1 B , and h RE have the same magnitude, respectively. For brevity, we  [22]. It is known that, for a small number of components, the channel gain provided by RIS should be smaller than that of the direct channel. However, as the amount of reflective components grows, the channel gain provided by RIS significantly improves and becomes much larger than that of direct channel. Then, we can reformulate Equations (10) and (11) in the more compact forms as Since γ B ≫ 1, letting 1 + γ B ≈ γ B and with Equations (13) and (14), the secrecy capacity maximization problem can be obtained from where . Since the term P/σ 2 has no influence on solving the optimization problem in Equation (15) and the approximation Pα 2 SE + σ 2 E ≈ Pα 2 SE holds due to Pα 2 SE ≫ σ 2 E , the above maximization problem can be simplified as Since the function in Equation (16) is continuous, we can derive the following expression by its first-derivations as It is quite difficult to analyze its trend directly from the above formula; then, the second-derivation is derived and simplified as Through the positive and negative judgment in Equation (18), we can acquire the monotonicity of the first-derivation expression and further determine whether it has a zero point in the value range. For simplicity let Due to the positive characteristic of 2/ðα 2 SE + α 2 RE η 2 Þ 3 , Equation (18) can be simplified as Clearly, G 1 ðηÞ, G 2 ðηÞ, and G 3 ðηÞ are monotonically decreasing with η, where G 1 ð0Þ > 0, G 1 ðNÞ < 0, G 2 ð0Þ > 0, G 2 ðNÞ < 0, and G 3 ðηÞ are always smaller than 0 with the increase of η. Therefore, one can conclude that G 1 ðηÞ and G 2 ðηÞ have 4 Wireless Communications and Mobile Computing zero points in their effective domain, which are denoted by ξ 1 and ξ 2 , respectively. For the sake of illustration, letting ξ 1 < ξ 2 , we have >0, for ξ 2 ≤ η ≤ N: Since G 3 ðηÞ is always smaller than 0 with the increase of η, it can be regarded as a constant and has no effect on the trend of G 1 ðηÞG 2 ðηÞ, but it determines their zero points. According to Equation (18), ∂ 2 RðηÞ/∂η 2 j η=0 = 0. However, the positive or negative of Equation (18) cannot be determined; thus we discuss each case separately. For the case ∂ 2 RðηÞ/∂η 2 j η=N > 0, the monotonicity of Equation (18) is similar to that of G 1 ðηÞG 2 ðηÞ . However, when ∂ 2 RðηÞ/∂η 2 j η=N < 0, the zero point of Equation (18) denoted by ζ exists, and hence, we can conclude Through observing the positive and negative of ∂ 2 RðηÞ/∂ η 2 , we know that the first-derivation of RðηÞ tends to increase and then decreases and then maybe increase again with the increase of η, where ∂RðηÞ/∂ηj η=0 = 0 and ∂RðηÞ/∂ηj η=N < 0. Therefore, there exists a maximum value of the secrecy rate for the formulated optimization problem, within the scope of its first derivative in solving extreme result. Thus, we can derive the optimal solution by calculating the equation of ∂R ðηÞ/∂η = 0, and the maximum secrecy capacity is also determined. Letting ∂RðηÞ/∂η = 0, the objective function can be simplified as Since α RB α 2 RE ≠ 0, we can eliminate the coefficient of the first term in Equation (22) and obtain the following equation: Clearly, Equation (23) is a special cubic equation, which can be solved by the Cardano formula method. From Equation (23), we can find that α 2 SE /α 2 RE ≥ 0 and α 2 SE /α RB α 2 RE ðα SB + N α RB Þ ≥ 0, it can be converted into the form of where p = 2α 2 SE /3α 2 RE and q = −α 2 SE /α RB α 2 RE ðα SB + Nα RB Þ. In addition, due to p ≠ 0 and q ≠ 0, letting η = u + v, we have Comparing the coefficients of Equations (24) and (25) and after some mathematical manipulations, we can obtain According to q 2 + ð4p 3 /27Þ > 0, u 3 and v 3 are two roots of the equation x 2 + qx − ðp/3Þ 3 = 0, which can be found by the root formula; the corresponding closed-form expressions can be obtained from In this manner, the optimal solution of Equation (15) can be finally expressed as where d·e is the ceiling function. Thus, from the closed-form expression of η * , N − η * can thus be obtained as the optimal number of elements allocated for serving B.

Numerical Result Comparison
In the section, we validate the expression of the analysis and evaluate the performance of our considered system with the assistance of the uncertain RIS via simulation results. All links in the system are assumed to follow independent Rayleigh fading with the path loss exponent of 2.2, and the noise variance is -94 dBm. For simplicity, the following node locations are considered: ðx S , y S Þ = ð0, 0Þ, ðx R , y R Þ = ð40, 10Þ, ð x B , y B Þ = ð50, 0Þ, and ðx E , y E Þ = ð45,−5Þ. Figure 2 illustrates the variation of achieved rate as the number of elements for Eve with the fixed transmit power P = 1W varies, and the total number of elements is set to 1,000. The achievable rates of B and Eve are decreasing when the number of the elements for Eve increases, as shown in the figure. However, the achievable rate at Eve decreases significantly than that of the one at B. It also illustrates that the achievable secrecy rate is first increasing and then decreasing with an increasing number of elements for Eve. Thus, there exits an optimal value of elements for B and Eve as the result of 10.0392 bps/Hz. Through observation, it is known that 450 is the optimal value in the simulation results which are equal to the optimal value obtained from our analysis in Equation (28).
In Figure 3, we compare different schemes of elements allocation versus the transmit power with the power from 1 W to 30 W. By means of the simulation, we compare several models including the proposed scheme, all elements of RIS to enhance secure communication at B, all elements of RIS to interfere Eve, and the model without RIS. For the system without RIS, its achievable secrecy rate is 0 since the 5 Wireless Communications and Mobile Computing achievable rate at Eve is higher than that at B. And when all the components of RIS are used to improve the legitimate communication, the secrecy rate is determined by the CSI instead of the transmission power of base station; thus, the secrecy rate keeps constant under varying transmit power. The achievable secrecy capacity for our considered scheme and the one that all elements to interfere Eve monotonically increase with the increasing transmit power, and our proposed scheme achieves better results. Moreover, it also verifies that our proposed scheme has a higher secrecy capacity than other schemes, which makes it superior compared with than other schemes. Figure 4 demonstrates the variation of achievable secrecy rate with total number of elements for RIS, in which N is set to be 500, 1,000, and 1,500. According to the figure, the achievable secrecy capacity is increasing as the transmit power increases. In addition, it reveals that the secrecy rate in the uncertain RIS-assisted communication network increases with an increasing number of components.

Conclusions
This paper investigated uncertain RIS-assisted PLS, with the presence of an eavesdropper. The uncertain RIS can enhance the signal for the legitimate user while jamming the eavesdropper by separating the components of RIS into two functional sections. The optimal element allocation and achievable secrecy rate can be obtained in their closed forms by solving the formulated problem. Numerical results verifying the accuracy of the derived expression show the advantage of our considered scheme compared with its counterparts.

Data Availability
The simulation data used to support the findings of this study are available from the author upon request, who can be contacted at 2010310034@stmail.ntu.edu.cn    Wireless Communications and Mobile Computing