Cryptographic applications using Artificial Neural Networks (ANN)

Ankita Kokkera
DataX Journal
Published in
7 min readJul 19, 2020

There are two kinds of cryptography in this world: cryptography that will stop your kid sister from reading your files, and cryptography that will stop major governments from reading your files. — Bruce Schneie

What exactly is Artificial Neural Networks (ANN)?

In the past years, the best-performing artificial-intelligence systems — such as the speech recognizers on smartphones or Google’s latest automatic translator, have resulted from a technique called “Deep Learning.”

Deep learning is a new name for an approach to artificial intelligence called neural networks, which have been going in and out of fashion for more than 70 years. A neural network is a series of algorithms that endeavors to recognize underlying relationships in a set of data through a process that mimics the way the human brain operates. It can perform complex computations with ease.

With their remarkable ability to derive meaning from complicated data, it can be used to extract patterns and detect trends that are too complex to be noticed by either humans or other computer techniques. Some advantages include:

  1. Adaptive learning: An ability to learn how to do tasks based on the data given for training or initial experience.
  2. Self-Organization: An ANN can create its organization or representation of the information it receives during learning time.
  3. Real-Time Operation: ANN computations may be carried out in parallel, and special hardware devices are being designed and manufactured which take advantage of this capability.
Structure of a neural network

There are different types of ANN:

1. Recurrent Neural Network
2. General regression neural network
3. Chaotic Neural Network
4. Multilayer Network
5. Neural cryptography

The behavior of an ANN depends on both the weights and the input-output function (threshold function) that is specified for the units.

Cryptography

It is the science of writing in secret code and is an ancient art;

Out of many aspects of security and applications, ranging from secure commerce and payments to private communications and protecting passwords, one essential aspect for secure communications is that of cryptography.

It is a method of protecting information and communications through the use of codes, so that only those for whom the information is intended can read and process it. In computer science, it refers to secure information and communication techniques derived from mathematical concepts and a set of rule-based calculations called algorithms, to transform messages in ways that are hard to decipher.

It has two types of encryption data: Symmetrical encryption and Asymmetrical encryption.

Symmetrical encryption

Symmetrical encryption uses the same key for encryption and decryption process and it defines secret-keys, shared keys, and private keys.

Asymmetric encryption

Asymmetric encryption uses different keys for encryption and decryption processes. It has a pair of keys one for encryption and one for decryption.

Applications of Neural Networks

Sequential Machine

A sequential machine is a device in which the output depends in some systematic way on variables other than the immediate inputs to the device. These other variables are called the state variables for the machine, and depend on the history or state of the machine.

The output of the sequential machine depends on the state of the machine as well as the input given to the sequential machine. Therefore we have to use a Jordan network in which a few outputs are used as inputs, these outputs denote the states.

Cryptography Using Sequential Machine

For a sequential Machine, the output depends on the input as well as the state of the machine. Thus a sequential machine can be used in cryptography where the input data stream is the input to the sequential machine and the state determines the output-input relationship.

Combinational Logic

A combinational circuit is one for which the output value is determined solely by the values of the inputs. A combinational circuit consists of input variables, output variables, logic gates and interconnections. The interconnected logic gates accept signals from the inputs and generate signals at the output.

Block Diagram of Sequential Circuit

Many neural network designers are often curious about the capacity of a neural network. If they can know more about the capacity of neural networks, they would have an easier time deciding what neural network architecture to use as well as how many hidden neurons are needed for a neural network to perform a given function.

Implementation

Jordan Network

In the Jordan network, the activation values of the output units are fed back into the input layer through a set of extra input units called the state units. There are as many state units as there are output units in the network. The context units in a Jordan network are also referred to as the state layer and they have a recurrent connection to themselves with no other nodes on this connection.

The mathematical model of the Jordan networks is governed by the following system of equations:

For the implementation of the sequential machine the state table is used as input and the outputs, as well as the next states, are used as the combined output for the Jordan network. Depending upon the size of the data set the size of the hidden layer is changed as the complexity of the sequential machine increases.

In sequential logic two implementations are done namely:

1. Serial Adder
2. Sequence detector

Cryptography Using ANN-based Sequential Machine

A sequential machine using a Jordan network has been implemented using the back-propagation algorithm. For use of a sequential machine for encryption and decryption, a state diagram is drawn and a state table is obtained. Using the state table, a training set is generated. The input set includes all the possible inputs and states possible whereas the output consists of the encrypted/decrypted output and the next state.

Letters A to H were used to represent all the possible 3-bit inputs. If the state is 0, the input letter is shifted by one to generate the encrypted letter while if the state is 1, the letter is shifted by 2. During this operation, the state is automatically switched.

Output using sequential machine-based Encryption

It shows the implementation of the above method. The word “AHFGAGHCBDE” is to be encrypted using the starting state of ‘1.’ The output in this case will be “CAHHCHBDDEG.”

Cryptography using a chaotic neural network

A chaotic network is a neural network whose weights depend on a chaotic sequence. The chaotic sequence highly depends upon the initial conditions and the parameters, x(0) = 0.75 and μ = 3.9 are set. It is very difficult to decrypt an encrypted data correctly by making an exhaustive search without knowing x(0) and μ.

Output using chaotic neural network-based Encryption

Here a sequence of ten numbers is used for encryption and the initial parameters for the chaotic network are used as mentioned. The output or the encrypted data is then used for decryption. It can easily be seen that the output is in a chaotic state.

Conclusion

Artificial Neural Networks is a simple yet powerful technique that can emulate highly complex computational machines. This technique has been used to built simple combinational logic and sequential machine using a back-propagation algorithm. ANNs can be used to implement much complex combinational as well as sequential circuits.

Data security is a prime concern in data communication systems. The use of ANN in the field of Cryptography is investigated using two methods. A sequential machine-based method for encryption of data is designed. Also, a chaotic neural network for digital signal cryptography is analyzed. Better results can be achieved by the improvement of code or by the use of better training algorithms. Thus, Artificial Neural Network can be used as a new method of encryption and decryption of data.

Thanks for reading!! If you like it, leave a clap!

--

--