Course Code: CSE4003
Course Title: CYBER SECURITY
Slot: A2
Faculty: Prof. Chandra Mohan B.
J-COMPONENT – Final Report
Project Title: Encryption and Decryption Using Neural Network.
Submitted by:
17BCE2300 Shivam Suryas
18BCI0128 Nagesh Shukla
18BCI0159 Rishab Jain
Abstract
The project is aimed to implement deep neural network method in
cryptography. Cryptography is a technique to encrypt simple message into
cipher text for secure transmission over any channel. The training patterns
are observed and analysed by varying the parameters and the hyper
parameters and the number of neurons in the hidden layer.
Using the sequential network, the model is first trained, and one may
obtain the desired result with required accuracy. In this respect,
simulations are shown to validate the proposed model. As such, the
investigation gives an idea to use the trained neural network for encryption
and decryption in cryptography.
MOTIVATION
The rising growth of technology in the communication sector has always
created an increased demand of secure channel for the transmission of
data.
Cryptography has always served as a successful means to build such
channels. These channels find numerous applications, as in mobile phones,
internet, digital watermarking etc. and also for secure transmission
protocols.
There are several encryption-decryption techniques which may be
improvised for a secure transfer of data, like public and private key
cryptosystems.
However, the risk of attack by an intruder is still very high. A novel
approach has been adopted here by applying neural network to
cryptography.
As such, in case of shift ciphers, the transfer of message would not be safe
if the key is public.
Also, in the case of RSA cryptosystem, where two keys are involved which
may be easily retrieved by solving the factor problem, the implementation
of neural network serves as an efficient method.
Introduction
The cryptography deals with building such systems of security of news that
secure any from reading of trespasser. Systems of data privacy are called
the cipher systems. The file of rules are made for encryption of every news
is called the cipher key. Encryption is a process, in which we transform the
open text, e.g. message to cipher text according to rules. Decryption is a
process, in which we retrieve that original form of text by applying some
cryptographic algorithm. The above two process are mostly important two
secure data.
Two major techniques used in encryption are symmetric and asymmetric
encryption. In symmetric encryption, two parties share a single encryption-
decryption key. The sender encrypts the original message (P), which is
referred to as plain text, using a key (K) to generate apparently random
text, referred to as cipher text (C). Now this encrypted or cipher text is sent
to receiver side so that he/she can decipher this text using his/her key(K).
After deciphering he/she can read the original message.
Proposed System
So, for encrypting and decrypting our plain text we are using neural
networks. So, working of neural network is described below:-
In neural cryptography, first plain text is taken and pre-processing
process is applied on that plain text.
Then first neural network is given to that plain text which is being
used to encrypt this plain text.
After this a new cipher text is generated.
Now this cipher text is given to the second neural network for
decryption process.
Now after this decryption, cipher text2 is generated which is
compared with input of first neural network.
Design Of Neural Network
Literature Review
A recent survey of the literature indicates that there has been an increasing
interest in the application of different classes of neural networks to
problems related to cryptography in the past few years. Recent works have
examined the use of neural networks in cryptosystems. This can be
categorized into three sections:
A. Synchronization neural networks
Neural Cryptography, 2003
Wolfgang Kinzel proposed a secret key over a public channel using
artificial neural networks. The artificial neural network contains of two
multi-layer neural networks trained on their mutual output bits and able to
synchronize. The two networks starting from random initial weights and
learning from each other with two multilayer networks relax to the state
with time dependent identical synaptic weights. The partners didn’t
exchange any information over a secret channel before their
communication. Synchronization of neural networks can be considered as
the key generation in cryptography. The common identical weights of the
two partners can be used as a key for encryption. The neural cryptography
is the first algorithm for key generation over public channels which are not
based on number theory. Experimental result shows that the model is fast,
simple, and secures.
A New Security on Neural Cryptography with Queries, 2010
N. Prabakaran proposed a secret key using neural cryptography,
based on synchronization of Tree Parity Machines (TPMs) by mutual
learning. The system has two identical dynamical systems, which starting
from different initial conditions and synchronized by a common input
values which are coupled to the two systems. The networks received a
common input vector after calculating their outputs and updated their
weight vectors according to the match between their mutual outputs in
every time step. The input or output relations are not exchanged through a
public channel until their weight vectors are matching and can be used as a
secret key for encryption and decryption of secret messages. The weight
vectors of the two neural networks begin with random numbers, which are
generated by Pseudo-Random Number Generators (PRNGs). The proposed
model fixed the security against numerical attacks
B. Chaotic Neural network
Cryptography based on delayed chaotic neural networks, 2006
Wenwu Yu proposed an encryption technique based on the chaotic
Hopfield neural networks with time varying delay. The chaotic neural
network is used for generating binary sequences for masking the plaintext.
The binary value of the binary sequence chooses the chaotic logistic map
randomly, that used for generated the binary sequences. The plaintext is
masked by switching of the chaotic neural network maps and permutation
of generated binary sequences. Simulation results show that the proposed
chaotic cryptography is more functional in the secure transmission of large
multi-media files over public data communication network.
A triple-key chaotic neural network for cryptography in image processing,
2012
Shweta B. presented a triple key chaotic neural network for image
cryptography. The triple parameters are used to perform the various
operations on image so as to scramble the data in particular way which
look like random but actually it is in particular sequence. The triple key
contains a hexadecimal key that extraction and manipulations to achieve
the intermediate key which combined with initial and control parameters
to generate chaotic sequence. Experimental results show that algorithm
successfully perform the cryptography and can be applied on different
colour image size.
Typical Machine Learning Setup
DATA
MODEL: our approximation of the relation between x and y for
example:
Parameters: which needs to be learned from the data
Learning algorithm : An algorithm for learning parameters
.Example : gradient descent
Loss/error function: To guide the learning algorithm , the aim is to
minimize the error function
Code Snippet:
Encryption
Pre-processing data (output format)
Pre-processing data
Preprocessing data :Creating one hot representation(input format)
Example of one hot representation
Why one hot encoding?
• Because we cant pass the words as a input to the netwrok.
• To get a vectorial representation of every letter and special
characters
• Take the total number of alphabets and space(26+1) and assign it a
corresponding number .
• This vectorial representation will works as input for our neural
network
Model Building
Model summary
Decryption:
model building
Model training
Model prediction
Layers used: Leaky RELU
Layers used: dense
Optimizer used: ADAM
optimizer : Adam is derived from adaptive moment estimation
CONCLUSION
A neural network-based cryptography technique has been implemented
to study encryption and decryption techniques.
Accuracy is enhanced by proper selection of network topology and
parameters in the training algorithms.
The future work that may be done in this regard includes:
1) Minimisation of the error function by improved methods
2) Implementation of better training algorithms and network
architectures
3) Increasing the efficiency of training for the generalised
cryptosystems.