SlideShare a Scribd company logo
Information Security I
By
Fahad Layth Malallah
Reference Books:
1. Introduction to Computer Security, by Matt Bishop.
2. Security in Computing, 4th Edition, by Charls P. Pfleeger.
3. Principle of Computer Security. 2nd edition, by Arthur.
4th grade, Computer Science
Cihan University
First Semester, 2014-2015.
Lecture-W7-D1-D2.
1
4-Cryptography
A- Definitions.
B-Encryption and Decryption Definition(Symmetric & Asymmetric).
C-Classical Cryptosystems.
1- Transposition Ciphers (Permutation):
- Shuffling Scheme.
2- Substitution Ciphers :
- Caesar’s Cipher.
-Vigenère Cipher.
-One-Time Pad.
D-Symmetric Cryptography :
-Data Encryption Standard (DES) Algorithm.
E- Asymmetric Cryptography (Public-Key Systems):
1-Basic on modular arithmetic, Number Theory.
2-Modular arithmetic inverse computation.
3- Al-Gamal Algorithm (ciphering & de-ciphering).
4-RSA Algorithm (ciphering & de-ciphering).
Summary- Exercises.
2
-Aim of this lecture:
Students will be familiar and able to secure information by using:
E- Asymmetric Cryptography (Public-Key Systems):
1-Basic on modular arithmetic, Number Theory.
2-Modular arithmetic inverse computation.
3- Al-Gamal Algorithm (ciphering & de-ciphering).
4-RSA Algorithm (ciphering & de-ciphering).
3
4- RSA Algorithm (ciphering & de-ciphering).
• Three scientist have invented a security algorithm named it by
first character of their names:
• Adleman the mathematician.
• Rivest and Shamir the computer scientists.
– Alice must create a Public Key, which she can publish so that Bob (and
everyone else) can use it to encrypt messages to her. Because the
public key is a one way function, it must be virtually impossible for
anybody to reverse it and decrypt Alice’s message.
– However, Alice needs to decrypt the messages being sent to her. She
must therefore have a Private Key, which allows her to reverse the
effect of the Public Key.
– There is a mathematical relation between the Public Key and Private
Key, but if the Public Key is known the ability to find the Private Key is
zero, even if the mathematical relation is known!!!
4
Hard Mathematical Problem
• The concept HMP is best understood as a
mathematical problem which is computationally
infeasible to solve.
• The HMP is proven mathematically.
• Among the concepts that are HMP that we have
seen are:
– DLP (Discrete Logarithm Problem).
– Integer Factorization.
MCS 1413 - CRYPTOGRAPHY 5
RSA Algorithm:
6
Ali:
1-Alie encrypts M by
using public keys (e, n)as:
Bob:
1- chooses secret primes p and q and
computes n=pq .
2- chooses an exponent e as:
gcd( e, [p-1 ]. [q-1])= 1
3- then, computes d as :
de= 1 mod (p-1)(q-1)
4- Bob makes (p,q,d) public and keeps
(e,n) secret keys, then send only the
public to Ali….
5-Bob decrypts by computing .
Procedures is : Ali want to send a Secret message M to Bob. So , Ali
will encrypt a M and Bob will decrypt the message. Bob should
create a private key to decryption.
.
RSA numerical Example 1:
Part A wants to send a message M to Part B. encrypt the message
m=10 and decrypt the cipher c by using asymmetric cryptosystem
RSA. Let p = 7 and q = 13 be the two primes.
Solution:
1- Part B must select n= pq. and e where: gcd(e, [p-1][q-1])
n = pq = 91 and (p − 1)(q − 1) = 72.
To find e : gcd(e,72)=1 :
Choose e. Let’s look among the primes.
• Try e = 2. gcd(2, 72) = 2 (does not work)
• Try e = 3. gcd(3, 72) = 3 (does not work)
• Try e = 5. gcd(5, 72) = 1 (it works)
We choose e = 5. (e,n) is the public key
2- Part B also must find d (private key) next slides… 7
RSA numerical Example 1: Continue…
2- Part B also must find d (private key) by :
d.e = 1 mod (p-1) (q-1)  d.e=1 mod (7-1) (13-1)
d. 5 = 1 mod (6 ) (12)  d.5 = 1 mod 72
Now, we find multiplication inverse for 5 mod 72.
inverse equation: 1= ax + by a=5, b=72  1= 5x + 72 y.
1= (5*29) + (-2 * 72) correct.
Inverse(5)= 29.
29 = 1 mod 72
d=29.
Private key is 29. this should be kept with Part B for decryption. 8
RSA numerical Example 1: Continue…
3- Now, Part B sends the public key (e,n) and keeps the private key
(p,q,d).
4- Now, Part A encrypt the message m=10 as:
9
82
91mod10
mod
5



