Public-Key Cryptography: Dr. Amjad Ali Department of Computer Science COMSATS University Islamabad, Lahore Campus
Public-Key Cryptography: Dr. Amjad Ali Department of Computer Science COMSATS University Islamabad, Lahore Campus
Alice uses the key and the encryption method to encrypt (or encipher) a message and
sends it to Bob.
Bob uses the same key and the related decryption method to decrypt (or decipher) the
message.
Advantages of Classical Cryptography
There are some very fast classical encryption (and decryption) algorithms
Since the speed of a method varies with the length of the key, faster algorithms allow
one to use longer key values.
Larger key values make it harder to guess the key value -- and break the code -- by
brute force.
Disadvantages of Classical Cryptography
Bob can use Alice’s public key to encrypt a message for Alice.
Bob uses this key to encrypt his credit-card number and sends the
encrypted number to Alice.
Alice uses her private key to decrypt this message (and get Bob’s
credit-card number).
Hybrid Encryption Systems
Bob wants to order brownies from Alice and keep the entire
transaction private.
She can then send, or even broadcast, the document with the
encrypted digest.
Digital Signature Verification
Bob uses Alice’s public key to “decrypt” the digest that Alice
“encrypted” with her private key.
Bob applies the hash function to the document to obtain the digest
directly.
Bob compares these two values for the digest. If they match, it
proves that Alice signed the document and that no one else has
altered it.
Digital Signature : Signer and Verifier
Secure Transmission of Digitally Signed Documents
Bob uses his private key to decrypt the document. The result is
Alice’s digitally signed document.
1978: L.M Adleman, R.L. Rivest and A. Shamir propose the RSA
encryption method
Currently the most widely used
Basis for the spreadsheet used in the lab
RSA (Rivest-Shamir-Adleman):
Public-Private Key Encryption
Algorithm
RSA
▪ Invented by Rivest, Schamir and Adleman in 1977
▪ The speed of RSA does not beat DES, because DES is about 100
times faster than RSA in software.
RSA
▪ Step 1: Select two large prime numbers p and q.
▪ Step 4: Select the value Public Key “e” such that 1< e < ϕ (n)
e and ϕ (n) are coprime means the gcd (e, ϕ (n) =1)
Message m
Encryption Public key (e, n)
C ≡ me (mod n)
Decryption
m ≡ cd (mod n)
It is proved that
cd ≡ (me)d ≡ med ≡ m (mod n)
Due to the fact that ed ≡1 (mod ϕ (n))
RSA Example
If p = 17 and q = 31 are chosen, then
n= pq = 17x31 = 527