RSA Algorithm: D e D Ed
RSA Algorithm: D e D Ed
RSA Algorithm: D e D Ed
Ron Rivest, Adi Shamir and Len Adleman, who invented it in 1977
Used for both public key encryption and digital signatures
Plain text is encrypted in blocks, each block having a binary value less
than some number n.
Block size <= log2(n); ,the block size is i bits, where 2i < n<= 2i+1
C = Me mod n
M = Cd mod n = (Me)d mod n = Med mod n
public key of KU = {e, n}
private key of KR = {d, n}
Requirements
•It is possible to find values of e, d, n such that Med = M mod n for all
M < n.
•It is relatively easy to calculate mod Me and Cd for all values of
M < n.
•It is infeasible to determine d given e and n.
Med = M mod n
Arbitrary integer k
mkΦ(n)+1=mk(p-1)(q-1)+1=m mod n
p,q prime
Φ(pq) = (p-1)(q-1)
The preceding relationship holds if e and d are multiplicative inverses modulo
Φ(n), where Φ(n) is the Euler totient function.
ed = k Φ(n) + 1
This is equivalent to saying
ed =1 mod Φ(n)
d =e-1 mod Φ(n)
That is, e and d are multiplicative inverses mod Φ(n).
Equivalently, gcd(Φ(n),d) = 1.
Ingredients of RSA
Suppose that user A has published its public key and that user B
wishes to send the message M to A. Then B calculates C = Me mod n
and transmits C. On receipt of this ciphertext, user A decrypts by
calculating M = Cd mod n.
• Select two prime numbers, p = 17 and q = 11.
• Calculate n = pq = 17 x 11 = 187.
• Calculate Φ(n) = (p - 1)(q - 1) = 16 x 10 = 160.
• Select e such that e is relatively prime to Φ(n) = 160 and less than
Φ(n) we choose e = 7.
• Determine d such that de = 1 (mod 160) and d < 160. The correct
value is d = 23, because 23 x 7 = 161 = 160 + 1; d can be calculated
using the extended Euclid's algorithm
RSA is usch slower than DES & Other Symmetric Cryptosystems
The Security of RSA
Four possible approaches to attacking the RSA algorithm:
The defense against the brute-force approach is the same for RSA as for
other cryptosystems, use a large key space. Thus, the larger the number of
bits in d, the better.
The Factoring Problem
Message authentication protects two parties who exchange messages from any
third party.
Scenario
An electronic funds transfer takes place, and the receiver increases the amount of
funds transferred and claims that the larger amount had arrived from the sender.
•The signature must be a bit pattern that depends on the message being
signed.
•It must be relatively easy to recognize and verify the digital signature.
The message is then dated and sent to Y with an indication that it has been
verified to the satisfaction of the arbiter.
Key Generation in RSA
• Determining two prime numbers, p and q
• Selecting either e or d and calculating the other
One of the more efficient and popular algorithms, the Miller-Rabin
algorithm
A primary application is for choosing the key length of the RSA public-key
encryption scheme.
Elliptic curves are also used in several integer factorization algorithms that have
applications in cryptography
An elliptic curve is a plane curve which consists of the points satisfying the equation
y^2 = x^3 + ax + b
Several RSA-based protocols have been adapted to elliptic curves, replacing the
group Zpq with an elliptic curve:
* The Elliptic Curve Diffie-Hellman key agreement scheme is based on the Diffie-
Hellman scheme,
* The Elliptic Curve Digital Signature Algorithm is based on the Digital Signature
Algorithm,
* The ECMQV key agreement scheme is based on the MQV key agreement
scheme.
HASH Function in Cryptography
A hash function H is a transformation that takes a variable-size input m and
returns a fixed-size string, which is called the hash value h (that is, h =
H(m)).
MD5 algorithm
In cryptography, MD5 (Message-Digest algorithm 5) is a widely used
cryptographic hash function with a 128-bit hash value. commonly used to check
the integrity of files.
MD5 processes a variable-length message into a fixed-length output of 128 bits.
The input message is broken up into chunks of 512-bit blocks (sixteen 32-bit little
endian integers)
Chinese Remainder Theorem
There are certain things whose number is unknown.
Repeatedly divided by 3, the remainder is 2;
by 5 the remainder is 3;
and by 7 the remainder is 2.
What will be the number?
Suppose n1, n2, …, nk are positive integers which are pairwise coprime.
Then, for any given integers a1,a2, …, ak, there exists an integer x solving
the system of simultaneous congruences
In mathematical way the problems can be stated as finding n, given its
remainders
of division by several numbers m1,m2,...,mk:
n = n1 (mod m1)
n = n2 (mod m2)
...
n = nk (mod mk)
Extended Euclidean algorithm is an extension to the Euclidean algorithm for
finding the greatest common divisor (GCD) of integers a and b