100% found this document useful (1 vote)
804 views14 pages

Math HL 2020 IA On Cryptography

The document discusses RSA encryption and elliptic curve cryptography. It begins with an introduction to cryptography terminology like encryption, decryption, plaintext and ciphertext. It then provides details on RSA encryption, including how it uses modular arithmetic concepts like prime factorization, Euler's theorem and primitive roots. It also discusses the discrete logarithm problem in RSA. Next it covers elliptic curve cryptography, including fields, elliptic curves, group operations and the elliptic curve discrete logarithm problem. It concludes by comparing RSA and ECC.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
804 views14 pages

Math HL 2020 IA On Cryptography

The document discusses RSA encryption and elliptic curve cryptography. It begins with an introduction to cryptography terminology like encryption, decryption, plaintext and ciphertext. It then provides details on RSA encryption, including how it uses modular arithmetic concepts like prime factorization, Euler's theorem and primitive roots. It also discusses the discrete logarithm problem in RSA. Next it covers elliptic curve cryptography, including fields, elliptic curves, group operations and the elliptic curve discrete logarithm problem. It concludes by comparing RSA and ECC.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

1

RATIOANALE:
Messaging applications sometimes say ‘your messages are protected by end-to-end
encryption’. What does that mean? This is where my curiosity started. I had heard the
terms, ‘coding’, and ‘encryption’ but never learned about it in detail. After a little
research, I found that the topic had a strong mathematical foundation. Thus, my
curiosity took the form of this investigation.
My Investigation Question is ‘What are RSA encryption and Elliptical curve cryptography
(with respect to Diffie-Hellman Exchange) and how do they compare with each other?’
The investigation explores two important public key encryption methods called the RSA
encryption and Elliptical Curve encryption. These are compared and contrasted at the
end, with respect to their procedure, application in the real world and strategic
advantages.
I would not be exaggerating when I say that this investigation was genuinely enjoyable.
The learning was immense and interesting. This investigation has aided me explore my
curiosity to a reasonable depth and has been an insightful experience
2

TABLE OF CONTENTS:

1. Introduction to cryptography -------------------------------------------------------------3-4


1.1. Basic terminology ------------------------------------------------------------------3
1.2. Types of encryption ---------------------------------------------------------------4

2. RSA cipher -------------------------------------------------------------------------------------4-7


2.1. Modular arithmetic concepts ---------------------------------------------------4
2.2. Prime factorization --------------------------------------------------------------4-5
2.3. Euler’s theorem --------------------------------------------------------------------5
2.4. Primitive roots ----------------------------------------------------------------------5
2.5. DLP in RSA ---------------------------------------------------------------------------5
2.6. Diffie-Hellman Exchange in RSA ----------------------------------------------6-7
2.7. An Example --------------------------------------------------------------------------7

3. Elliptic Curve Cryptography Ciphers----------------------------------------------------8-11


3.1. Fields ----------------------------------------------------------------------------------8
3.2. Elliptic Curves -----------------------------------------------------------------------8
3.3. Basic group operations -----------------------------------------------------------9
3.4. Base point and cofactor-------------------------------------------------------9-10
3.5. ECDLP -------------------------------------------------------------------------------10
3.6. Diffie-Hillman Exchange in ECC--------------------------------------------10-11
3.7. An Example ------------------------------------------------------------------------11

4. RSA Vs. ECC----------------------------------------------------------------------------------- 12

5. Conclusion --------------------------------------------------------------------------------------12

6. Limitation ------------------------------------------------------------------------------------------13

7. Extension------------------------------------------------------------------------------------------13

8. Bibliography----------------------------------------------------------------------------------13-14
3

1. INTRODUCTION TO CRYPTOGRAPHY:

”Cryptography involves one genius trying to work out what another genius has
done.”
(MAI JIA: Decoded)

Data in today’s world is being constantly shared, sent and received. Some of
this data is sensitive and needs to kept private, thus is not safe to share
publicly. This is easy if people sharing know each other, but what if they
don’t?
For example, a customer from India,
David wants to buy a shirt from a
Brazilian retailer, Anne. Payment is
made online, which mean sensitive
information like the customer’s name,
Card security details are being shared
over the internet. Figure 1: Basic cryptography
This data needs to hidden and protected from potential eavesdroppers like
Elle and this is where cryptography comes in handy.
Cryptography is defined as a “technique of securing information and
communications through use of codes so that only those person for whom the
information is intended can understand it and process it.”1

