Discrete Mathematics Assignment
Discrete Mathematics Assignment
Group:
Srishti Saxena 2014AAPS298H
Akriti Trivedi 2014A3PS829H
S V Padmanabhan 2015A3PS222H
Sankalp Mittal 2015AAPS242H
Lalit Kishan Sisodiya 2015AAPS585H
History
RSA (Rivest- Shamir- Adleman) was first described in 1977 by Ron Rivest, Adi
Shamir and Leonard Adleman of the Massachusetts Institute of Technology.
RSA is one of the first practical public-key cryptosystems and is widely used for
secure data transmission. In such a cryptosystem, the encryption key is public and
different from the decryption key, which is kept secret (private). In RSA, this
asymmetry is based on the practical difficulty of factoring the product of two
large prime numbers, the factoring problem.
The idea of an asymmetric public-private key cryptosystem is attributed
to Whitfield Diffie and Martin Hellman, who published the concept in 1976. They
also introduced digital signatures and attempted to apply number theory; their
formulation used a shared secret key created from exponentiation of some number,
modulo a prime number. However, they left open the problem of realizing a one-
way function, possibly, because the difficulty of factoring was not well studied at
the time.
Ron Rivest, Adi Shamir, and Leonard Adleman (R.S.A.) at MIT made several
attempts over the course of a year to create a one-way function that is hard to
invert. Rivest and Shamir, as computer scientists, proposed many potential
functions while Adleman, as a mathematician, was responsible for finding their
weaknesses. They tried many approaches including "knapsack-based" and
"permutation polynomials". For a time, they thought it was impossible for what
they wanted to achieve due to contradictory requirements. In April 1977, they
spent Passover at the house of a student and drank a good deal
of Manischewitz wine before returning to their home at around midnight.[5]Rivest,
unable to sleep, lay on the couch with a math textbook and started thinking about
their one-way function. He spent the rest of the night formalizing his idea and had
much of the paper ready by daybreak. The algorithm is now known as RSA the
initials of their surnames in same order as their paper.
Clifford Cocks, an English mathematician working for the UK intelligence
agency GCHQ, described an equivalent system in an internal document in
1973. However, given the relatively expensive computers needed to implement it
at the time, it was mostly considered a curiosity and, as far as is publicly known,
was never deployed. His discovery, however, was not revealed until 1997 due to its
secret classification.
Introduction
Before the introduction of public-key cryptography by Diffie and Hellman [3], if
two people wanted to communicate in private by encrypting messages sent
between them, they would first need meet to agree upon methods for encoding and
decoding the messages. The advent of the public-key cryptosystem made these
kinds of meetings unnecessary because it allowed both parties to make their
encryption procedures publicly available without compromising the privacy of
their communication. A public-key
Cryptosystem is one in which each user places an encryption procedure E into a
public file. Each user has a corresponding decryption procedure D, the details of
which the user does not reveal to anyone else. The key to ensuring the security of a
public-key cryptosystem is for it to be extremely difficult to derive the decryption
key from the publicly available encryption key. In order to qualify as a public-key
cryptosystem, the encryption and decryption procedures must have the following
properties:
Suppose Alice wishes to send Bob a valuable diamond, but the jewel will be stolen
if sent unsecured. Both Alice and Bob have a variety of padlocks, but they don't
own the same ones, meaning that their keys cannot open the other's locks.
1. Bob first sends Alice an unlocked padlock. Note that Bob would
give anyone an unlocked padlock, as the only use for one is to send Bob
something.
2. Alice adds Bob's lock and sends the package to Bob, and
3. Bob removes his lock and opens the package.
This example demonstrates the ideas behind public-key cryptography, though the
concept is actually slightly different. In public-key cryptography. Alice encrypts
her message using Bob's public key, which can only be decoded by Bob's private
key.
The mathematics behind the RSA algorithm are simple, yet elegant. The algorithm
works by exploiting concepts from number theory, including the properties of
modular arithmetic and
Proof: The left-hand sides of equations (1) and (2) can both be expressed as (Me)d
= Med = (Md)e. Thus, to prove the correctness of the algorithm, it suffices to show
[7] that
Med M (mod n) Letting _(n) represent the totient of n, we know that e d 1
(mod _(n)). This implies that for
some value of k, Med Mk_(n)+1 (mod n).
Further, by Fermats Little Theorem, we know that if M is not divisible by p,
Mp1 1 (mod p).
Therefore, since (p 1) does divide _(n),
Mk__(n) 1 (mod p) which implies that
Mk_(n)+1 M (mod p)
An analogous argument for q gives us that
Mk_(n)+1 M (mod q).
Since both p and q divide n, these last two equations together imply
Mk_(n)+1 M (mod n) which, in turn, gives us the desired result that
Med M (mod n).
_
The Significance of the Algorithm
Prior to the advent of the Internet, encryption was in many ways considered an
issue only for government agencies. The RSA algorithm was introduced at a time
when the potential popularity of the Internet was first becoming clear. With this
popularity came a high demand for safely and securely being able to transmit
information. The RSA algorithm, perceived as a nearly unbreakable, public-key
cryptosystem, quickly became the method of choice for Internet cryptography
including e-mail encryption among other uses. Today, RSA continues to be
employed for enciphering e-mail messages as well as for the Secure
Socket Layer (SSL) protocol used in the majority of internet data exchanges. Thus,
the RSA algorithm is something that most of us rely on each and every day, though
very few of us give a second thought to the security of the e-mails we send.
Algorithm:
1. Two very large prime numbers, normally of equal length, are randomly
chosen, then multiplied
N=AxB
2. T = (A-1) x (B-1)
3. A third number is then chosen randomly as the public key (E) such that it has
no common factors (i.e., is relatively co-prime) with T
4. The private key D is then:
5. D = E 1 mod T
6. Here D is the multiplicative inverse of E in the field ZT . In other words,
DE 1 (mod T)
7. To encrypt a block of plaintext (M) into ciphertext(C): C = ME mod N
8. To decrypt: M = CD mod N
Example:
A = 37
B = 23
N = 37 x 23 = 851
T = (37-1) x (23-1) = 792
E must have no common factors with T (792)
Let, E (public key) = 5
D (private key) = 5-1 mod 792 = 317
To encrypt a message (M) of the character G represent G as 7 (7th letter in the
alphabet)
M = 7 C = 75 mod 851 = 638
To decrypt
M = 638317 mod 851 = 7
Here actually the pair of numbers E and N form the public key, whereas D and T
form the private key.
Hackers try to factorize N and hence crack the code.Therefore length of the key has
to be increased to improve the security.
Currently RSA laboratories recommend key sizes of 768 bits for personal use, 1024
bits for corporate use and 2048 bits for extremely valuable keys (those used by
certifying authorities)
Security can be increased by frequently changing the keys, typically every two years.
It has been estimated that the quickest factoring algorithm known, will use
approximately 1023 computer operations to resolve an integer with 200 digits into
its prime factors.
Assuming that each operation takes 1 nanosecond, the factorization time would be
approximately 3 x 106 years.
However, the time is a lot less if we use networks of computers.
In 1994, a 129 digit number was factorized into its prime factors using 800
computers over a 8 month period. In 1977, the time was estimated to be 40
quadrillion years for this operation. Even without using huge keys, RSA is about
1000 times slower to encrypt/decrypt than DES.
Therefore it is not used as a standalone cryptosystem. It is used in hybrid
cryptosystems like PGP (Pretty Good Privacy).
In hybrid cryptosystems we encrypt the plaintext with a symmetric algorithm
(usually DES or IDEA).The symmetric algorithms key is then encrypted with a
public key algorithm like RSA.
Attacks on the RSA will continue to get stronger as factoring algorithms are
improved and made faster. There are many ideas for improving RSA security. First
and foremost is the hope that simply choosing increasingly longer keys will make
the factorization problem more difficult and help prevent attacks. As few as five
years ago, RSA encryption that used a 512-bit value for n was considered safe.
Now, improvements in technology have made it so that a 512-bit RSA system can
be broken in just a few days [6]. As computers continue to increase their
computing power, increasing key length will continue to be
a good solution against many of the attacks presented here. The main problems that
RSA and other encryption mechanisms must be prepared to deal with include
improved computing speed and capacity and mathematical breakthroughs for
factoring large numbers.
Conclusions
In this paper, we have described the famous RSA algorithm for public-key
cryptography. The algorithm, which was developed in 1977 by Rivest, Shamir, and
Adlemen, has become one of the most widely-used cryptography systems since it
was adopted for enciphering e-mail messages and other tasks involving security on
the Internet. We have seen that RSA is, at its core, a piece of simple mathematics
which makes use of facts and theorems from number theory, including Fermats
Little Theorem. We have looked at several kinds of attacks both on the algorithm
itself and on implementations of the algorithm. Finally,
we recognize that as computing capacity increases, the future of public-key
cryptography will necessarily involve using longer decryption keys to maintain
security.