You are on page 1of 20

MATHEMATICAL CRYPTOGRAPHY AND ITS APPLICATIONS:

EXPLORING THE RSA ALGORITHM THROUGH NUMBER THEORY

BOAZ TAMIRE

DEPARTMENT OF APPLIED MATHEMATICS

SCHOOL OF APPLIED NATURAL SCIENCE

ADAMA SCIENCE AND TECHNOLOGY UNIVERSITY

ADVISOR: Dr. NATEA HUNDE

JUNE, 2023 G.C


ADAMA, ETHIOPIA
APPROVAL PAGE

SUBMITTED BY

------------------------------------------ ---------------------------- --------------------------


Name of Student Signature Date

APPROVED BY

------------------------------------------ ---------------------------- --------------------------


Advisor Signature Date

------------------------------------------ ---------------------------- --------------------------


Examiner Signature Date

------------------------------------------ ---------------------------- --------------------------


Department Head Signature Date
ACKNOWLEDGEMENT

I am deeply grateful to Dr. Natea Hunde, my esteemed advisor, for their invaluable guidance,
unwavering support, and expertise throughout my research on "Mathematical Cryptography and
its Applications: Exploring the RSA Algorithm through Number Theory." Dr. Natea’s
dedication, insightful feedback, and rigorous standards have shaped the direction of this study. I
extend my thanks to the academic community, my family, friends, and the institution for their
support, which has contributed to the quality and depth of this work.

I
ABSTRACT
Mathematical cryptography plays a vital role in securing digital communication and protecting
sensitive information in the digital era. This research paper delves into the fundamental principles
of mathematical cryptography, with a primary focus on the application of number theory in the
widely used RSA algorithm.

The study begins with a comprehensive overview of the underlying principles of number theory,
emphasizing key concepts such as prime numbers, modular arithmetic, and the Euler's totient
function. These concepts serve as the building blocks for understanding the RSA algorithm and its
security guarantees.

Next, the research delves into the mathematical foundation of the RSA algorithm, which relies on
the difficulty of factoring large composite numbers into their prime factors. The process of key
generation, encryption, and decryption are thoroughly explained, highlighting the mathematical
operations involved and their implications for security.

In summary, this research paper provides a comprehensive analysis of mathematical cryptography,


specifically focusing on the RSA algorithm. By leveraging the principles of number theory, the
study explores the theoretical foundations, security considerations, and practical applications of
RSA, shedding light on its significance in securing digital communication and protecting sensitive
information in the digital age.
LIST OF ACRONYMS

MCIA: Mathematical Cryptography and Its Applications

RSA: Rivest-Shamir-Adleman

NT: Number Theory

PKC: Public Key Cryptography


TABLE OF CONTENTS

ACKNOWLEDGEMENT .................................................................................................... I

ABSTRACT ....................................................................................................................... II

LIST OF ACRONYMS ....................................................................................................... 1

CHAPTER ONE : INTRODUCTION ................................................................................ 3

1.1BACKGROUND ..................................................................................................... 3

1.2 STATEMENT OF THE PROBLEM ...................................................................... 6

1.3 OBJECTIVES ......................................................................................................... 6

1.3.1. GENERAL OBJECTIVES .......................................................................... 6

1.3.2. SPECIFIC OBJECTIVES ............................................................................ 6

1.4 SIGNIFICANCE OF THE STUDY ....................................................................... 6

CHAPTER TWO: LITERATURE REVIEW ..................................................................... 7

2.2 ESSENTIAL NUMBER THEORY FOR PUBLIC-KEY ALGORITHMS ........... 9

CHAPTER THREE : METHODOLOGY ......................................................................... 12

CONCLUSION ................................................................................................................. 15

REFERENCES .................................................................................................................. 16
CHAPTER ONE : INTRODUCTION
Cryptography, the science of secure communication, has been an integral part of human
civilization since ancient times. Its fundamental purpose is to transform information into an
unintelligible form, known as ciphertext, using various mathematical techniques. With the rapid
advancement of technology and the found everywhere presence of digital communication, the need
for robust cryptographic systems has become more critical than ever.