1.1. BASIC TERMINOLOGY:


Encryption: the process of encoding a message or information in such a way that
only authorized parties can access it and those who are not authorized cannot. 2
Decryption: the process of transforming data that has been rendered unreadable
through encryption back to its unencrypted form. 3
Plain text: An original plain message
Cipher text: An encrypted message
Key: a piece of information (a parameter) that determines the functional output of
a cryptographic algorithm. 4

1 ‘Cryptography and its Types’, GeeksforGeeks, 07.07.2019, https://www.geeksforgeeks.org/cryptography-and-its-types/ , Accessed


02.01.2020
2 ‘Encryption’, Wikipedia, Wikimedia Foundations, 23.12.2019, https://en.wikipedia.org/wiki/Encryption, Accessed 02.01.2020
3 ‘What is Decryption? - Definition from Techopedia’, Techopedia.com, 2019,

https://www.techopedia.com/definition/1773/decryption, Accessed 02.01.2020


4‘Key(Cryptography)’, Wikipedia, Wikimedia Foundations, 06.12.2019, https://en.wikipedia.org/wiki/Key_(cryptography), Accessed 02.01.2020
4

1.2. TYPES OF ENCRYPTION:


For the scope of this exploration, let us consider only public-key cryptography and
private-key cryptography
Private key encryption: if the encrypting and decrypting keys are the same or it’s
easy to derive one from the other5
Public key encryption: e the decrypting key can’t be derived from the encrypting key
with any small amount of work. Thus, encrypting key can be public while the
decrypting key stays classified6

2. RSA CIPHERS:
RSA is a type of public key encryption cipher named after its authors Ron Risvest, Adi
Shamir and Leonard Adleman in 1977 7

2.1. BASIC MODULAR ARITHEMETIC CONCEPTS

Modulus / modulo (abbreviated as "mod") is the Latin word for "remainder,


residue"8
When a positive integer n, is divided by b , reminder a and quotient q are
derived. The solution of the modulus function is the reminder b
i.e. a≡b mod n means that a=b+kn for some integer n.9

2.2. PRIME FACTORISATION

Prime factorization can be defined as “finding which prime numbers multiply


together to make a the original number”10
For example :
15 = 3 X 5

5 Ruohonen, Keijo, ‘Mathematical Cryptology’, 2014


6 Ruohonen, Keijo, ‘Mathematical Cryptology’, 2014
7 Kosek, Amy, ‘An exploration of Mathematical Applications in Cryptography’, Ohio State University, 2015
8 ‘Gender and Tech Resources’, Encryption Everything, 2019, https://gendersec.tacticaltech.org/wiki/index.php/Encrypting_everything,

Accessed 02.01.2020
9 ‘An Introduction to Modular Arithmetic’, NRICH, 2019, https://nrich.maths.org/4350, Accessed 02.01.2020
10 ‘Prime Factorisation’, MathIsFun, 2017, https://www.mathsisfun.com/prime-factorization.html, Accessed 02.01.2020
5

35 = 5 X 7
The prime factorization is unique to every number
and this is called the Fundamental Theorem of
Arithmetic or Unique Factorization Theorem11
Another interesting property of prime factorization
is its time complexity. As the number increases, the
time taken to calculate in prime factorization
increases drastically. This is a type of one way
function i.e easy on one way, hard when tried the
other way around. Figure 2: One way function

2.3. EULER’S THEOREM

The totient φ(n) of a positive integer n greater than 1 is defined to be the


number of positive integers less than n that are coprime to n12

when n is a prime number (e.g. 2, 3, 5, 7, 11, 13),


φ(n) = n-1…………………………………………………formula 1
when m and n are coprime
φ(m*n) = φ(m)*φ(n)…………………….……………….formula 2

mФ(n) ≡ 1 mod n…………………………………………..formula 3

2.4. PRIMITIVE ROOTS

Given a positive integer n we call an integer g a primitive root modulo n if every


