## 2 Overview
### Artificial Neural Networks
#### 2.2.2 TPMs in Cryptography  
The characteristics of TPMs make them suitable for the implementation of the neural key exchange protocol proposed in [34]. Although the term \"neuro-cryptography\" has been introduced first in [35] in the context of using a model of perceptrons with back-propagation of the gradient, the term \"neural cryptography\" is most widely used for TPM applications in cryptography. This term for the neural key exchange protocol implemented with TPMs has been described in [36]. In this protocol, the communicating parties start with a random key, which is used as weights of the TPM. Using a channel that does not need to be secure, they begin to exchange input vectors (in the form of K random vectors of length N) for their machines. Depending on the outputs, they either update the weights (if the \(\tau\) values are equal) or change the input vector (if the values differ). The process is repeated until both weight vectors are synchronized. An example formula for verifying synchronization has been provided in [37]. There are multiple learning rules used in neural cryptography. The most popular are [33]: the hebbian rule (see Equation (4)), the anti-hebbian rule (see Equation (5)) and the random walk rule (see Equation (6)). \[w_{kn}^{*}=w_{kn}+x_{kn}*\sigma_{k}*\Theta(\sigma_{k},\tau), \tag{4}\]  
\[w_{kn}^{*}=w_{kn}-x_{kn}*\sigma_{k}*\Theta(\sigma_{k},\tau), \tag{5}\]  
\[w_{kn}^{*}=w_{kn}+x_{kn}*\Theta(\sigma_{k},\  
Furthermore, to ensure that the updated weights do not exceed the [\(-\)L;L] interval, invalid values can be corrected with a function similar to the one presented in Equation (8) [23]. \[v_{L}(w_{\text{kn}})=\left\{ \begin{array}{ll}-L&\text{if }w_{\text{kn}}\leq-L\\ w_{\text{kn}}&\text{if }-L<w_{\text{kn}}<L\\ L&\text{if }w_{\text{kn}}\geq L\end{array} \right.. \tag{8}\]  
The benefit of neural cryptography is that the secret key is never transferred, even in small parts, through the public channel. Additionally, if the attacker has no knowledge of the TPM parameters (K, N, L, and the update rule), there are no feasible methods of attack apart from setting up multiple TPMs. Unfortunately, if the attacker has sufficient resources and establishes multiple learning networks (for example, in a genetic attack [33]), they still have a reasonable chance of success if the parameter values are not large enough. On the other hand, both parties in the communication process must know the parameters of the TPM, and if these are transmitted through an open channel, the attacker can set up one or more machines with the same parameter values, increasing their chances of obtaining the secret key. When considering an eavesdropping attack with a single TPM, even though all three machines may start from a random vector, the attacker's synchronization is always slower than the synchronization between the sender and receiver. This is because there are only three possible events during the synchronization process [23]. * \(\tau_{s}\
eq\tau_{r}\)-in this case, \(\tau_{a}\) does not matter, as the sender and receiver do not update their weights. * \(\tau_{s}=\tau_{r}\
eq\tau_{a}\)-in this case, the sender and receiver update their weights, but the attacker does not. * \(\tau_{s}=\tau_{r}=\tau_{a}\)-this is the only case in which the attacker's weights are updated. In other words, the attacker's output must be equal to both the sender's and receiver's outputs (which means that these two values must also be equal) for the attacker to perform an update of the weights. This implies that the attacker's machine synchronizes slower than the other two machines, as there is no possibility of the attacker's update without the sender and receiver updating at the same time. This attack may have a better chance of success if there are multiple attacking TPMs, but security can be improved by increasing the L value [33].