# Protecting Private Communications in Cyber-Physical Systems through Physical Unclonable Functions
## 3 Proposed Encryption Scheme
### Encryption Mechanism  
Any existing or new symmetric encryption algorithm could be integrated in the proposed architecture. However, devices in CPSs tend to be resource constrained and, then, computationally low-cost algorithms are preferred. Thus, in this work we propose the use of the XOR (Exclusive OR) encryption. The XOR operation is also employed in some existing encryption solutions such as the Vernam cipher [37] or the one-time pad [38]. However, these mechanisms include some other configurations (such as the key structure or the data format) which are not valid in our proposal. Thus, we are referring the basic encryption technology supporting all these schemes: XOR operation. This encryption scheme may be easily implemented using a logic gate, and the obtained security level is sufficiently high. Mathematical evaluations can prove this result depends on the randomness of the key stream. In fact, XOR-based encryption presents some vulnerabilities (such as the known-plaintext attack), but most of them are addressed below with the appropriate key generator and, in any case, the balance between the reached security level and the lightweight implementation in XOR encryption is adequate for CPSs [39]. Mathematically, the XOR encryption process may be represented by a simple binary operation (4). The XOR gate receives two data streams to perform the encryption. For this model, information signal \(m[n]\) is composed of \(N\) bit samples. In that way, \(m[n]\) takes values in the range \(\left\{0,\ldots,2^{N}-1\right\}\). Figure 2 represents the encryption scheme. \[e[n]=m[n]\oplus k[n] \tag{4}\]  
Then, if the employed key stream \(k[n]\) is a flow of random numbers, the resulting encrypted signal \(e[n]\) has a discrete probability density function equal to the probability function describing the behavior of the key stream \(k[n]\). In particular, all possible values have the same probability. Hereinafter, \(P(\cdot)\) is the probability operator and \(P(\cdot\mid\cdot)\) the conditional probability operator. \[P(k[n]=\xi_{i})=P(e[n]=\xi_{i})=\varphi_{1}=\frac{1}{2^{N}}\ \ \ \forall\xi_{i} \tag{5}\]Then, because of the structure of the XOR truth table, a known value from the encrypted signal \(e[n]\) of all possible values in the range of the information signal \(m[n]\) have the same probability of having generated that encrypted sample (6). \[P\big{(}m[n]=\xi_{j}\bigm{|}e[n]=\xi_{i}\big{)}=\varphi_{2}=\frac{1}{2^{N}}\ \ \ \forall\xi_{i},\xi_{j} \tag{6}\]  
In order to determine how secure the proposed XOR encryption is, we employ [PERSON]'s information theory. The mutual information between the encrypted and the original information flow \(I(m;e)\) represents the residual information that remains in the encrypted signal about the original one (7). Considering expressions (5) and (6), it is easy to obtain this amount is zero; i.e., the encrypted signal does not provide any information about the original signal \(m[n]\). \[I(m;e)=\sum_{i=0}^{2^{N}-1}\sum_{j=0}^{2^{N}-1}P\big{(}m=\xi_{j}\,\ e=\xi_{i} \big{)}\cdot log\left(\frac{P\big{(}m=\xi_{j}\bigm{|}e=\xi_{i}\big{)}}{P(e= \xi_{i})}\right)=0 \tag{7}\]  
This mathematical demonstration is only valid for continuous random key streams. However, random numerical flows are impossible to generate in practice. Then, only pseudorandom number sequences are possible to obtain. Experiments show that a pseudorandom sequence may replace a random flow with some considerations:  
* REQ#1: The pseudorandom sequence (which is periodical) must present a long period; enough to encrypt each information message using only one key period
* REQ#2: The same sequence cannot be employed to encrypt an undefined number of messages. The pseudorandom sequences must be changed each certain operation time. * REQ#3: The algorithm generating the number sequence must be secret. If these conditions are not fulfilled, then, simple cryptanalysis may break the encryption.