Mathematics plays a pivotal role in the field of cryptography, providing the theoretical foundations
and tools necessary to develop secure algorithms. Number theory, in particular, serves as the
backbone of modern cryptographic systems. The inherent properties of prime numbers, modular
arithmetic, and mathematical functions form the basis of many encryption and decryption
processes.

1.1BACKGROUND

The most general term of this concept is cryptology. cryptology encompasses both cryptography
and cryptanalysis. It is the broader field that encompasses the study of both the design and analysis
of cryptographic systems. Cryptologists strive to develop new and robust encryption algorithms
while simultaneously analyzing existing ones to identify weaknesses and improve security.

The word cryptography came from two Greek words Krypto meaning hidden and graphene
meaning writing where in general cryptography is hidden writing. Cryptography is the science of
keeping secrets secret. Cryptography is the science of secret writing with the goal of hiding the
meaning of a message.

Cryptanalysis involves the study and analysis of cryptographic systems with the goal of breaking
or circumventing their security measures. It focuses on identifying vulnerabilities in encryption
algorithms and developing techniques to exploit them. Cryptanalysts employ various mathematical
and computational methods, such as statistical analysis, algebraic attacks, and brute-force
algorithms, to decipher ciphertext and gain unauthorized access to protected information.

Symmetric ciphers refer to cryptographic algorithms that use the same key for both encryption
and decryption of data. These ciphers are efficient and fast, making them suitable for bulk data
encryption. Examples of symmetric ciphers include the Advanced Encryption Standard (AES)
and the Data Encryption Standard (DES).

Asymmetric ciphers, also known as public-key ciphers, employ a pair of keys: a public key for
encryption and a private key for decryption. This approach allows for secure communication
without the need to exchange secret keys. Popular asymmetric ciphers include the RSA (Rivest-
Shamir-Adleman) algorithm and the Elliptic Curve Cryptography (ECC).

Cryptography protocols are sets of rules and procedures that govern secure communication over
networks. They combine cryptographic algorithms with additional mechanisms such as
authentication, key exchange, and data integrity checks. Protocols like Transport Layer Security
(TLS) and Secure Shell (SSH) ensure secure communication in various applications, including
web browsing, email, and remote access.

In summary, symmetric ciphers use the same key for encryption and decryption, while
asymmetric ciphers rely on a pair of keys. Cryptography protocols incorporate these ciphers
along with additional mechanisms to enable secure communication in various networked
environments.

In the field of cryptography, Bob, Alice, and Eve (sometimes referred to as Oscar) are commonly used
fictional characters to represent different entities and their roles in cryptographic scenarios. These
characters help illustrate various concepts and scenarios in secure communication.

Bob and Alice typically represent two legitimate parties who want to communicate securely. They are the
intended recipients of the message and are interested in ensuring the confidentiality, integrity, and
authenticity of their communication. Bob and Alice may engage in activities such as encryption, decryption,
and key exchange to achieve secure communication.

Eve, also known as the eavesdropper, is an adversary or a third party who attempts to intercept and gain
unauthorized access to the communication between Bob and Alice. Eve's goal is to extract sensitive
information or compromise the security of the communication. Eve may employ various techniques, such
as eavesdropping, cryptanalysis, or exploiting vulnerabilities in the cryptographic system, to achieve her
objectives.

The presence of Eve highlights the importance of strong cryptographic algorithms, secure key exchange
protocols, and proper implementation practices to protect communication against potential adversaries. The
goal of cryptography is to ensure that the communication between Bob and Alice remains secure, even in
the presence of an active and capable eavesdropper like Eve.