integer a which is relatively prime to n can be expressed as g k ≡ a (mod n) for
some positive integer k.13

2.5. DISCREET LOGARITHMIC PROBLEM IN RSA

DLP is a one way function used in public key encryption including RSA. It uses
the modulus function.
The basic principle is that modular exponentiation is a one way function.
i.e. for ab mod c = x,
x can be easily calculated , but when given a, x and c , it is relatively hard to
calculate b i.e. it takes a relatively longer time.

11 ‘Fundamental Theorem of Arithmetic’, Brilliant.org, 2019, https://brilliant.org/wiki/fundamental-theorem-of-arithmetic/ , Accessed


02.01.2020
12 Euler’s Totient Function and Euler’s Theorem’, Elementary Number Theory, 2019, https://www.doc.ic.ac.uk/~mrh/330tutor/ch05s02.html,

Accessed 02.01.2020
13 Kosek, Amy, ‘An exploration of Mathematical Applications in Cryptography’, Ohio State University, 2015
6

2.6. DIFFIE-HELLMAN EXCHNAGE IN RSA

Let us consider two people David and Anne. David wants to share a secret with
Anne but Ella is trying to steal the secret. So, he decides to use the RSA
encryption method to safely share her secret.

Figure 3: Diffie- Hellman Exchange in RSA

 Let David’s message be m


 Alice takes two random numbers p1 and p2 and multiplies them to get n.
 She finds out the Ф(n).
 She then picks a small random exponent e such that it is an odd number
and has no common factors with Ф(n) .
 She calculates her private exponent d by using formula 2
 She hides all the values except n and e, which are sent to David.

Therefore, we have
P1
P2
e
n = p1 x p2
Ф(n) = Ф(p1) x Ф(p2)…….. by 2
Ф(n) = (p1-1) (p2-1)………..by 1
( e−1)n+1
d= ………………..by 3
e
7

n and e are sent to David.


David calculates c and sends it to Anne
c ≡ me mod n
Anne decrypts this message using the formula
cd mod n ≡ m

2.7. AN EXAMPLE: (This example has been worked out independently)

m=8
P1 = 61
P2 = 67
e=3
n = p1 x p2
= 61 x 65
n = 4087
Ф(n) = Ф(61) x Ф(67)
Ф(n) = (p1-1) (p2-1)
= 60 x 66
Ф(n) = 3960
( 2)4087+1
d= = 2725
3

n and e are sent to David.


David calculates c and sends it to Anne
c ≡ 83 mod 4087
c = 512
Anne decrypts this message using the formula
5122725 ≡ m mod 4087
m=8
This number is then related to an alphabet (which could be as simple as A=1) and thus
used to encrypt messages.
8

3. ELLIPTIC CURVE CRYPTOGRAPHY:

3.1. FIELDS

Field in mathematics is defined as a se on which addition, subtraction, multiplication,


division are defined and behave similarly as they do in rational and real numbers 14
Some examples include rational numbers, real numbers(R), integers (Z) and
complex numbers(C)

3.2. ELLIPTIC CURVES

An elliptic curve, E, is a curve which is given


by an equation of the form
E ∶ y 2 = x 3 + Ax + B
Such that the discriminant of the curve is non-
zero
Discriminant = ∆ = 4A3 + 27B2

Point at infinity = O on every curve. The


derivation of this point O comes from
projective geometry15, which is out of the
scope of this exploration.

This curve is always considered over a field,


thus A, B, x, y, all belong to the same finite
field. 16
Figure 4: Elliptical Curve
Thus, we can define the set of points on the curve E over the field F by
E(F) = {O,(x, y) ∈ E | x, y ∈ F}.

14 ‘Field(Mathematics), Wikipedia, Wikimedia Foundations, 25.12.2019, https://en.wikipedia.org/wiki/Field_(mathematics), Accessed


02.01.2020
15 Kosek, Amy, ‘An exploration of Mathematical Applications in Cryptography’, Ohio State University, 2015
16 Kosek, Amy, ‘An exploration of Mathematical Applications in Cryptography’, Ohio State University, 2015
9

3.3. BASIC GROUP OPERATIONS

Let P(xp , yp ) and Q(xq , yq ) be two points on the