C
C
nMC e
5- Now , Part B will decrypt the C by using the private key 29
10
91mod82
mod
29



m
m
nCm d
-Summary
-Encryption and Decryption of Asymmetric cryptography of RSA
have been illustrated with an example.
10
-Exercises:
1-On which hard mathematical problem does RSA base its security?
2- Explain the ciphering and deciphering operations of RSA.
3-Compare between Al-Gamal and RSA .
4- In RSA, the cipher-text C = 9. The public key is given by n = 143 and
e = 23. In the following, we will try to crack the system and to
determine the original message M.
(i) What parameters comprises the public key and what parameters
the private key?.
(ii) What steps are necessary to determine the private key from the
public key?.
(iii) Determine the private key for the given system.
(iv) What is the original message M?.
5- Given p = 19, q = 29, N = pq and e = 17, compute the private key d
corresponding to the RSA system.
11
-Exercises:
6- Local Area Network uses a public key infrastructure based on RSA
with public key n =pq=55 and e=7.
(i) Find the private key d. For RSA we have de= 1 mod (p-1)(q-1)
(ii) Find the corresponding message M for a cipher C = 3.
7- Consider a RSA public-key system where the public key consists of
n = pq = 143 and e = 71.
A: Find a number d such that ed = 1 modulo (p-1)(q -1).
B: Give the decryption function for RSA.
C: Decrypt the cipher C = 12.
8-Alice has published her RSA public keys as <N; e> = <91;5>, where
N is the known public number and e is her public key. Accordingly,
Bob sent her the cipher text 81. Find the corresponding message.
12
-Exercises:
1-On which hard mathematical problem does RSA base its security?
1-discrete Logarithm Problem.
2- Number factorization.
2- Explain the ciphering and deciphering operations of RSA.
It is available in the lecture documents (slide 6).
3-Compare between Al-Gamal and RSA .
13
RSA Al-Gamal
Depend on DLP, Number factorization Depend on DLP
Cipher text size is the same as the message
size
Cipher text size is the double of message
size
Public key (n,e), private key= p,q, d. public key g,p,A private key: a
4- In RSA, the cipher-text C = 9. The public key is given by n = 143 and
e = 23. In the following, we will try to crack the system and to
determine the original message M.
(i) What parameters comprises the public key and what parameters
the private key?.
(ii) What steps are necessary to determine the private key from the
public key?.
(iii) Determine the private key for the given system.
(iv) What is the original message M?.
Sol:
1-Public key : n=143, e= 23. private key is d. ( d.e= 1 mod (p-1)(q-1))
2- d.e= 1 mod (p-1) (q-1), how do we find p & q.
Divide n by sqrt(n). Sqrt(143)= 11.9
143/3
143/7
143/11= 13 ok. Now p=11, q= 13 14
Now p=11, q= 13
d.23 = 1 mod (11-1) (13-1)  23. d= 1 mod 120
Now compute the inverse as 1 =ax + by : a= 23, b= 120
X= 47, y= -9 , the inverse is 47, so d= 47.
3- Original message is M
http://www.cs.princeton.edu/~dsri/modular-inversion.html
5- Given p = 19, q = 29, N = pq and e = 17, compute the private key d
corresponding to the RSA system.
Sol:
d.e = 1 mod (p-1)( q-1)  d. 17= 1 mod (19-1) (29-1)
15
46
143mod9
mod
47