By using these fictional characters, cryptography scenarios become more relatable and easier to understand.
Bob, Alice, and Eve help demonstrate the challenges and solutions in achieving secure communication, and
they serve as a basis for analyzing and designing cryptographic systems that can withstand potential attacks.
1.2 STATEMENT OF THE PROBLEM
➢ What Makes RSA cryptosystem secured?

➢ What kind of Mathematics does RSA apply?

➢ How do RSA works?

1.3 OBJECTIVES

1.3.1. GENERAL OBJECTIVES

The general objective of this research is to investigate and demonstrate the application of number theory
in mathematical cryptography, with a particular focus on the RSA algorithm. The research aims to
showcase the role of number theory principles in the design, analysis, and enhancement of cryptographic
systems, thereby highlighting the significance of this mathematical discipline in securing digital
communication.

1.3.2. SPECIFIC OBJECTIVES

➢ To examine the foundational principles of number theory, including prime numbers, modular
arithmetic, and the Euler's totient function, and their relevance to mathematical
cryptography.

➢ To interpret encryption and decryption algorithm using number theory

➢ To provide some real examples of cryptography.

1.4 SIGNIFICANCE OF THE STUDY


This research aims to contribute to the academic knowledge and understanding of the relationship
between number theory and cryptographic algorithms, specifically RSA. The study's findings and analysis
can serve as a valuable resource for researchers, academics, and students in the field of cryptography,
providing a deeper understanding of the underlying mathematical foundations.
CHAPTER TWO: LITERATURE REVIEW
An interesting historical milestone in the field of cryptography is the development of public-key
encryption. Prior to 1973, all cryptosystems were based on symmetric-key encryption, where the
same key was used for both encryption and decryption. However, in 1973, James Ellis, Clifford
Cocks, and Malcolm Williamson introduced the concept of public-key encryption, followed by
the groundbreaking key distribution method proposed by Whitfield Diffie and Martin Hellman in
1976.

The introduction of public-key encryption revolutionized the field by addressing the challenges
of key distribution in symmetric-key systems. Public-key encryption involves the use of a pair of
keys - a public key for encryption and a private key for decryption. This allows for secure
communication without the need for both parties to share a secret key in advance. The public key
can be freely shared, while the private key remains securely held by the intended recipient.

In 1976, Whitfield Diffie and Martin Hellman proposed a revolutionary key distribution
methodology based on the idea that what was previously the master key, k, in a symmetric-key
cryptosystem could be split into two parts. The first part, known as the Public Key (denoted as
KPUB), is used to encrypt information and the second part, known as the Private Key (denoted as
KPR), is used to decrypt information. This idea transformed the symmetric-key cryptosystem
locked cabinet analogy to the public-key cryptosystem analogy of a post office mailbox; anyone
can deposit information into the mailbox, but only one party can unlock the mailbox and withdraw
the information. Information deposits occur using the public key and information withdrawals
occur using the private key.

The development of public-key encryption marked a significant turning point in cryptography,


introducing asymmetric cryptographic systems that greatly expanded the capabilities and
possibilities of secure communication. This breakthrough has since become an integral part of
modern cryptographic techniques and continues to be extensively researched and developed to
enhance the security of digital communication in today's interconnected world. Number theory
serves as the foundation for RSA, a widely used public-key encryption algorithm developed by
Rivest, Shamir, and Adleman in 1977. The algorithm relies on the computational complexity of
certain number theory problems, such as the difficulty of factoring large composite numbers into
their prime factors. The security of RSA is based on the assumption that factoring large numbers
into primes is a computationally challenging problem.

Numerous studies have focused on the mathematical principles underlying RSA. The concept of
modular arithmetic plays a pivotal role, allowing for efficient computations in the RSA
algorithm. Modular exponentiation, specifically the exponentiation by squaring technique,
enables the fast computation of large modular powers, which is crucial for encryption and
decryption processes.
Furthermore, prime numbers are at the core of RSA's security. Research has extensively
examined the generation, testing, and properties of prime numbers in the context of RSA.
Primality testing algorithms, such as the Miller-Rabin test and the AKS primality test, have been
investigated to ensure the accuracy and efficiency of prime number selection in RSA.

