RSA Elgamal Algo
RSA Elgamal Algo
What is Cryptography:
Cryptography is the science of keeping secrets secret.
Cryptography is from Greek word kryptos, which means "hidden, secret"; and
gráphō, which means "I write“.
hidden secret
The Objectives of Cryptography
Alice encrypts the plaintext m and obtains the ciphertext c. The ciphertext c is
transmitted to Bob. Bob turns the ciphertext back into the plaintext by
decryption. To decrypt, Bob needs some secret information, a secret decryption
key.
Say an adversary Eve still may intercept the ciphertext. However, the
encryption should guarantee secrecy and prevent her from deriving any
information about the plaintext from the observed ciphertext.
The Objectives of Cryptography
Providing confidentiality is not the only objective of cryptography. Cryptography
is also used to provide solutions for other problems:
3. Non-repudiation: The sender should not be able to later deny that she sent
a message.
Cryptographic System
Encryption
key
Cipher-text
Alice Encrypt Decrypt Bob
Plain-text
Eve Decryption
key
11
Cryptographic System
Possible attacks: How Eve can determine key based on how much
information is available with him.
(ii) Known plain-text: Eve has plaint-text and corresponding cipher-text. Let
Alic always start message with Dear Bob
(iii) Chosen Plain-text: Let Eve has temporary access of encryption machine
but not key.
12
Attacks
Brute-Force Attacks
In this type of attack, also called an exhaustive serach of the keyspace, all
possible keys are tried to determine which one is being used by communicating
parties. For a well-designed cryptosystem, this type of attack is too time
consuming to undertake.
Ex. DES symmetric Crypto algorithm takes input of 56 bits. So, 256 =7.2 × 1016.
Due to short key length DES has been broken in less than 24 hours.
But assume that key space is 1030 then if computer does 109 calculations per
second. There are 3×107 seconds per year so it will take more than 3×1013
years to break the system which is more than age of universe.
Attacks
Algorithmic attacks
Hardware attack
Dictionary attack
Timing/Power consumption
nJ73:<><$%g8
ABCDEFGHIJK
#@h4$*&^*5 ABCDEFGHIJK
LMNOPQRST
LMNOPQRST
UVWXYZ
UVWXYZ
Asymmetric Key Cryptographic System
One of these two keys should be kept private, called private-key, and the other can be
made public (it can even be sent in mail), called public-key.
Euclidean algorithm
In RSA we have:
Hence :
cd ≡ (me)d ≡ m1+k.ø(n) ≡ m1.(mø(n))k ≡ M1.(1)k ≡ m1 ≡ m mod n
Compute ø(n)=(p–1)(q-1)=16×10=160
getting d.
Publish public key KU={7,187}
encryption:
decryption:
M = 1123 mod 187 = 88
ElGamal Cryptosystem
RSA’s strength is the difficulty of factorization of product of large primes.
ElGamal Signature scheme is based on Discrete log problem (DLP).
In RSA, if message is same then ciphertext is same but in ElGamal each time
ciphertext is different even message is same.
Let Bob wants to send a message m to Alice. Alice chooses a large prime p and a
primitive root α. 0<m<p.
Alice chooses a secret integer a such that 1<a<p-1 and calculate β≡αa (mod p) .
Values of p, α, β are made public. Alice keeps ‘a’ as secret. It is difficult to an
adversary to determine a from (p, α, β) since DLP is considered difficult.
Weakness: Let Alice used same value of k for message m1 and m2. If Eve finds out
plaintext m1 then Eve can determine m2 as- t1/m1≡βk ≡ t2/m2 (mod p).
RSA vs. ElGamal Cryptosystem
Thank You