M
M
nCM d
http://www.cs.princeton.edu/~dsri/modular-inversion.html
5- Given p = 19, q = 29, N = pq and e = 17, compute the private key d
corresponding to the RSA system.
Sol:
d.e = 1 mod (p-1)( q-1)  d. 17= 1 mod (19-1) (29-1)
17. d = 1 mod 504
Now, compute the inverse of d as:
1 = ax + by : a= 17, b= 504.
1= 17 x + 504 y
Now, compute q from gcd (504,17), then compute x(s) and y(s).
Finally: x= 89, y= -3.
Accordingly, the inverse d = 89.
16
6- Local Area Network uses a public key infrastructure based on RSA
with public key n =pq=55 and e=7.
(i) Find the private key d. For RSA we have de= 1 mod (p-1)(q-1)
(ii) Find the corresponding message M for a cipher C = 3.
Sol:
1- d.e= 1 mod (p-1) (q-1)  we have to find p & q.
So p= 11, q=5.
-To compute d: d. 7 = 1 mod (11-1) (5-1)  7.d =1 mod 40
-to compute inverse : 1= ax + by as a = 7, b= 40
- Compute x & y , x=-17 ,y= 3 d= (-17*1 + 40) mod 40 d= 23 17
11555
3.18355
4.755



6- Local Area Network uses a public key infrastructure based on RSA
with public key n =pq=55 and e=7.
(i) Find the private key d. For RSA we have de= 1 mod (p-1)(q-1)
(ii) Find the corresponding message M for a cipher C = 3.
Sol:
-Compute x & y , x=-17 ,y= 3 d= (-17*1 + 40) mod 40 d= 23
2-
18
27
55mod3
mod
23



M
M
nCM d
7- Consider a RSA public-key system where the public key consists of
n = pq = 143 and e = 71.
A: Find a number d such that ed = 1 modulo (p-1)(q -1).
B: Give the decryption function for RSA.
C: Decrypt the cipher C = 12.
Sol:
A- n=143=pq=11.13  d ed=1 mod (p-1)(q-1)
71. d = 1 mod (11-1)(13-1).  71 d = 1 mod 120
to compute the inverse 1= ax + by: a=71, b=120
So, x= -49 , y= 29.
d= 1 * -49 mod 120  d=71.
B-
C-
19
nCM d
mod
73
143mod1271


M
M
8-Alice has published her RSA public keys as <N; e> = <91;5>, where
N is the known public number and e is her public key. Accordingly,
Bob sent her the cipher text 81. Find the corresponding message.
Sol:
In order to find the message , we have to firstly find the private key
which is d.
d.e =1 mod (p-1) (q-1)  now we have to find q & p from n where
n=pq.
91= 7 . 13= p.q.
d.5 = 1 mod (7-1) (13-1)  5.d = 1 mod 72  by finding the inverse
so: d=29.
Now, apply the decryption rule 
20
5
91mod81
mod
29



M
M
nCM d

More Related Content

What's hot

DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentationDES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentation
sarhadisoftengg
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
Tirthika Bandi
 
block ciphers
block ciphersblock ciphers
block ciphers
Asad Ali
 
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
Arpana shree
 
The Cloud Cube
The Cloud CubeThe Cloud Cube
The Cloud Cube
Adrius42
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
Dr.Florence Dayana
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
Srilal Buddika
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
Krishna Gehlot
 
Key management
Key managementKey management
Key management
Sujata Regoti
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
Subrata Kumer Paul
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
Devakumar Kp
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
patisa
 
Feistel cipher
Feistel cipherFeistel cipher
Feistel cipher
MDKAWSARAHMEDSAGAR
 
ElGamal Encryption Algoritham.pptx
ElGamal Encryption Algoritham.pptxElGamal Encryption Algoritham.pptx
ElGamal Encryption Algoritham.pptx
Indian Institute of information technology Una
 
