Cryptography
Cryptography
PROJECT REPORT
A STUDY OF CRYPTOGRAPHY
AUTHORS:
ANU A.P (Reg No: 180021036894)
HAREESH C.S (Reg No: 180021036905)
JISSA SABU (Reg No: 180021036910)
SUPERVISOR:
Mrs. PRIYA MATHEWS
ASSISTANT PROFESSOR
DEPARTMENT OF MATHEMATEMATICS
ST. THOMAS COLLEGE KOZHENCHERRY
A dissertation submitted in partial fulfillment of the requirements for the award of the Degree
of
MAHATMA GANDHI UNIVERSITY KOTTAYAM
31st March,2021
St. Thomas College, Kozhencherry
Department of Mathematics
Department of Mathematics
Department of mathematics
DECLARATION OF AUTHORSHIP
Date:
“Programming is one of the most difficult branches of
applied mathematics; the poorer mathematicians had better
remain pure mathematicians”
-Edsger Dijkstra-
St. Thomas College Kozhencherry
Department of Mathematics
Abstract
STUDY OF CRYPTOGRAPHY
BY
ANU A.P
(Reg No: 180021036894)
HAREESH C.S
(Reg No: 180021036905)
JISSA SABU
(Reg No: 180021036910)
This project deals with the study of cryptography, Some of its applications, Types of
cryptography with examples and future of cryptography.
Acknowledgements
We are grateful to all those who provided their assistance and cooperation during the
development of our dissertation “study of cryptography”
We thank GOD ALMIGHTY for give us the knowledge and wisdom to complete the work.
We express our sincere gratitude to THE PRINCIPAL, ST. THOMAS COLLEGE
KOZHENCHERRY for the encouragement by providing the facilities in the college for the
smooth conduct of project work.
We are also thankful to prof. ANN SUSA THOMAS, Head of the department for the
valuable suggestions and guidance.
We are extremely grateful to our project supervisor Mrs. Priya Mathews for the active
interest taken in our work and valuable guidance throughout.
We take this opportunity to thank all our teachers and friends for the support, cooperation
and encouragement rendered to us.
The completion of the project owes a lot to our parents and family members.
ANU A.P HAREESH C.S
(Reg No: 180021036894) (Reg No: 180021036905)
JISSA SABU
(Reg No: 180021036910)
Kozhencherry
Date:
To our Teachers, Parents and Friends….
CONTENTS
Certificate of supervision
Declaration of authorship
Abstract
Acknowledgement
Introduction
CHAPTER-1
●Cryptography
● Definition
●Terminology
● History
●Goal and services
CHAPTER-2
• Types of Cryptography
o Symmetric Key Cryptography
o Asymmetric Key Cryptography
o Hash Cryptography
• PGP Encryption
• Key management
• Digital certificate
• Certifying authority
• Certificate management system
• Benefit and drawback of cryptography
• Future of cryptography
• Conclusion
INTRODUCTION
DEFINITION
(Phil Zimmermann)
(Bruce Schneier)
TERMINOLOGY
A Cryptosystem is an implementation of cryptographic techniques and their
accompanying infrastructure to provide information security services. A
cryptosystem is also referred to as a cipher system. The various components of a
basic cryptosystem are as follows
• Plaintext
• Encryption Algorithm
• Ciphertext
• Decryptions Algorithm
• Encryption Key
• Decryption Key
While cryptography is the science of securing data, cryptanalysis is the science
of analyzing and breaking secure communication. Classical cryptanalysis
involves an interesting combination of analytical reasoning, application of
mathematical tools, pattern finding, patience, determination, and luck.
Cryptanalysis are also called attackers.
Cryptology embraces both cryptography and cryptanalysis.
HISTORY OF CRYPTOGRAHY
As civilizations evolved, human beings got organized in tribes, groups, and
kingdoms. This led to the emergence of ideas such as power, battles, supremacy,
and politics. These ideas further fueled the natural need of people to communicate
secretly with selective recipient which in turn ensured the continuous evolution
of cryptography as well.
The root of cryptography is found in Roman and Egyptian civilizations.
HIEROGLYPH
The first known evidence of cryptography can be traced to the use of ‘hieroglyph’.
Some 4000 years ago, the Egyptians use to communicate by messages written in
hieroglyph.
• Confidentially (secrecy)
• Integrity (anti-tampering)
• Authentication
• Non-repudiation
Confidentially:
• Ensuring that no one can read the message except the intended receiver
• Data is kept secret from those without the proper credential, even if
that data travels through an insure medium
Integrity(anti-tampering)
• Assuring the receiver that the received message has not been altered
in any way from the original.
Authentication
Types of cryptography
Each AES cipher has a 128-bit block size, with key sizes of 128, 192 and 256bits
respectively. The AES ciphers have been analyzed extensively and are now use
worldwide, as was the case with its predecessor, the Data Encryption Standard
(DES).
LUCIFER _ MADRYGA
FEAL _ REDOC
LOKI _ GOST
CAST _ BLOWFISH
SAFER _ CRAB
RCS _
Key management
Symmetric key management system are simpler and faster; their main drawback
is that the two parties must somehow exchange the key in a secure way and kept
after that.
Key management caused nightmare for the parties using the symmetric key
cryptography. They were worried about how to get the keys safely and securely
across to all users so that the decryption of the message would be possible. This
gave the chance for third party to intercept the key in transit to decode to top-
secret message. Thus, if the key was compromised the entire coding system was
compromised and a “secret” would no longer remain a “secret”.
This is why “public key cryptography” came into existence.
Algorithm-RSA
RSA (Rivest, shamir and Adleman who first publicly described in 1977) is an
algorithm for public-key [Link] is first algorithm known to be suitable for
signing as well as encryption, and one of the first great advance in public key
cryptography.
RSA is widely used in electronic commerce protocols, and is believed to be secure
given sufficiently long key and the use of up-to-date implementations.
RSA Cryptanalysis
Rivest, shamir and adleman placed a challenge in martin gardner’s column in
scientific American(journal)in which the readers where invited to crack.
C=114,381,625,757,888,867,669,235,779,976,146,612,010,218,296,721,242,36
2,562,561,842,935,706,935,245,733,897,830,597,125,563,958,705,058,989,075
,147,599,290,026,879,543,541
This was solved in April 26, 1994, cracked by an international effort via the
internet with the use of 1600 workstations, mainframes, and supercomputers
attacked the number for eight months before finding its public key and its private
key.
Encryption key = 9007
The message “first solver wins one hundred dollars”.
Of course, the RSA algorithm is safe, as it would we incredibility difficult
together up such international participation to commit malicious acts.
ElGamal
N 3n 3n mod 5
1 3 3
2 9 4
3 27 2
4 81 1
• Choosing the private key. The private key x is any number bigger than 1
and smaller than p−1.
• Computing part of the public key. The value y is computed from the
parameters p, g and the private key x as follows −
y = gx mod p
• Obtaining Public key. The ElGamal public key consists of the three
parameters (p, g, y).
For example, suppose that p = 17 and that g = 6 (It can be confirmed that
6 is a generator of group Z17). The private key x can be any number bigger
than 1 and smaller than 71, so we choose x = 5. The value y is then
computed as follows −
y = 65 mod 17 = 7
• Thus the private key is 62 and the public key is (17, 6, 7).
Encryption and Decryption
The generation of an ElGamal key pair is comparatively simpler than the
equivalent process for RSA. But the encryption and decryption are slightly more
complex than RSA.
ElGamal Encryption
Suppose sender wishes to send a plaintext to someone whose ElGamal public
key is (p, g, y), then −
• Sender represents the plaintext as a series of numbers modulo p.
• To encrypt the first plaintext P, which is represented as a number modulo
p. The encryption process to obtain the ciphertext C is as follows −
o Randomly generate a number k;
o Compute two values C1 and C2, where −
k
C1 = g mod p
C2 = (P*yk) mod p
• Send the ciphertext C, consisting of the two separate values (C1, C2), sent
together.
• Referring to our ElGamal key generation example given above, the
plaintext P = 13 is encrypted as follows −
o Randomly generate a number, say k = 10
o Compute the two values C1 and C2, where −
10
C1 = 6 mod 17
C2 = (13*710) mod 17 = 9
• Send the ciphertext C = (C1, C2) = (15, 9).
ElGamal Decryption
• To decrypt the ciphertext (C1, C2) using private key x, the following two
steps are taken −
o Compute the modular inverse of (C1)x modulo p, which is (C1)-x ,
generally referred to as decryption factor.
o Obtain the plaintext by using the following formula −
C2 × (C1)-x mod p = Plaintext
• In our example, to decrypt the ciphertext C = (C1, C2) = (15, 9) using
private key x = 5, the decryption factor is
15-5 mod 17 = 9
• Extract plaintext P = (9 × 9) mod 17 = 13.
ElGamal Analysis
In ElGamal system, each user has a private key x. and has three components of
public key − prime modulus p, generator g, and public Y = gx mod p. The
strength of the ElGamal is based on the difficulty of discrete logarithm problem.
The secure key size is generally > 1024 bits. Today even 2048 bits long key are
used. On the processing speed front, Elgamal is quite slow, it is used mainly for
key authentication protocols. Due to higher processing efficiency, Elliptic Curve
variants of ElGamal are becoming increasingly popular.
Let us briefly compare the RSA and ElGamal schemes on the various aspects.
RSA ElGamal
For a particular security level, lengthy For the same level of security, very
keys are required in RSA. short keys are required.
HASH FUNCTIONS
What is a Hash function?
A cryptographic hash function is a hash function that takes an arbitrary block of
data and returns a fixed-size to string, the cryptographic hash value, such that any
(accidental or intentional) change to the data will (with very high probability)
change the hash value. The data to be encode are often called the message, and
the hash value is sometime called the message digest or simply digest.
The ideal cryptography hash function has four main properties;
PGP Encryption
Pretty Good Privacy (PGP) is an encryption system used for both sending
encrypted emails and encrypting sensitive files. Since its invention back in 1991,
PGP has become the de facto standard for email security.
PGP shares some features with other encryption systems you may have heard of,
like Kerberos encryption (which is used to authenticate network users) and SSL
encryption (which is used to secure websites).
The mathematics behind encryption can get pretty complex (though you can take
a look at the math if you like), so here we’ll stick to the basic concepts. At the
highest level, this is how PGP encryption works:
First, PGP generates a random session key using one of two (main) algorithms.
This key is a huge number that cannot be guessed, and is only used once.
Next, this session key is encrypted. This is done using the public key of the
intended recipient of the message. The public key is tied to a particular person’s
identity, and anyone can use it to send them a message.
The sender sends their encrypted PGP session key to the recipient, and they are
able to decrypt it using their private key. Using this session key, the recipient is
now able to decrypt the actual message.
Key Management
It goes without saying that the security of any cryptosystem depends upon how
securely its keys are managed. Without secure procedures for the handling of
cryptographic keys, the benefits of the use of strong cryptographic schemes are
potentially lost.
It is observed that cryptographic schemes are rarely compromised through
weaknesses in their design. However, they are often compromised through poor
key management.
There are some important aspects of key management which are as follows −
• Cryptographic keys are nothing but special pieces of data. Key
management refers to the secure administration of cryptographic keys.
• Key management deals with entire key lifecycle as depicted in the
following illustration −
• There are two specific requirements of key management for public key
cryptography.
o Secrecy of private keys. Throughout the key lifecycle, secret keys
must remain secret from all parties except those who are owner and
are authorized to use them.
o Assurance of public keys. In public key cryptography, the public
keys are in open domain and seen as public pieces of data. By
default there are no assurances of whether a public key is correct,
with whom it can be associated, or what it can be used for. Thus
key management of public keys needs to focus much more
explicitly on assurance of purpose of public keys.
The most crucial requirement of ‘assurance of public key’ can be achieved
through the public-key infrastructure (PKI), a key management system for
supporting public-key cryptography.
DIGITAL CERTIFICATE
For analogy, a certificate can be considered as the ID card issued to the person.
People use ID cards such as a driver's license, passport to prove their identity. A
digital certificate does the same basic thing in the electronic world, but with one
difference.
Digital Certificates are not only issued to people but they can be issued to
computers, software packages or anything else that need to prove the identity in
the electronic world.
• Digital certificates are based on the ITU standard X.509 which defines a
standard certificate format for public key certificates and certification
validation. Hence digital certificates are sometimes also referred to as
X.509 certificates.
Public key pertaining to the user client is stored in digital certificates by
The Certification Authority (CA) along with other relevant information
such as client information, expiration date, usage, issuer etc.
• CA digitally signs this entire information and includes digital signature in
the certificate.
• Anyone who needs the assurance about the public key and associated
information of client, he carries out the signature validation process using
CA’s public key. Successful validation assures that the public key given
in the certificate belongs to the person whose details are given in the
certificate.
The process of obtaining Digital Certificate by a person/entity is depicted in the
following illustration.
As shown in the illustration, the CA accepts the application from a client to
certify his public key. The CA, after duly verifying identity of client, issues a
digital certificate to that client.
As discussed above, the CA issues certificate to a client and assist other users to verify
the certificate. The CA takes responsibility for identifying correctly the identity of the
client asking for a certificate to be issued, and ensures that the information contained
within the certificate is correct and digitally signs it.
KEY FUNCTIONS OF CA
CLASS 3 − These certificates can only be purchased after checks have been made about
the requestor’s identity.
CLASS 4 − They may be used by governments and financial organizations needing very
high levels of trust.
CA may use a third-party Registration Authority (RA) to perform the necessary checks
on the person or company requesting the certificate to confirm their identity. The RA may
appear to the client as a CA, but they do not actually sign the certificate that is issued.
While the public key of a client is stored on the certificate, the associated secret private
key can be stored on the key owner’s computer. This method is generally not adopted. If
an attacker gains access to the computer, he can easily gain access to private key. For this
reason, a private key is stored on secure removable storage token access to which is
protected through a password.
Different vendors often use different and sometimes proprietary storage formats for
storing keys. For example ,Entrust uses the proprietary .EPF format, while Verisign,
Global Sign, and Baltimore use the standard. P12 format.
HIERARCHY OF CA
The following illustration shows a CA hierarchy with a certificate chain leading from an
entity certificate through two subordinate CA certificates (CA6 and CA3) to the CA
certificate for the root CA.
Verifying a certificate chain is the process of ensuring that a specific certificate chain is
valid, correctly signed, and trustworthy. The following procedure verifies a certificate
chain, beginning with the certificate that is presented for authentication −
A client whose authenticity is being verified supplies his certificate, generally along with
the chain of certificates up to Root CA.
Verifier takes the certificate and validates by using public key of issuer. The issuer’s
public key is found in the issuer’s certificate which is in the chain next to client’s
certificate.
Now if the higher CA who has signed the issuer’s certificate, is trusted by the verifier,
verification is successful and stops here.
Else, the issuer's certificate is verified in a similar manner as done for client in above steps.
This process continues till either trusted CA is found in between or else it continues till
Root CA.
Nowadays, the networks have gone global and information has taken the digital form of
bits and bytes. Critical information now gets stored, processed and transmitted in digital
form on computer systems and open communication channels.
Since information plays such a vital role, adversaries are targeting the computer systems
and open communication channels to either steal the sensitive information or to disrupt
the critical information system.
Modern cryptography provides a robust set of techniques to ensure that the malevolent
intentions of the adversary are thwarted while ensuring the legitimate users get access to
information. Here in this chapter, we will discuss the benefits that we draw from
cryptography, its limitations, as well as the future of cryptography.
CRYPTOGRAPHY – BENEFITS
Cryptography is an essential information security tool. It provides the four most basic
services of information security −
Confidentiality − Encryption technique can guard the information and communication
from unauthorized revelation and access of information.
DATA INTEGRITY –
The cryptographic hash functions are playing vital role in assuring the users about the
data integrity.
CRYPTOGRAPHY – DRAWBACKS
Apart from the four fundamental elements of information security, there are other issues
that affect the effective use of information.
A strongly encrypted, authentic, and digitally signed information can be difficult to access
even for a legitimate user at a crucial time of decision-making. The network or the
computer system can be attacked and rendered non-functional by an intruder.
Cryptography does not guard against the vulnerabilities and threats that emerge from the
poor design of systems, protocols, and procedures. These need to be fixed through proper
design and setting up of a defensive infrastructure.
Future of Cryptography
Elliptic Curve Cryptography (ECC) has already been invented but its
advantages and disadvantages are not yet fully understood. ECC allows to
perform encryption and decryption in a drastically lesser time, thus allowing a
higher amount of data to be passed with equal security. However, as other
methods of encryption, ECC must also be tested and proven secure before it is
accepted for governmental, commercial, and private use.
CONCLUSION
However, the following year a different District Court made an opposite ruling
in a different case. Daniel Bernstein, while a Ph.D. candidate at the University
of California, was told by the U.S. government that he had to register as an arms
dealer under the International Traffic in Arms Regulation in order to publish a
cryptographic program. Bernstein sued. In August 1997 the Federal District
Court in San Francisco ruled that export restrictions on encryption are "an
unconstitutional prior restraint in violation of the First Amendment" [EFFa,
EFFb]. According to the Justice department, the larger issue of exporting
cryptographic algorithms remains unresolved.