# Graph Layer Security: Encrypting Information via Common Networked Physics
## 3 GLS Encryption Using Physical Networked Dynamic  
Given the modelling of Equations (1) and (2), the purpose of this work is to encrypt the wireless communications of any node pair, using the underlying physical dynamics of the graph layer. The illustration of the GLS is provided by Figure 1. Before the start, the nodes need to extract their underlying physical dynamics for further encryption and communication process. For any node \(n\) to act as the Tx, we encrypt the desirable information **s** (a time-series of length \(L\)) via the physical networked dynamic on node \(n\), denoted as \(\textbf{X}_{n,:}\), i.e.,  
\[\textbf{s}^{*}=\textbf{s}+\textbf{X}_{n,:}, \tag{3}\]  
where \(\textbf{s}^{*}\) is the encrypted information to be transmitted. As aforementioned, the networked dynamic \(\textbf{X}_{n,:}\) is the time-varying networked signals under node \(n\) (e.g., the electricity flows of the smart grid system, or a time-varying compound concentrations in the water distribution network).  
After the information encryption using Equation (3) at Tx node, it will then be transmitted and processed via a group of selected relays and their dynamics (e.g., R1 and R2 in Figure 1b). At the final Rx node, the encrypted information will be received and decrypted. As such, for the wireless communication between any node pair, i.e., (Tx,Rx) = \((n,m)\), the idea of encryption and encryption is leveraging the linear dependency of the underlying physical dynamics in Tx, relays, and Rx nodes, i.e.,  
\[\textbf{X}_{n,:}+\sum_{i=1}^{i_{r}}\alpha_{i}^{(m,n)}\cdot\textbf{X}_{i,:}+ \textbf{X}_{m,:}=\textbf{0}. \tag{4}\]In Equation (4), \(i_{1},\cdots i_{r}\) are the selected relay nodes, and \(\alpha_{i}^{(m,n)}\) is the corresponding coefficient that will be determined in advance (we will discuss this in Section 3.2). As such, \(\mathbf{s}^{*}\) can be transmitted via the selected relay nodes \(i_{1},\cdots,i_{r}\), each of which processes the received information via \(\alpha_{i}\cdot\mathbf{X}_{i,:}\), and transmits the processed information to the next relay. Finally, Rx node \(m\) decrypts the received information via \(\mathbf{X}_{m,:}\) and derives the decrypted information \(\mathbf{\hat{s}}\), i.e.,  
\[\mathbf{\hat{s}} =\mathbf{s}^{*}+\sum_{i=i_{1}}^{i_{r}}\alpha_{i}^{(m,n)}\cdot \mathbf{X}_{i_{i,}}+\mathbf{X}_{m,:} \tag{5}\] \[=\mathbf{s}+\left(\mathbf{X}_{n,:}+\sum_{i=i_{1}}^{i_{r}}\alpha_{ i}^{(m,n)}\cdot\mathbf{X}_{i_{i,}}+\mathbf{X}_{m,:}\right)\] \[=\mathbf{s}.\]  
From Equations (3)-(5), it is seen that the essence of the proposed GLS is to use the channel-irrelevant networked dynamics on each node as the additive noise for security guarantees. Attributed to the dependencies of dynamics on different nodes, such additive noise can be compensated step-by-step by the corresponding relay nodes and the Rx node, whereby \(\mathbf{\alpha}^{(\text{Tx},\text{Rx})}=[\alpha_{i_{1}}^{(\text{Tx},\text{Rx })},\cdots,\alpha_{i_{r}}^{(\text{Tx},\text{Rx})}]^{T}\) accounts for the dependency coefficients. As such, to ensure the secure communication between any \((\text{Tx},\text{Rx})\in\mathcal{N}^{2}\) node pair, each node \(i\) should save a dependency coefficient matrix of size \(N\times N\), in which the \((m,n)th\) element is \(\alpha_{i}^{(m,n)}\) representing its contribution to compensate the underlying dynamics of \((\text{Tx},\text{Rx})=(m,n)\) pair. In the following, we will elaborate an off-line data-driven computation of the dependency coefficients, which avoids the use of the real-time networked dynamic for encryption, but is able to capture the networked dynamic dependency from the simulated training data.