elliptical curve over a finite field E ∶ y 2 = x 3 +
Ax + B. Certain operations can be performed
over these points.

a. Point addition

P(xp , yp ) + Q(xq , yq ) = R(xr , yr )


Algebraically,
y −y
Slope of line PQ, s = xp− xq
p q

xr = s2 − (xp + xq ) Figure 5: Point addition in EC


yr = s(xp − xr ) − yp

b. Point doubling

2A(xa , ya ) = B(xb , yb )

Algebraically, we get:
3xa 2+A
Slope of the line joining A and B, s1= 2yd
2
xb = s1 − 2xa
yp = s1(xa − xb ) − ya

c. Scalar multiplication:
If Q = k P where k,Q ∈ Z Figure 6: Point doubling in EC

Then, Q = P + P + P ……..(k times)

3.4. BASE POINT AND COFACTOR:

In case of Elliptical Curve Cryptography, the generator G is the base point.


It is defined as the point on the curve that generates a cyclic subgroup.
G∈E
ord(G) = n, is the number of elements in the cyclic group

Cofactor is defined as the ratio between the total number of points on the curve
and the order of the generator
10

total number of points on the curve 17


Cofactor, h = n

Ideally, h = 1

3.5. ECDLP

The one way function in case of Elliptic Curve Cryptography is the


scalar multiplication.

Thus, scalar multiplication is called the Elliptic Curve Discreet


Logarithmic Problem

3.6. DIFFIE-HELLMAN EXCHNAGE IN ECC


Figure 7: One way function

Let us consider David and Anne want to share a secret, but Elle is
eavesdropping.
David and Anne establish these parameters over a public network:
y 2 = x 3 + Ax + B
Generator point G
Cofactor h
Order of G = n

 David generates a random number d and calculates a new point D = dG


by scalar multiplication

 Anne generates a random number c and calculates a new point C = cG by


scalar multiplication

 David and Anne exchange the point D and C publicly

 David calculates the shared point P = dcG

17‘Elliptic Curve Diffie Hellman’, Robert Pierce, YouTube, 10.12.2014, https://youtu.be/F3zzNa42-


tQ?list=PL75HnNTZApiY6Sjs0joCc8cQOjMkv7nh6, Accessed 02.01.2020
11

 Anne calculates the shared point P = cdG

Figure 8: Diffie – Hellman Exchange in ECC

3.7. AN EXAMPLE

(The values in the example have been used from an elliptic curve worked out
beforehand)18

Let us consider that Anne and David


established a curve
y 2 = x 3 + 2x + 2(mod 17)
With a generator point G(5,1)
For this curve,
n is found to be 19
h is found to be 1
Let David’s random number d = 9
Let Anne’s random number c = 3
David calculates point D = 9G = D(10,6)
Anne calculates point C = 3G = C(7,6) Figure 9: Points on ECC

David and Anne exchange points D and C

18Example from : Elliptic Curve Diffie Hellman’, Robert Pierce, YouTube, 10.12.2014, https://youtu.be/F3zzNa42-
tQ?list=PL75HnNTZApiY6Sjs0joCc8cQOjMkv7nh6, Accessed 02.01.2020
12

David calculates, P = 9(3)G = (13,7)


Anne calculates, P = 3(9)G = (13,7)
Thus, they both arrive at their common point!
Usually the x-coordinate or the y-coordinate is used. This number is then related to an
alphabet (which could be as simple as A=1) and thus used to encrypt messages.

4. RSA Vs ECC:

- The difficulty of breaking a cipher is proportional to its key length. But, as per the
figure it can be said that for the same key length, ECC provides better security.

- Private keys for RSA are around 12 times larger than ECC keys in 128-bit level.

- RSA key generation is 100 to 1000 times slower in comparison to ECC key
generation.

5. CONCLUSION:
RSA and EC cryptosystems are both used in SSL (Security Sockets layer which is used
to establish encrypted link between server and client19). They provide secure
cryptosystems individually and are sometimes used in combination for better security.
Thus, the analysis of these cryptosystems is relevant for security systems in today’s
world.
But, as compared in section 4. It can be concluded that ECC is a more secure and
preferred crypto-cipher over RSA. Cryptography is a dynamic field coming up with
improvements every moment. Just as the security gets more sophisticated, so will the
methods to tamper with them. Hackers and intruders look into how these security
systems can be defeated. Thus, it is necessary that we come up with better security
options which is what cryptography is all about.

