# The Dichotomy of Neural Networks and Cryptography: War and Peace
## 4 Peace: Coexistence and Alliance
### Alliance
#### 4.2.1 The Role of NNs in Cryptography  
NNs have been applied to improving several aspects of cryptographic systems from encrypting several data types to key management and generally securing different aspects of cryptographic systems. **Neural Cryptography:**  
Neural cryptography refers to the application of mutual learning, self learning, and stochastic behavior of neural networks as well as similar algorithms in the design, implementation, or evaluation of any cryptographic algorithm, device, system, or scenario. Particularly, neural networks have been used as enablers in the design of several cryptographic mechanisms, which are implemented as individual modules in cryptosystems. This should be considered an important aspect of neural cryptography. * **Key Management:** Neural Cryptography has been applied to key management in many different ways, some have researched its use in concealing keys in Deep NNs [81], while others have researched the use of NN's using tree parity machines as a way to distribute keys of a symmetric encryption system [82]. A more novel approach uses Artificial Spiking NNs (ASNNs) to create keys for a symmetric block cipher algorithm with the ability to use any block size [83]. This method provides no need for key exchange [83]. The environment systems itself uses a semblance of public key cryptography where the public key is the seed used to generate the private key on both sides [83]. Additional approaches to neural cryptography symmetric key exchanges involve using a 3D cube algorithm in order to induce secrets on the receiver side or search guided gravitational neural keys [84, 85]. * **Random Number Generation:** Neural cryptography has guided the verification of Pseudo Random Number Generators (PRNGs) by picking up on statistical biases unknown to humans [86]. This is achieved using neural cryptography to detect the difference between actual output and desired ideal random numbers [86]. The use of neural cryptography for encryption [87] and decryption [88] has received a focus from the research community in recent decades [89, 90, 91]. Different security models have been proposed based on neural cryptography [92] and different kinds of NNs [93] have been used for design and implementation of cryptosystems [94]. This effort has led to the development of different types of neural cryptosystems [94, 95]. In the following, we use the research literature to establish an ecosystem for neural cryptography. This ecosystem consists of applications, enablers, and challenges. * **Applications:** The applications of neural cryptography can be studied in the following lines. * **Encrypting Different Content Types:** Neural cryptography has been successfully tested on different content types, among which one may refer to the following. * **Image:** Regular scrambling-diffusion image encryption suffers from many vulnerabilities [96]. Particularly both the scrambling and diffusion are performed independently meaning an attacker can attack each separately [96]. With neural cryptography this vulnerability can be resolved. More specifically using an algorithm that performs the initial scrambling and diffusion in parallel then a second diffusion from a Hopfield chaotic NN trained [96]. This allows not only for the protection from the aforementioned independent cracking of the scrambling and diffusion steps, but also resists chosen plaintext attacks [96]. Other groups have also implemented parallelization in their neural cryptography encryption algorithms, electing instead to perform these operations using cellular NNs and block encryption to create an algorithm based on the feistel framework [97]. Cellular NNs are being used in all kinds of Image Encryption software, including an encryption scheme that uses the hyper chaotic system sequences of a cellular NN to shuffle around the bit of an image before performing a bit-wise XOR [98]. It is important to note that this method uses asymmetric RSA for key exchanges [98].