Euler's totient function (phi function) is another essential concept in number theory that is
directly relevant to RSA. The phi function enables the calculation of the Euler's totient value,
which is crucial for generating the public and private keys in RSA. Various studies have
explored the properties and applications of Euler's totient function in RSA, including its role in
key generation and cryptographic strength analysis.
2.2 ESSENTIAL NUMBER THEORY FOR PUBLIC-KEY ALGORITHMS

THE EUCLIDEAN ALGORITHM


THEOREM I: Let a and b be any positive integers, and r the remainder, when a is divided by b.

Then (a, b) = (b, r)

EXAMPLE 1: Illustrate the Theorem with a = 120 and b = 28.

SOLUTION

by the division algorithm, 120 = 4 · 28 + 8, so, by Theorem I, (120,28) = (28,8). But (28,8) = 4.
Therefore, (120,28) = 4.

EXAMPLE 2: Using Theorem I, evaluate GCD of (2076,1776).

SOLUTION

Apply the division algorithm with 2076 (the larger of the two numbers) as the dividend and 1776
as the divisor:

2076 = 1 · 1776 + 300

Apply the division algorithm with 1776 as the dividend and 300 as the divisor:

1776 = 5 · 300 + 276

Continue this procedure until a zero remainder is reached:

2076 = 1 · 1776 + 300

1776 = 5 · 300 + 276

300 = 1 · 276 + 24

276 = 11 · 24 + 12

24 = 2 · 12 + 1

By the repeated application of Theorem I, we have:


(2076,1776) = (1776,300) = (300,276)

= (276,24) = (24,12)

= 12

Thus, the last nonzero remainder in this procedure is the gcd.

EULER’S PHI FUNCTION

We now look at another tool that is useful for public-key cryptosystems, especially

for RSA. We consider the ring Zm, i.e., the set of integers {0, 1,..., m−1}. We are interested in the
(at the moment seemingly odd) problem of knowing how many numbers in this set are relatively
prime to m. This quantity is given by Euler’s phi function, which is defined as follows:

Euler’s Phi Function is the number of integers in Zm relatively prime to m is denoted by


Φ(m).

We first look at some examples and calculate Euler’s phi function by actually

counting all the integers in Zm which are relatively prime.

Example: Let m = 6. The associated set is Z6 = {0,1,2,3,4,5}.

gcd(0,6) = 6

gcd(1,6) = 1 ⋆

gcd(2,6) = 2

gcd(3,6) = 3

gcd(4,6) = 2

gcd(5,6) = 1 ⋆

Since there are two numbers in the set which are relatively prime to 6, namely 1 and
5, the phi function takes the value 2, i.e., Φ(6) = 2.
THEOREM: Let m have the following canonical factorization

Since the value of n, i.e., the number of distinct prime factors, is always quite small
even for large numbers m, evaluating the product symbol ∏ is computationally easy.
Let’s look at an example where we calculate Euler’s phi function using the relation:

Example

Let m = 240. The factorization of 240 in the canonical factorization form is

m = 240 = 16·15 = 24 ·3·5 = p1e1 . p2e2. P3e3 There are three distinct prime factors, i.e., n = 3.

The value for Euler’s phi functions follows then as:

Φ(m) = (24 −23) (31 −30) (51 −50) = 8·2·4 = 64.

That means that 64 integers in the range {0,1,...,239} are coprime to m = 240.
The alternative method, which would have required to evaluate the gcd 240 times,
would have been much slower even for this small number.
CHAPTER THREE : METHODOLOGY

RSA Key Generation

Output: public key : kpub = ( n , e ) and private key : kpr = (d)

1. Choose two large primes p and q.

2. Compute n = p · q.

3. Compute Φ ( n ) = ( p − 1 ) ( q − 1 ).