19 “What Is SSL (Secure Sockets Layer)?”,Digicert, 09.01.2020, https://www.digicert.com/ssl/ https://www.digicert.com/ssl/


13

6. LIMITATIONS:

- The scope of this exploration is understand their core functioning and so the
breaking of the code hasn’t been explored.
- The example of ECC has been adapted from elsewhere as the method to
produce one was too complex for this paper. Thus, this could be worked out.

7. EXTENDING THIS RESEARCH:

- A study of how the RSA and ECC are tried to be broken can be done. This will
provide a better understanding of the ciphers and their security.

- Another cipher called the Digital Signature algorithm could be explored and then
compared to RSA and ECC ciphers explored in this paper.

- “A cipher suite is a set of algorithms that help secure a network connection that
uses Transport Layer Security (TLS)”20. These typically include a key exchange
algorithm, a bulk encryption algorithm and a Message Authentication Code
algorithm, Thus, the RSA, DSA could be explored as a cipher suite and how they
work together.

8. BIBLIOGRAPHY:
‘Cryptography and its Types’, GeeksforGeeks, 07.07.2019,
https://www.geeksforgeeks.org/cryptography-and-its-types/ , Accessed 02.01.2020

‘Encryption’, Wikipedia, Wikimedia Foundations, 23.12.2019,


https://en.wikipedia.org/wiki/Encryption, Accessed 02.01.2020

‘What is Decryption? - Definition from Techopedia’, Techopedia.com, 2019,


https://www.techopedia.com/definition/1773/decryption, Accessed 02.01.2020

‘Key(Cryptography)’, Wikipedia, Wikimedia Foundations, 06.12.2019,


https://en.wikipedia.org/wiki/Key_(cryptography), Accessed 02.01.2020

Ruohonen, Keijo, ‘Mathematical Cryptology’, 2014

Kosek, Amy, ‘An exploration of Mathematical Applications in Cryptography’, Ohio State


University, 2015

20
‘Cipher Suite’, Wikipedia, https://en.wikipedia.org/wiki/Cipher_suite, 16.12.2019, Accessed 30.01.2020
14

‘Gender and Tech Resources’, Encryption Everything, 2019,


https://gendersec.tacticaltech.org/wiki/index.php/Encrypting_everything, Accessed
02.01.2020

‘An Introduction to Modular Arithmetic’, NRICH, 2019, https://nrich.maths.org/4350,


Accessed 02.01.2020

‘Prime Factorisation’, MathIsFun, 2017, https://www.mathsisfun.com/prime-


factorization.html, Accessed 02.01.2020

‘Modern Cryptography’, Khan Academy.org, 2019,


https://www.khanacademy.org/computing/computer-science/cryptography#modern-
crypt, Accessed 02.01.2020

‘Fundamental Theorem of Arithmetic’, Brilliant.org, 2019,


https://brilliant.org/wiki/fundamental-theorem-of-arithmetic/ , Accessed 02.01.2020

Euler’s Totient Function and Euler’s Theorem’, Elementary Number Theory, 2019,
https://www.doc.ic.ac.uk/~mrh/330tutor/ch05s02.html, Accessed 02.01.2020

‘Field(Mathematics), Wikipedia, Wikimedia Foundations, 25.12.2019,


https://en.wikipedia.org/wiki/Field_(mathematics), Accessed 02.01.2020

‘Elliptic Curve Diffie Hellman’, Robert Pierce, YouTube, 10.12.2014,


https://youtu.be/F3zzNa42-tQ?list=PL75HnNTZApiY6Sjs0joCc8cQOjMkv7nh6,
Accessed 02.01.2020

“What Is SSL (Secure Sockets Layer)?”,Digicert, 09.01.2020,


https://www.digicert.com/ssl/ https://www.digicert.com/ssl/, Accessed 30.01.2020

‘Cipher Suite’, Wikipedia, https://en.wikipedia.org/wiki/Cipher_suite, 16.12.2019,


Accessed 30.01.2020

You might also like