Project Ad911 Merged
Project Ad911 Merged
PROJECT REPORT
SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE AWARD OF DEGREE
OF
BACHELOR OF SCIENCE
in
MATHEMATICS
of
UNIVERSITY OF CALICUT
by
ADITHYA S BABU
Univ.Reg.No. CLAWSMT028
Department of MATHEMATICS
Sree Narayana Guru College
Chelannur, Kozhikode
Department Of Mathematics
Sree Narayana Guru College
Chelannur, Calicut -673613
Certificate
First and foremost, I thank God for his providence and for being the guiding light throughout the
project. I would like to thank my guide Mrs. Manjuraj S (Asst. Professor of Mathematics) for
providing guidance for the preparation of this project report. Finally, I would like to extend my
sincere gratitude to friends who have always been helpful during my project preparation.
1 Introduction 1
1.1 What is Cryptography? . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Origin of Cryptography . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Importance of Cryptography in the Modern Era . . . . . . . . . . . . . . 2
1.4 Structure of the Report . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 Preliminaries 3
2.1 Mathematical Origins of Cryptography . . . . . . . . . . . . . . . . . . . 3
2.1.1 Number Theory and Cryptography . . . . . . . . . . . . . . . . . 3
2.1.2 Modular Arithmetic in Cryptography . . . . . . . . . . . . . . . . 3
2.1.3 Algebraic Structures . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Mathematical Framework for Modern Cryptography . . . . . . . . . . . . 4
2.2.1 Group Theory Applications . . . . . . . . . . . . . . . . . . . . . 4
2.2.2 Ring Theory in Cryptography . . . . . . . . . . . . . . . . . . . . 4
2.2.3 Field Theory Applications . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Evolution of Cryptographic Concepts . . . . . . . . . . . . . . . . . . . . 5
2.3.1 Classical Cryptographic Techniques . . . . . . . . . . . . . . . . . 5
2.3.2 Transition to Modern Cryptography . . . . . . . . . . . . . . . . . 5
2.4 Foundational Concepts for Modern Cryptography . . . . . . . . . . . . . 5
2.4.1 Discrete Logarithms . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.4.2 Elliptic Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
7 References 31
Chapter 1
Introduction
• Non-repudiation: Ensuring that the sender cannot deny the authenticity of their
message.
• Greek Scytale: A tool used for transposition ciphers, where a strip of text was
wound around a rod to reveal the message.
• Julius Caesar: The Caesar cipher, a substitution cipher, shifted each letter in the
plaintext by a fixed number of positions.
1
With the advent of computers, cryptography evolved significantly. The mid-20th
century marked the beginning of modern cryptography with the development of complex
algorithms. Notable milestones include:
• Enigma Machine: Used during World War II for encrypted communication by
the German military.
• Data Encryption Standard (DES): Adopted in the 1970s, DES was a significant
step in the standardization of cryptographic algorithms.
• Public-Key Cryptography: Introduced by Diffie and Hellman in 1976, this con-
cept revolutionized secure communication.
2
Chapter 2
Preliminaries
Key Takeaways: Prime numbers are essential for creating secure public-key cryp-
tosystems. Modular arithmetic is widely used in encryption algorithms.
3
2.1.3 Algebraic Structures
Algebraic structures such as groups, rings, and fields provide a framework for many
cryptographic operations:
• Groups: Used in Diffie-Hellman key exchange and elliptic curve cryptography.
• Fields: Enable arithmetic operations in finite fields, as seen in AES and ECC.
Application in RSA The multiplicative group modulo n, (Z/nZ)∗ , is crucial for RSA
cryptography.
4
Application Finite fields GF (pn ) are essential in:
Applications: RSA uses the group (Z/nZ)∗ , and Diffie-Hellman relies on cyclic
groups for secure key exchange.
• Caesar Cipher: A substitution cipher that shifts each letter by a fixed number of
places.
5
Chapter 3
This chapter categorizes cryptographic systems into symmetric, asymmetric, and hash-
based techniques. Each type is explained with its mathematical foundation, applications,
and example problems with solutions for practical understanding.
Overview In symmetric cryptography, the sender and receiver must share a secret key
securely before communication begins. The security of the system depends on the secrecy
of the key, as anyone with access to it can decrypt the encrypted data.
Advantages
Challenges
• Not scalable for systems with many users due to the need for unique keys between
each pair of users.
6
Examples of Symmetric Algorithms
Applications
• Step 2: Key Expansion: Generate round keys using the provided 128-bit key.
• Step 3: Initial AddRoundKey: XOR the plaintext block with the initial round
key.
• Step 5: Final Ciphertext: After the final round, the output is the encrypted
ciphertext.
7
Electronic Codebook (ECB)
• Encryption: Each plaintext block is encrypted independently:
Ci = EK (Pi ) (3.1)
• Benefit: Each ciphertext block depends on all previous blocks, making patterns
harder to detect.
• Benefit: Allows parallel processing since encryption of different blocks does not
depend on previous blocks.
8
Feistel Networks
• Key principles:
• Ensuring that the resulting S-box provides strong non-linearity and resistance against
differential and linear cryptanalysis.
9
Matrix Multiplication Over GF (28 ) MixColumns treats each column of the state
matrix as a polynomial over GF (28 ) and multiplies it by a fixed polynomial modulo x4 +1.
This is represented as:
02 03 01 01 a0
01 02 03 01 a1
01 01 02 03 × a2 (3.6)
03 01 01 02 a3
where multiplication is performed in GF (28 ).
10
3.3 Asymmetric Key Cryptography
Asymmetric key cryptography uses a pair of keys: a public key for encryption and a
private key for decryption.
Overview In this method, the public key can be freely shared, while the private key
remains confidential. Messages encrypted with the public key can only be decrypted by
the corresponding private key, and vice versa. This eliminates the need for a shared secret
key.
Advantages
Challenges
11
• Euler’s Totient Function Properties: Euler’s totient function, ϕ(n), determines
the number of integers less than n that are coprime to n. It plays a key role in
computing the RSA private key.
Curve Theory
y 2 = x3 + ax + b
This equation determines the set of valid points used in cryptographic computations.
• Group Law Derivation: The set of points on an elliptic curve forms an abelian
group under point addition. The security of ECC relies on the difficulty of the
Elliptic Curve Discrete Logarithm Problem (ECDLP).
• Point at Infinity Analysis: The point at infinity serves as the identity element
in elliptic curve arithmetic, making it essential for defining group operations.
Field Operations
• Point Addition Formulas: Given two points P and Q on an elliptic curve, their
sum is computed using algebraic formulas that maintain group properties.
12
Security Analysis
• Pohlig-Hellman Algorithm: This algorithm exploits weak curves where the or-
der of the group has small prime factors, making ECC key selection critical.
Lattice Fundamentals
Learning With Errors (LWE) The Learning With Errors (LWE) problem is a fun-
damental problem in lattice-based cryptography, serving as the basis for many encryption
and signature schemes.
13
Detailed Example: RSA Encryption and Decryption RSA is a widely used asym-
metric algorithm. Below is an example:
14
3.4 Hash Functions
Hash functions are a type of cryptographic algorithm that converts input data into a
fixed-length hash value, which represents the data uniquely.
Overview Unlike encryption, hash functions are one-way operations that do not require
a key. They are used to ensure data integrity and are a fundamental component of digital
signatures.
• Fast Computation: Hashes can be computed quickly for any data size.
• Collision Resistance: It is difficult to find two distinct inputs with the same hash.
• SHA-256: A secure and widely used hash function producing 256-bit hashes.
Applications
185F8DB32271FE25F561A6FC938B2E264306EC304EDA518007D1764826381969
334D6A9EDC290BCE9A65221AA4F5F6F5E7C5E70C5EB8FA4A84E266BF73B8B7E1
• Observe that even a small change in the input drastically alters the hash output,
ensuring data integrity.
15
3.4.1 Advanced Hash Functions
Hash functions play a critical role in cryptographic security, ensuring data integrity and
authentication. This section delves into advanced properties and construction methods
of cryptographic hash functions.
• Birthday paradox application: Due to the birthday bound, a hash function with
n-bit output has a collision probability of approximately 2−n/2 . This highlights the
need for sufficiently large hash sizes.
• Probability bounds: The probability of a collision occurring can be analyzed us-
ing probability theory, leading to recommendations for secure hash output lengths.
• Random oracle model: In theoretical cryptography, hash functions are often
modeled as random oracles, providing an idealized abstraction that aids in security
proofs.
• Security proof : The construction ensures that if the underlying compression func-
tion is collision-resistant, then the resulting hash function is also collision-resistant.
16
• Length extension vulnerability: The construction is susceptible to length exten-
sion attacks, where an attacker can compute H(m||p) from H(m) without knowing
m.
• State and capacity analysis: A sponge function uses an internal state divided
into a ”rate” and a ”capacity.” The rate determines how much data is absorbed or
squeezed per iteration, while the capacity affects resistance to cryptanalysis.
17
3.5 Post-Quantum Cryptography
Lattice-Based Cryptography Lattice-based cryptography is a promising area for
post-quantum security due to its resistance to quantum attacks.
Lattice Fundamentals
• Definition: A lattice is a set of points in n-dimensional space with a periodic struc-
ture, defined by integer linear combinations of basis vectors.
• Basis representation: A lattice can have multiple equivalent bases, with some being
more efficient than others for computational purposes.
• Gram-Schmidt orthogonalization: A process to convert a basis into an orthogonal
form for easier computation.
McEliece Cryptosystem
• Based on the difficulty of decoding a general linear code.
• Public key: A generator matrix of a scrambled and permuted error-correcting code.
• Private key: The original code and permutation used for scrambling.
Advantages
• Proven security against quantum attacks.
• Efficient encryption and decryption processes.
Disadvantages
• Large key sizes compared to traditional cryptosystems.
• Less adoption in practical systems.
18
Chapter 4
This chapter delves into the practical applications and implementations of cryptographic
algorithms. It highlights how cryptographic principles are applied in real-world scenarios,
followed by detailed steps for implementing key algorithms.
• Encryption: Ensures that data transferred between clients and servers is protected
from eavesdropping.
19
4.1.3 Data Storage and Privacy
Cryptography is employed to protect sensitive data stored in databases and cloud envi-
ronments.
• Encryption: Ensures that only authorized users can access the content.
20
4.2 Key Cryptographic Algorithms
This section provides step-by-step explanations of important cryptographic algorithms,
emphasizing their mathematical foundations and practical implementations.
Key Generation:
• Choose a public key exponent e such that 1 < e < ϕ(n) and gcd(e, ϕ(n)) = 1.
Encryption:
Decryption:
• n = p · q = 3233.
21
4.2.2 AES Algorithm
AES is a symmetric key algorithm widely used for encrypting data.
Key Features:
Steps:
Example: Encrypt the plaintext ”HELLO” using a 128-bit key. Convert the plaintext
to binary, apply the AES steps, and produce the ciphertext. For simplicity, tools like
Python’s cryptography library can be used for practical implementation.
22
4.2.3 Elliptic Curve Cryptography (ECC)
ECC is a public-key cryptography system that provides high security with smaller key
sizes compared to RSA.
Key Features:
Steps:
Example: Let the curve be y 2 = x3 + 2x + 3 mod 97, and G = (3, 6). If k = 20:
• This public key is then used for encryption and key exchange.
Steps:
• Exchange public keys and compute the shared secret: s = B a mod p = Ab mod p.
• A = 56 mod 23 = 8.
23
Chapter 5
This chapter explores the latest advancements in cryptography, the challenges posed
by emerging technologies such as quantum computing, and future directions in the field.
Cryptography must continually evolve to address new threats while maintaining efficiency
and security.
24
• Transitioning existing systems to quantum-resistant algorithms without disrupting
operations.
• Ensuring long-term security for sensitive data, such as health and financial records.
25
5.2 Homomorphic Encryption
Homomorphic encryption (HE) allows computations to be performed directly on en-
crypted data without decrypting it, ensuring privacy during data processing.
• Secure Voting: Allow secure and private vote tallying while maintaining voter
confidentiality.
26
5.3 Zero-Knowledge Proofs (ZKP)
Zero-knowledge proofs allow one party to prove to another that a statement is true
without revealing any additional information beyond the validity of the statement.
27
5.4 Future Directions in Cryptography
As technology advances, cryptography must address emerging challenges and leverage
new opportunities. Key future directions include:
28
Chapter 6
Cryptography has evolved significantly from its historical roots to become a cornerstone of
modern security. This chapter summarizes the key points covered in the report, highlights
the importance of cryptography in contemporary society, and explores the scope for future
advancements.
29
• Support for Emerging Technologies: Facilitating the secure implementation of
technologies like blockchain and IoT.
• Resource Constraints: The need for lightweight cryptographic solutions for IoT
devices and other constrained environments.
• Ethical Concerns: Balancing security with user privacy and addressing misuse of
cryptographic systems.
30
Chapter 7
References
31