Seminar on Chaos Based Cryptography
Seminar on Chaos Based CryptographySeminar on Chaos Based Cryptography
Seminar on Chaos Based Cryptography
Muhammad Hamid
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
Sunita Kharayat
 
Basic cryptography
Basic cryptographyBasic cryptography
Basic cryptography
Perfect Training Center
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
Amlan Patel
 
Random Oracle Model & Hashing - Cryptography & Network Security
Random Oracle Model & Hashing - Cryptography & Network SecurityRandom Oracle Model & Hashing - Cryptography & Network Security
Random Oracle Model & Hashing - Cryptography & Network Security
Mahbubur Rahman
 
Information and data security digital signatures
Information and data security digital signaturesInformation and data security digital signatures
Information and data security digital signatures
Mazin Alwaaly
 

What's hot (20)

DES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentationDES (Data Encryption Standard) pressentation
DES (Data Encryption Standard) pressentation
 
Message digest 5
Message digest 5Message digest 5
Message digest 5
 
block ciphers
block ciphersblock ciphers
block ciphers
 
RSA algorithm
RSA algorithmRSA algorithm
RSA algorithm
 
The Cloud Cube
The Cloud CubeThe Cloud Cube
The Cloud Cube
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
Key management
Key managementKey management
Key management
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 
Cryptography and network security
Cryptography and network securityCryptography and network security
Cryptography and network security
 
Feistel cipher
Feistel cipherFeistel cipher
Feistel cipher
 
ElGamal Encryption Algoritham.pptx
ElGamal Encryption Algoritham.pptxElGamal Encryption Algoritham.pptx
ElGamal Encryption Algoritham.pptx
 
Seminar on Chaos Based Cryptography
Seminar on Chaos Based CryptographySeminar on Chaos Based Cryptography
Seminar on Chaos Based Cryptography
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
Basic cryptography
Basic cryptographyBasic cryptography
Basic cryptography
 
Rsa Crptosystem
Rsa CrptosystemRsa Crptosystem
Rsa Crptosystem
 
Random Oracle Model & Hashing - Cryptography & Network Security
Random Oracle Model & Hashing - Cryptography & Network SecurityRandom Oracle Model & Hashing - Cryptography & Network Security
Random Oracle Model & Hashing - Cryptography & Network Security
 
Information and data security digital signatures
Information and data security digital signaturesInformation and data security digital signatures
Information and data security digital signatures
 

Similar to RSA-W7(rsa) d1-d2

Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
Abhishek Gautam
 
Public-Key Cryptography.pdfWrite the result of the following operation with t...
Public-Key Cryptography.pdfWrite the result of the following operation with t...Public-Key Cryptography.pdfWrite the result of the following operation with t...
Public-Key Cryptography.pdfWrite the result of the following operation with t...
FahmiOlayah
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
rameshvvv
 
PKC&RSA
PKC&RSAPKC&RSA
PKC&RSA
Anver S R
 
Unit 3
Unit 3Unit 3
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
Vaibhav Khanna
 
1508.07756v1
1508.07756v11508.07756v1
1508.07756v1
Samir Crypticus
 
RSA Algorithm.ppt
RSA Algorithm.pptRSA Algorithm.ppt
RSA Algorithm.ppt
ArchanaT30
 
Rsa
RsaRsa
An implementation of RSA policy
An implementation of RSA policyAn implementation of RSA policy
An implementation of RSA policy
SM NAZMUS SALEHIN
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
werip98386
 
RSA
RSARSA
Rsa
RsaRsa
Rsa
RsaRsa
CRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
BhuvanaR13
 
F010243136
F010243136F010243136
F010243136
IOSR Journals
 
Cupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829aCupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829a
jsk1950
 
RSA
RSARSA
RSA & MD5 algorithm
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithm
Siva Rushi
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
ChandraB15
 

Similar to RSA-W7(rsa) d1-d2 (20)

Rsa cryptosystem
Rsa cryptosystemRsa cryptosystem
Rsa cryptosystem
 
