Report
Report
Report
1
MA 202 Project Report Semester-2 Spring 2022
Contents
1 Introduction 3
1.1 Important terms to know before going ahead . . . . . 3
1.2 Symmetric Key Exchange Algorithms . . . . . . . . . . . 4
1.3 Assumptions taken . . . . . . . . . . . . . . . . . . . . . . 4
2 Solution Methodology 4
2.1 Mathematical Approach . . . . . . . . . . . . . . . . . . 4
2.2 A Brief idea about our approach . . . . . . . . . . . . . 6
4 Numerical Methods 7
4.1 Bisection Method . . . . . . . . . . . . . . . . . . . . . . . 7
4.2 Newton-Raphson Method . . . . . . . . . . . . . . . . . . 8
4.3 Secant Method . . . . . . . . . . . . . . . . . . . . . . . . 9
7 Future Scope 12
8 Contributions 12
2
MA 202 Project Report Semester-2 Spring 2022
Abstract
Cryptography is not a new concept. Rather, it has been in use for thousands of years now. It
is the study of mathematical methods pertaining to aspects of security of information like data
integrity, authentication, confidentiality, and data origin authentication. It does not only mean
hiding information. Rather it is a set of techniques which can be implemented to code a data,
send it to the intended receiver, and should be easily unpackable by them.
1 Introduction
Information security has become a significant issue in today’s generation. With the increase in
various threats and risks in the digital domains, there is an increasing need to come up with and
develop newer ways of encrypting one’s crucial data and information. Therefore, an extra layer
of protection shield is usually added on top of the basic encryption-decryption setup with the
help of steganography. Steganography is a widely preferred and implemented technique due to
the extra security that it provides. This is what we would like to focus on during this project.
3. Cryptography: Cryptography, derived from the Greek word kryptos, are techniques that
allow the secure transfer of data, and only the sender and the receiver know the actual
contents of the message. There are two types of cryptography:
3
MA 202 Project Report Semester-2 Spring 2022
• Symmetric Key Cryptography-> The sender as well as the receiver use a single,
common key.
• Asymmetric Key Cryptography-> Also called public-key steganography, it uses two
related keys: a public key and a private key.
2. We are only assuming communication between two users. Practically, for multiple users,
the algorithm can be run in a cyclic form.
2 Solution Methodology
2.1 Mathematical Approach
In the practical world, one way functions are the functions which can be computed easily. It is
like finding f(x) at a given value of x, but when we talk about images then it is difficult to obtain
an image from a random input. One way functions are used to give an unique address to the
input but there is no way to go back to get the original input. So naturally, one way functions
are used in cryptography to encode the messages.
We can also check or verify whether they are accurate or not by knowing the input and output
form the original phase. As part of this project, we have used three different types of numerical
methods to approximate the root of the one way function in cryptography. From the conclusion
perspective, we have compared the iterations and results of all the methods.
4
MA 202 Project Report Semester-2 Spring 2022
5
MA 202 Project Report Semester-2 Spring 2022
For the encryption purpose, we have used numerical methods to determine the roots of the
one-way, which is the cipher-text for our message. Decryption follows the exact opposite ap-
proach. We would also compare and present the results about the performance of the various
numerical methods.
2. The Diffie-Hellman algorithm is used to get the one-way function f(x) and the secret keys
required by the user and the receiver.
3. Once we have the function f(x), we use one of the numerical methods to solve f(x) =
ASCII value of the text message for x. The root of this equation gives us the cipher-text.
4. We now get the array of the solutions of the equation, which represents the encrypted data.
1. We have the array of solution for the equation representing the encrypted data. We can
put these values into the equation to get the value of f(x).
2. This value of f(x) is equal to the ASCII value of the text message.
2. The sender chooses a secret key(integer) a and sends the receiver a value k = ga mod(p).
3. Similarly, the receiver chooses a secret key(integer) b and sends the sender a value m =
gb mod(p).
5. The sender and the receiver now have the same secret key s.
Example of Diffie-Hellman Algorithm: Consider that the public keys p and g are 13 and 6
respectively. The sender Alice is allocated a private key a = 4 and the receiver Bob is allocated
a private key b = 2. The private keys are not known to anyone else.
6
MA 202 Project Report Semester-2 Spring 2022
Note that p is greater then g. The intermediate key generated by sender Alice is given by
ga mod(p) which is equal to 9. The intermediate key generated by Bob is given by gb mod(p)
which is equal to 10. Now the secret key is given by gab mod(p) which is equal to 3. The secret
key will be the same either ways because the Diffie-Hellman Algorithm is a symmetric key
exchange algorithm.
4 Numerical Methods
The solution of equations of the form f(x)=0 is obtained in many applications. If a polynomial
f(x) is of degree two or three, exact formulae are obtainable. But, on the other hand, if f(x) is
a polynomial of a higher order or is a transcendental function, the solution does not exist. In
these cases, numerical methods are very important to find the approximate root. We would be
describing the following numerical methods and use them to find the one-way function.
The bisection method or interval halving is a type of incremental search method (locating
an interval where function changes sign), where the search interval is always divided into half.
If the function changes sign in this interval, we know that the root lies in this interval.
Stage 1: If for an interval f(x1 )f(x2 )<0, at least one root is there!
Let
(x1 + x2 )
xm =
2
.
Stage 2: We then compute f(xm ) and check for sign change between x1 and xm or x2 and xm .
One of the intervals will be discarded.
7
MA 202 Project Report Semester-2 Spring 2022
• If f(x1 )f(xm )<0, the root lies in interval (x1 ,xm ). Repeat Stage 1 with x2 = xm .
• If f(xm )f(x2 )<0, the root lies in interval (xm ,x2 ). Repeat Stage 1 with x1 = xm .
This is repeated at every stage until the iterations are stopped.
Stage 3: While coding, we stop the iterations when the error at that stage.The error at the (i+1)th
stage is given by:
f (xi )
xi+1 = xi − (1)
f ′ (xi )
Stage 3: While coding, we stop the iterations when the error at that stage.The error at the (i+1)th
stage is given by:
8
MA 202 Project Report Semester-2 Spring 2022
xm (i+1) − xm (i)
E a (i+1) =
xm (i+1)
The secant method is a recursive method for finding the root for polynomials by successive
approximation.
In the secant method, we approximate the neighbourhoods of the roots by a secant line or chord
to the function f(x).
Stage 1: We consider two initial guesses x = x0 and x = x1 as the neighbourhoods of the roots
of the function f(x).
Stage 2: The approximation of the root at the (i+1)th iteration is given by:
(xi+1 − xi )f (xi )
xi+1 = xi − (2)
f (xi+1 ) − f (xi )
Stage 3: While coding, we stop the iterations when the error at that stage.The error at the (i+1)th
stage is given by:
xm (i+1) − xm (i)
E a (i+1) =
xm (i+1)
9
MA 202 Project Report Semester-2 Spring 2022
The encrypted text (that is, the cipher text) that we obtained after using function f(x) as (Secret
Key)x3 - 2.7x - (ASCII) = 0 is shown below:
The decrypted text that we obtained using the decryption code is shown below:
10
MA 202 Project Report Semester-2 Spring 2022
Figure 10
1. The results of the comparison show that the Newton-Raphson method and Secant method
are quite efficient, while methods like Bisection method do not work very efficiently for a
larger length of text.
2. From Figure 6, it can be very well observed that the Newton-Raphson method and the
Secant method take very less time and very less iterations for encrypting the same text
message.
3. The results we obtained hold with our general expectation that the Newton-Raphson
method and the Secant method takes lesser time to converge.
11
MA 202 Project Report Semester-2 Spring 2022
7 Future Scope
• We have used text-to-text encryption, that is, we are encrypting the required text in some
other non-susceptible text.
This encryption can be extended to more complex steganography techniques, such as
encrypting text in an image, or even more complex such as, encrypting an image in a
video file.
• Further we can extend the study to compare the results for other numerical methods as
well, such as the Brent’s method, Runge-Kutta method,etc.
• In the current world, there is a possibility of the insecurity of the data through encryption.
Researchers are still looking for more secure encryption. There may exist some futuristic
encryption method like Honey Encryption, in which information is created by wrong
guess that looks like accurate, Quantum key encryption, where quantum atoms protects
the data, Functional Encryption, where restricted secret keys enable a key holder to learn
about only a specific function of encrypted data and nothing else.
8 Contributions
All of our team members contributed to the successful completion of the project, and worked
hard and well above their potential. However the following work done by the members is worth
mentioning:
• Vrajesh and Mumuksh helped formulate the entire problem statement and brief of the
problem.
• Daniel and Mumuksh helped us in understanding the entire cryptography process. This
includes topics from Diffie-Hellman process and the generation of secret keys to the entire
encryption-decryption algorithm.
• Vrajesh, Daniel, and Mumuksh contributed towards the code for text-to-text encryption,
while Jinay and Kush formulated the MATLAB code (which has not been included in this
report).
• Jinay and Kush completed the entire documentation process, including the documentation
in LaTex, writing the entire content. They also created the slides for the presentation.
2. Future of Encryption
4. Wolfram
5. FedTechMagazine
6. Basics of Cryptography
7. Implementation of Diffie-Hellman
12
MA 202 Project Report Semester-2 Spring 2022
8. Implementation of Diffie-Hellman
11. Nagunwa T.;"Examining Usage of Web Browser Security Indicators in ebanking:A Case
Study"; International Journal of Advanced Research in Computer Science and Software
Engineering; Volume 4,Issue 9,September 2014.
12. Alfred J.Menezes, Paul C.Van Oorschot and Scott A.Vanstone; "Handbook of Applied
Cryptography";1996.
17. Saxena , H.C. ,Finite Differences and Numerical Analysis,S.Chand and Co.New Delhi
2008.
18. Amartya Ghosh and Anirban Saha, NUMERICAL METHOD BASED ENCRYPTION ALGORITHM
13