4. Select the public exponent e ∈ { 1, 2 ,..., Φ ( n ) − 1 } such that gcd ( e , Φ ( n ) ) = 1.

5. Compute the private key d such that, d.e ≡ mod Φ ( n )

➢ Encryption and Decryption of RSA

RSA encryption and decryption is done in the integer ring Zn and modular computations play a
central role so RSA encryption and decryption is presented in detail

➢ RSA Encryption Given the public key (n,e) = kpub and the plain text x the encryption function
is:

y = ekpub (x) ≡ xe mod n

where x, y ∈ Zn

➢ RSA Decryption Given the private key d = kpr and the cipher text y, the decryption function
is:

x = dkpr (y) ≡ yd mod n

where x, y ∈ Zn.

Example 1. Alice intends to transmit an encrypted message to Bob. To initiate the process, Bob
calculates his RSA parameters. Following that, he shares his public key with Alice. Subsequently,
Alice encrypts the message (x = 4) using Bob's public key and transmits the resulting ciphertext,
denoted as y, to Bob. Finally, Bob employs his private key to decrypt the ciphertext y and reveal
the original message.

Step 1: Choose two prime numbers, p and q

In this case, we choose p = 3 and q = 11.

Step 2: Compute n = p * q

n = 3 * 11 = 33

Step 3: Compute φ(n) = (p - 1) * (q - 1)

φ(n) = 2 * 10 = 20

Step 4: Choose an integer e such that 1 < e < φ(n) and e is coprime to φ(n)

We can choose e = 7 since 1 < 7 < 20 and gcd(7, 20) = 1.

Step 5: Compute d such that d * e ≡ 1 (mod φ(n))

To find d, we need to solve the equation 7d ≡ 1 (mod 20). We can use the extended Euclidean
algorithm to find that d = 3.

So, Bob's public key is (n, e) = (33, 7) and his private key is d = 3.

Now, let's say Alice wants to send the message x = 4 to Bob.

Step 6: Alice encrypts the message using Bob's public key

Alice calculates y = xe (mod n) = 47 (mod 33) = 22.

So Alice sends the cipher text y = 22 to Bob.

Step 7: Bob decrypts the cipher text using his private key

Bob calculates x = yd (mod n) = 223 (mod 33) = 4.


So Bob recovers the original message x = 4.

Therefore, Alice successfully encrypted and sent the message to Bob using RSA encryption with
primes 3 and 11.
CONCLUSION

In conclusion, the field of mathematical cryptography and its applications, particularly in the
context of exploring the RSA algorithm through number theory research, plays a vital role in
ensuring secure communication and data protection. The RSA algorithm, developed by Rivest,
Shamir, and Adleman, has proven to be a cornerstone of modern public key cryptography.

By delving into number theory concepts such as prime numbers, modular arithmetic, and Euler's
totient function, researchers have gained a deeper understanding of the underlying mathematical
foundations of RSA. This knowledge has enabled the development of efficient encryption and
decryption techniques that form the basis of secure communication protocols and data protection
systems.

Through extensive research and exploration, experts have expanded the boundaries of RSA's
applicability and strengthened its security. They have also explored related topics such as elliptic
curve cryptography, advanced encryption standards, and discrete logarithm problems,
contributing to the broader field of mathematical cryptography.

As technology continues to evolve and security threats become increasingly sophisticated,


ongoing research in mathematical cryptography remains essential. The exploration of the RSA
algorithm through number theory research provides valuable insights and breakthroughs,
ensuring the development of robust cryptographic systems and fostering a secure digital
environment for communication, commerce, and sensitive data exchange.

.
REFERENCES

Stallings, W. (2010). Cryptography and Network Security: Principles and Practice (6th ed.).
Pearson.

Delfs, H., & Knebl, H. (2015). Introduction to Cryptography: Principles and Applications.
Publisher.

Paar, C., & Pelzl, J. (2014). Understanding Cryptography: A Textbook for Students and
Practitioners. Publisher.

You might also like