Public-Key Cryptography.pdfWrite the result of the following operation with t...
Public-Key Cryptography.pdfWrite the result of the following operation with t...Public-Key Cryptography.pdfWrite the result of the following operation with t...
Public-Key Cryptography.pdfWrite the result of the following operation with t...
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
 
PKC&RSA
PKC&RSAPKC&RSA
PKC&RSA
 
Unit 3
Unit 3Unit 3
Unit 3
 
Information and network security 33 rsa algorithm
Information and network security 33 rsa algorithmInformation and network security 33 rsa algorithm
Information and network security 33 rsa algorithm
 
1508.07756v1
1508.07756v11508.07756v1
1508.07756v1
 
RSA Algorithm.ppt
RSA Algorithm.pptRSA Algorithm.ppt
RSA Algorithm.ppt
 
Rsa
RsaRsa
Rsa
 
An implementation of RSA policy
An implementation of RSA policyAn implementation of RSA policy
An implementation of RSA policy
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptxRivest Shamir Adleman Algorithm and its variant : DRSA.pptx
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
 
RSA
RSARSA
RSA
 
Rsa
RsaRsa
Rsa
 
Rsa
RsaRsa
Rsa
 
CRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdfCRYPTOGRAPHY (2).pdf
CRYPTOGRAPHY (2).pdf
 
F010243136
F010243136F010243136
F010243136
 
Cupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829aCupdf.com public key-cryptography-569692953829a
Cupdf.com public key-cryptography-569692953829a
 
RSA
RSARSA
RSA
 
RSA & MD5 algorithm
RSA & MD5 algorithmRSA & MD5 algorithm
RSA & MD5 algorithm
 
ch09_rsa_nemo.ppt
ch09_rsa_nemo.pptch09_rsa_nemo.ppt
ch09_rsa_nemo.ppt
 

Recently uploaded

Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
PirithiRaju
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
İsa Badur
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR
 
Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...
Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...
Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...
frank0071
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
Sérgio Sacani
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
RitabrataSarkar3
 
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
Advanced-Concepts-Team
 
HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1
Shashank Shekhar Pandey
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
Anagha Prasad
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
Areesha Ahmad
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
Sérgio Sacani
 
Pests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdfPests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdf
PirithiRaju
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
Scintica Instrumentation
 
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills MN
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
Vandana Devesh Sharma
 
Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.
Aditi Bajpai
 
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdfMending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Selcen Ozturkcan
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
vluwdy49
 
Basics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different formsBasics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different forms
MaheshaNanjegowda
 

Recently uploaded (20)

Gadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdfGadgets for management of stored product pests_Dr.UPR.pdf
Gadgets for management of stored product pests_Dr.UPR.pdf
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
aziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobelaziz sancar nobel prize winner: from mardin to nobel
aziz sancar nobel prize winner: from mardin to nobel
 
AJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdfAJAY KUMAR NIET GreNo Guava Project File.pdf
AJAY KUMAR NIET GreNo Guava Project File.pdf
 
Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...
Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...
Juaristi, Jon. - El canon espanol. El legado de la cultura española a la civi...
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
 
Eukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptxEukaryotic Transcription Presentation.pptx
Eukaryotic Transcription Presentation.pptx
 
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
ESA/ACT Science Coffee: Diego Blas - Gravitational wave detection with orbita...
 
HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1HOW DO ORGANISMS REPRODUCE?reproduction part 1
HOW DO ORGANISMS REPRODUCE?reproduction part 1
 
molar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptxmolar-distalization in orthodontics-seminar.pptx
molar-distalization in orthodontics-seminar.pptx
 
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of ProteinsGBSN - Biochemistry (Unit 6) Chemistry of Proteins
GBSN - Biochemistry (Unit 6) Chemistry of Proteins
 
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
EWOCS-I: The catalog of X-ray sources in Westerlund 1 from the Extended Weste...
 
Pests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdfPests of Storage_Identification_Dr.UPR.pdf
Pests of Storage_Identification_Dr.UPR.pdf
 
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
(June 12, 2024) Webinar: Development of PET theranostics targeting the molecu...
 
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
Travis Hills of MN is Making Clean Water Accessible to All Through High Flux ...
 
Compexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titrationCompexometric titration/Chelatorphy titration/chelating titration
Compexometric titration/Chelatorphy titration/chelating titration
 
Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.Micronuclei test.M.sc.zoology.fisheries.
Micronuclei test.M.sc.zoology.fisheries.
 
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdfMending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
Mending Clothing to Support Sustainable Fashion_CIMaR 2024.pdf
 
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
在线办理(salfor毕业证书)索尔福德大学毕业证毕业完成信一模一样
 
Basics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different formsBasics of crystallography, crystal systems, classes and different forms
Basics of crystallography, crystal systems, classes and different forms
 

RSA-W7(rsa) d1-d2

  • 1. Information Security I By Fahad Layth Malallah Reference Books: 1. Introduction to Computer Security, by Matt Bishop. 2. Security in Computing, 4th Edition, by Charls P. Pfleeger. 3. Principle of Computer Security. 2nd edition, by Arthur. 4th grade, Computer Science Cihan University First Semester, 2014-2015. Lecture-W7-D1-D2. 1
  • 2. 4-Cryptography A- Definitions. B-Encryption and Decryption Definition(Symmetric & Asymmetric). C-Classical Cryptosystems. 1- Transposition Ciphers (Permutation): - Shuffling Scheme. 2- Substitution Ciphers : - Caesar’s Cipher. -Vigenère Cipher. -One-Time Pad. D-Symmetric Cryptography : -Data Encryption Standard (DES) Algorithm. E- Asymmetric Cryptography (Public-Key Systems): 1-Basic on modular arithmetic, Number Theory. 2-Modular arithmetic inverse computation. 3- Al-Gamal Algorithm (ciphering & de-ciphering). 4-RSA Algorithm (ciphering & de-ciphering). Summary- Exercises. 2
  • 3. -Aim of this lecture: Students will be familiar and able to secure information by using: E- Asymmetric Cryptography (Public-Key Systems): 1-Basic on modular arithmetic, Number Theory. 2-Modular arithmetic inverse computation. 3- Al-Gamal Algorithm (ciphering & de-ciphering). 4-RSA Algorithm (ciphering & de-ciphering). 3
  • 4. 4- RSA Algorithm (ciphering & de-ciphering). • Three scientist have invented a security algorithm named it by first character of their names: • Adleman the mathematician. • Rivest and Shamir the computer scientists. – Alice must create a Public Key, which she can publish so that Bob (and everyone else) can use it to encrypt messages to her. Because the public key is a one way function, it must be virtually impossible for anybody to reverse it and decrypt Alice’s message. – However, Alice needs to decrypt the messages being sent to her. She must therefore have a Private Key, which allows her to reverse the effect of the Public Key. – There is a mathematical relation between the Public Key and Private Key, but if the Public Key is known the ability to find the Private Key is zero, even if the mathematical relation is known!!! 4
  • 5. Hard Mathematical Problem • The concept HMP is best understood as a mathematical problem which is computationally infeasible to solve. • The HMP is proven mathematically. • Among the concepts that are HMP that we have seen are: – DLP (Discrete Logarithm Problem). – Integer Factorization. MCS 1413 - CRYPTOGRAPHY 5
  • 6. RSA Algorithm: 6 Ali: 1-Alie encrypts M by using public keys (e, n)as: Bob: 1- chooses secret primes p and q and computes n=pq . 2- chooses an exponent e as: gcd( e, [p-1 ]. [q-1])= 1 3- then, computes d as : de= 1 mod (p-1)(q-1) 4- Bob makes (p,q,d) public and keeps (e,n) secret keys, then send only the public to Ali…. 5-Bob decrypts by computing . Procedures is : Ali want to send a Secret message M to Bob. So , Ali will encrypt a M and Bob will decrypt the message. Bob should create a private key to decryption. .
  • 7. RSA numerical Example 1: Part A wants to send a message M to Part B. encrypt the message m=10 and decrypt the cipher c by using asymmetric cryptosystem RSA. Let p = 7 and q = 13 be the two primes. Solution: 1- Part B must select n= pq. and e where: gcd(e, [p-1][q-1]) n = pq = 91 and (p − 1)(q − 1) = 72. To find e : gcd(e,72)=1 : Choose e. Let’s look among the primes. • Try e = 2. gcd(2, 72) = 2 (does not work) • Try e = 3. gcd(3, 72) = 3 (does not work) • Try e = 5. gcd(5, 72) = 1 (it works) We choose e = 5. (e,n) is the public key 2- Part B also must find d (private key) next slides… 7
  • 8. RSA numerical Example 1: Continue… 2- Part B also must find d (private key) by : d.e = 1 mod (p-1) (q-1)  d.e=1 mod (7-1) (13-1) d. 5 = 1 mod (6 ) (12)  d.5 = 1 mod 72 Now, we find multiplication inverse for 5 mod 72. inverse equation: 1= ax + by a=5, b=72  1= 5x + 72 y. 1= (5*29) + (-2 * 72) correct. Inverse(5)= 29. 29 = 1 mod 72 d=29. Private key is 29. this should be kept with Part B for decryption. 8
  • 9. RSA numerical Example 1: Continue… 3- Now, Part B sends the public key (e,n) and keeps the private key (p,q,d). 4- Now, Part A encrypt the message m=10 as: 9 82 91mod10 mod 5    C C nMC e 5- Now , Part B will decrypt the C by using the private key 29 10 91mod82 mod 29    m m nCm d
  • 10. -Summary -Encryption and Decryption of Asymmetric cryptography of RSA have been illustrated with an example. 10
  • 11. -Exercises: 1-On which hard mathematical problem does RSA base its security? 2- Explain the ciphering and deciphering operations of RSA. 3-Compare between Al-Gamal and RSA . 4- In RSA, the cipher-text C = 9. The public key is given by n = 143 and e = 23. In the following, we will try to crack the system and to determine the original message M. (i) What parameters comprises the public key and what parameters the private key?. (ii) What steps are necessary to determine the private key from the public key?. (iii) Determine the private key for the given system. (iv) What is the original message M?. 5- Given p = 19, q = 29, N = pq and e = 17, compute the private key d corresponding to the RSA system. 11
  • 12. -Exercises: 6- Local Area Network uses a public key infrastructure based on RSA with public key n =pq=55 and e=7. (i) Find the private key d. For RSA we have de= 1 mod (p-1)(q-1) (ii) Find the corresponding message M for a cipher C = 3. 7- Consider a RSA public-key system where the public key consists of n = pq = 143 and e = 71. A: Find a number d such that ed = 1 modulo (p-1)(q -1). B: Give the decryption function for RSA. C: Decrypt the cipher C = 12. 8-Alice has published her RSA public keys as <N; e> = <91;5>, where N is the known public number and e is her public key. Accordingly, Bob sent her the cipher text 81. Find the corresponding message. 12
  • 13. -Exercises: 1-On which hard mathematical problem does RSA base its security? 1-discrete Logarithm Problem. 2- Number factorization. 2- Explain the ciphering and deciphering operations of RSA. It is available in the lecture documents (slide 6). 3-Compare between Al-Gamal and RSA . 13 RSA Al-Gamal Depend on DLP, Number factorization Depend on DLP Cipher text size is the same as the message size Cipher text size is the double of message size Public key (n,e), private key= p,q, d. public key g,p,A private key: a
  • 14. 4- In RSA, the cipher-text C = 9. The public key is given by n = 143 and e = 23. In the following, we will try to crack the system and to determine the original message M. (i) What parameters comprises the public key and what parameters the private key?. (ii) What steps are necessary to determine the private key from the public key?. (iii) Determine the private key for the given system. (iv) What is the original message M?. Sol: 1-Public key : n=143, e= 23. private key is d. ( d.e= 1 mod (p-1)(q-1)) 2- d.e= 1 mod (p-1) (q-1), how do we find p & q. Divide n by sqrt(n). Sqrt(143)= 11.9 143/3 143/7 143/11= 13 ok. Now p=11, q= 13 14
  • 15. Now p=11, q= 13 d.23 = 1 mod (11-1) (13-1)  23. d= 1 mod 120 Now compute the inverse as 1 =ax + by : a= 23, b= 120 X= 47, y= -9 , the inverse is 47, so d= 47. 3- Original message is M http://www.cs.princeton.edu/~dsri/modular-inversion.html 5- Given p = 19, q = 29, N = pq and e = 17, compute the private key d corresponding to the RSA system. Sol: d.e = 1 mod (p-1)( q-1)  d. 17= 1 mod (19-1) (29-1) 15 46 143mod9 mod 47    M M nCM d
  • 16. http://www.cs.princeton.edu/~dsri/modular-inversion.html 5- Given p = 19, q = 29, N = pq and e = 17, compute the private key d corresponding to the RSA system. Sol: d.e = 1 mod (p-1)( q-1)  d. 17= 1 mod (19-1) (29-1) 17. d = 1 mod 504 Now, compute the inverse of d as: 1 = ax + by : a= 17, b= 504. 1= 17 x + 504 y Now, compute q from gcd (504,17), then compute x(s) and y(s). Finally: x= 89, y= -3. Accordingly, the inverse d = 89. 16
  • 17. 6- Local Area Network uses a public key infrastructure based on RSA with public key n =pq=55 and e=7. (i) Find the private key d. For RSA we have de= 1 mod (p-1)(q-1) (ii) Find the corresponding message M for a cipher C = 3. Sol: 1- d.e= 1 mod (p-1) (q-1)  we have to find p & q. So p= 11, q=5. -To compute d: d. 7 = 1 mod (11-1) (5-1)  7.d =1 mod 40 -to compute inverse : 1= ax + by as a = 7, b= 40 - Compute x & y , x=-17 ,y= 3 d= (-17*1 + 40) mod 40 d= 23 17 11555 3.18355 4.755   
  • 18. 6- Local Area Network uses a public key infrastructure based on RSA with public key n =pq=55 and e=7. (i) Find the private key d. For RSA we have de= 1 mod (p-1)(q-1) (ii) Find the corresponding message M for a cipher C = 3. Sol: -Compute x & y , x=-17 ,y= 3 d= (-17*1 + 40) mod 40 d= 23 2- 18 27 55mod3 mod 23    M M nCM d
  • 19. 7- Consider a RSA public-key system where the public key consists of n = pq = 143 and e = 71. A: Find a number d such that ed = 1 modulo (p-1)(q -1). B: Give the decryption function for RSA. C: Decrypt the cipher C = 12. Sol: A- n=143=pq=11.13  d ed=1 mod (p-1)(q-1) 71. d = 1 mod (11-1)(13-1).  71 d = 1 mod 120 to compute the inverse 1= ax + by: a=71, b=120 So, x= -49 , y= 29. d= 1 * -49 mod 120  d=71. B- C- 19 nCM d mod 73 143mod1271   M M
  • 20. 8-Alice has published her RSA public keys as <N; e> = <91;5>, where N is the known public number and e is her public key. Accordingly, Bob sent her the cipher text 81. Find the corresponding message. Sol: In order to find the message , we have to firstly find the private key which is d. d.e =1 mod (p-1) (q-1)  now we have to find q & p from n where n=pq. 91= 7 . 13= p.q. d.5 = 1 mod (7-1) (13-1)  5.d = 1 mod 72  by finding the inverse so: d=29. Now, apply the decryption rule  20 5 91mod81 mod 29    M M nCM d

Editor's Notes

  1. Model of security: policies of securities
  2. Model of security: policies of securities
  3. Factorization of big numbers Finding big prime numbers Multiplication of big prime numbers Exponentiation of big numbers Computing discrete logarithms.
  4. Factorization of big numbers Finding big prime numbers Multiplication of big prime numbers Exponentiation of big numbers Computing discrete logarithms.