SlideShare a Scribd company logo
1 of 23
Lec-5: Cryptography & Network
Security
Mr. Islahuddin Jalal
MS (Cyber Security) – UKM Malaysia
Research Title – 3C-CSIRT Model for Afghanistan
BAKHTAR UNIVERSITY ‫باخترپوهنتون‬ ‫د‬
Bakhtar University 1
Asymmetric Cryptography
Bakhtar University 2
Problems in symmetric cryptography
• Key distribution
• Two communicants already share a key by the use of ( KDC)
• Neglected the essence of cryptography (Diffie and Martin Hellman)
• Verifying a message comes intact from the claimed sender
Bakhtar University 3
Public-Key Characteristics
1. Computationally infeasible to find decryption key
• Knowing only algorithm and encryption key
2. Computationally easy to en/decrypt messages
• When the relevant en/decrypt key is known either of the two related keys can
be used for encryption, with other used for decryption
Bakhtar University 4
In Symmetric Cryptography
• If Alice and Bob are physically apart and communicate, they have to
agree on a key Meet personally, or Use trusted couriers
• Alice needs one secret key for Bob, one for Carol, one for Dave and so
on. This means that Storage of so many secret keys is not feasible.
Bakhtar University 5
In Asymmetric Key Cryptography
• 2 people who never met can communicate securely. Alice can
securely communicate with all her friends by storing just a single
private key. 2 keys are used
• Public: known to everyone (for encryption or signature verification)
• Private: known to receiver only (for decryption or signature
generation)
Bakhtar University 6
Public-Key Cryptography
• Y = E(PUb, X )
• X = D(PRb, Y )
• Adversary can access PUb and Y, attempt to recover X or PRb;
Impossible to alter the message without access to A’s private key.
• Authenticate the source. Ensure data integrity. Authentication and
Confidentiality.
• Z = E(PUb, E(PRa, X))
• X = D(PUa, E(PRb, Z))
• Overhead: public key algorithm executed four times
Bakhtar University 7
Public-Key Applications
• Classify uses into 3 categories
• Encryption/Decryption (provide secrecy)
• Digital Signatures (provide authentication)
• Key Exchange (of session keys)
Bakhtar University 8
Example: Party A wants to send a message to party B
• When only confidentiality is needed
Bakhtar University 9
Example: Party A wants to send a message to party B
• When only authentication is needed
Bakhtar University 10
Example: Party A wants to send a message to party B
• When confidentiality and authentication are needed
Bakhtar University 11
Type of Public-key cryptography
•RSA
Bakhtar University 12
RSA
• by Rivest, Shamir & Adleman of MIT in 1977
• best known & widely used public-key scheme
• Block cipher scheme: plaintext and ciphertext are integer b/w 0 to n-1
for some n.
• uses large integers (eg. 1024 bits)
• security due to cost of factoring large numbers
12/1/2017 Bakhtar University 13
RSA Key Setup
• each user generates a public/private key pair by:
• selecting two large primes at random - p, q
• computing their system modulus N=p.q
• note ø(N)=(p-1)(q-1)
• selecting at random the encryption key e
• where 1<e<ø(N), gcd(e,ø(N))=1
• solve following equation to find decryption key d
• e.d=1 mod ø(N) and 0≤d≤N
• publish their public encryption key: KU={e,N}
• keep secret private decryption key: KR={d,p,q}
12/1/2017 Bakhtar University 14
RSA Use
• to encrypt a message M the sender:
• obtains public key of recipient KU={e,N}
• computes: C=Me mod N, where 0≤M<N
• to decrypt the ciphertext C the owner:
• uses their private key KR={d,p,q}
• computes: M=Cd mod N
• note that the message M must be smaller than the modulus N (block
if needed)
12/1/2017 Bakhtar University 15
RSA Example
1. Select primes: p=17 & q=11
2. Compute n = pq =17×11=187
3. Compute ø(n)=(p–1)(q-1)=16×10=160
4. Select e : gcd(e,160)=1; choose e=7
5. Determine d: de=1 mod 160 and d < 160 Value is d=23 since
23×7=161= (1×160)+1
6. Publish public key KU={7,187}
7. Keep secret private key KR={23,17,11}
12/1/2017 Bakhtar University 16
RSA Example cont
• sample RSA encryption/decryption is:
• given message M = 88 (nb. 88<187)
• encryption:
C = 887 mod 187 = 11
• decryption:
M = 1123 mod 187 = 88
12/1/2017 Bakhtar University 17
RSA Key Generation
• Select p, q
• Calculate n=p x q
• Calculate ǿ(n)= (p-1)(q-1)
• Select integer e gcd(ǿ(n), e) =1; 1< e < ǿ(n)
• Calculate d d e-1 mod(ǿ(n))
• Public Key PU= {e, n}
• Private Key PR={d,n}
12/1/2017 Bakhtar University 18
Encryption by Bob with Alice’s Public Key
• Plaintext M<N
• Ciphertext: C=Me mod n
12/1/2017 Bakhtar University 19
Decryption by Alice with Alice’s private key
• Ciphertext: C
• Plaintext: M=Cd mod n
12/1/2017 Bakhtar University 20
RSA General Approach
Bakhtar University 21
RSA Example
Bakhtar University 22
Thank You
For Your Patience
Bakhtar University 23

More Related Content

What's hot

Conventional Encryption NS2
Conventional Encryption NS2Conventional Encryption NS2
Conventional Encryption NS2
koolkampus
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3
koolkampus
 

What's hot (20)

Public Key Encryption & Hash functions
Public Key Encryption & Hash functionsPublic Key Encryption & Hash functions
Public Key Encryption & Hash functions
 
CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Cryptography
Cryptography Cryptography
Cryptography
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Conventional Encryption NS2
Conventional Encryption NS2Conventional Encryption NS2
Conventional Encryption NS2
 
Is case study
Is   case studyIs   case study
Is case study
 
3 public key cryptography
3 public key cryptography3 public key cryptography
3 public key cryptography
 
Security and Cryptography
Security and CryptographySecurity and Cryptography
Security and Cryptography
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
Encryption/Decryption Algorithm for Devanagri Script(Affine Cipher)
 
Overview on Cryptography and Network Security
Overview on Cryptography and Network SecurityOverview on Cryptography and Network Security
Overview on Cryptography and Network Security
 
Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3Cryptography and Message Authentication NS3
Cryptography and Message Authentication NS3
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITYCS6701 CRYPTOGRAPHY AND NETWORK SECURITY
CS6701 CRYPTOGRAPHY AND NETWORK SECURITY
 
Principles of public key cryptography and its Uses
Principles of  public key cryptography and its UsesPrinciples of  public key cryptography and its Uses
Principles of public key cryptography and its Uses
 
Sunanda cryptography ppt
Sunanda cryptography pptSunanda cryptography ppt
Sunanda cryptography ppt
 
Ppt cns
Ppt cnsPpt cns
Ppt cns
 

Similar to Cryptography and Network security # Lecture 5

Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
rameshvvv
 

Similar to Cryptography and Network security # Lecture 5 (20)

Ch9
Ch9Ch9
Ch9
 
RSA
RSARSA
RSA
 
Public-Key Cryptography.pptx
Public-Key Cryptography.pptxPublic-Key Cryptography.pptx
Public-Key Cryptography.pptx
 
3 pkc+rsa
3 pkc+rsa3 pkc+rsa
3 pkc+rsa
 
Pooguzhali
PooguzhaliPooguzhali
Pooguzhali
 
UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
RSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key CryptographyRSA Algorithm - Public Key Cryptography
RSA Algorithm - Public Key Cryptography
 
Rsa
RsaRsa
Rsa
 
Module2.pptx
Module2.pptxModule2.pptx
Module2.pptx
 
Vtu network security(10 ec832) unit 3 notes.
Vtu network security(10 ec832) unit 3 notes.Vtu network security(10 ec832) unit 3 notes.
Vtu network security(10 ec832) unit 3 notes.
 
CNS.ppt
CNS.pptCNS.ppt
CNS.ppt
 
Ch09
Ch09Ch09
Ch09
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptxUnit-III_3R-CRYPTO_2021-22_VSM.pptx
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
 
Rsa and diffie hellman algorithms
Rsa and diffie hellman algorithmsRsa and diffie hellman algorithms
Rsa and diffie hellman algorithms
 
Rsa
RsaRsa
Rsa
 
Cyptography and network security unit 3-1
Cyptography and network security unit 3-1Cyptography and network security unit 3-1
Cyptography and network security unit 3-1
 
Rsa
RsaRsa
Rsa
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 

More from Kabul Education University

More from Kabul Education University (20)

Cryptography and Network security # Lecture 8
Cryptography and Network security # Lecture 8Cryptography and Network security # Lecture 8
Cryptography and Network security # Lecture 8
 
ITIL # Lecture 9
ITIL # Lecture 9ITIL # Lecture 9
ITIL # Lecture 9
 
ITIL # Lecture 8
ITIL # Lecture 8ITIL # Lecture 8
ITIL # Lecture 8
 
Cryptography and Network security # Lecture 6
Cryptography and Network security # Lecture 6Cryptography and Network security # Lecture 6
Cryptography and Network security # Lecture 6
 
ITIL # Lecture 7
ITIL # Lecture 7ITIL # Lecture 7
ITIL # Lecture 7
 
Cyber Security # Lec 5
Cyber Security # Lec 5Cyber Security # Lec 5
Cyber Security # Lec 5
 
ITIL # Lecture 6
ITIL # Lecture 6ITIL # Lecture 6
ITIL # Lecture 6
 
Cyber Security # Lec 4
Cyber Security # Lec 4 Cyber Security # Lec 4
Cyber Security # Lec 4
 
ITIL # Lecture 5
ITIL # Lecture 5ITIL # Lecture 5
ITIL # Lecture 5
 
Cyber Security # Lec 3
Cyber Security # Lec 3 Cyber Security # Lec 3
Cyber Security # Lec 3
 
ITIL # Lecture 4
ITIL # Lecture 4ITIL # Lecture 4
ITIL # Lecture 4
 
Cyber Security # Lec 2
Cyber Security # Lec 2Cyber Security # Lec 2
Cyber Security # Lec 2
 
ITIL # Lecture 3
ITIL # Lecture 3ITIL # Lecture 3
ITIL # Lecture 3
 
Cryptography and Network security # Lecture 3
Cryptography and Network security # Lecture 3Cryptography and Network security # Lecture 3
Cryptography and Network security # Lecture 3
 
ITIL # Lecture 2
ITIL # Lecture 2ITIL # Lecture 2
ITIL # Lecture 2
 
Cryptography and Network Security # Lecture 2
Cryptography and Network Security # Lecture 2Cryptography and Network Security # Lecture 2
Cryptography and Network Security # Lecture 2
 
ITIL # Lecture 1
ITIL # Lecture 1ITIL # Lecture 1
ITIL # Lecture 1
 
Network security # Lecture 2
Network security # Lecture 2Network security # Lecture 2
Network security # Lecture 2
 
Network security # Lecture 1
Network security # Lecture 1Network security # Lecture 1
Network security # Lecture 1
 
Cyber security # Lec 1
Cyber security # Lec 1Cyber security # Lec 1
Cyber security # Lec 1
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Buy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptxBuy Epson EcoTank L3210 Colour Printer Online.pptx
Buy Epson EcoTank L3210 Colour Printer Online.pptx
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 

Cryptography and Network security # Lecture 5

  • 1. Lec-5: Cryptography & Network Security Mr. Islahuddin Jalal MS (Cyber Security) – UKM Malaysia Research Title – 3C-CSIRT Model for Afghanistan BAKHTAR UNIVERSITY ‫باخترپوهنتون‬ ‫د‬ Bakhtar University 1
  • 3. Problems in symmetric cryptography • Key distribution • Two communicants already share a key by the use of ( KDC) • Neglected the essence of cryptography (Diffie and Martin Hellman) • Verifying a message comes intact from the claimed sender Bakhtar University 3
  • 4. Public-Key Characteristics 1. Computationally infeasible to find decryption key • Knowing only algorithm and encryption key 2. Computationally easy to en/decrypt messages • When the relevant en/decrypt key is known either of the two related keys can be used for encryption, with other used for decryption Bakhtar University 4
  • 5. In Symmetric Cryptography • If Alice and Bob are physically apart and communicate, they have to agree on a key Meet personally, or Use trusted couriers • Alice needs one secret key for Bob, one for Carol, one for Dave and so on. This means that Storage of so many secret keys is not feasible. Bakhtar University 5
  • 6. In Asymmetric Key Cryptography • 2 people who never met can communicate securely. Alice can securely communicate with all her friends by storing just a single private key. 2 keys are used • Public: known to everyone (for encryption or signature verification) • Private: known to receiver only (for decryption or signature generation) Bakhtar University 6
  • 7. Public-Key Cryptography • Y = E(PUb, X ) • X = D(PRb, Y ) • Adversary can access PUb and Y, attempt to recover X or PRb; Impossible to alter the message without access to A’s private key. • Authenticate the source. Ensure data integrity. Authentication and Confidentiality. • Z = E(PUb, E(PRa, X)) • X = D(PUa, E(PRb, Z)) • Overhead: public key algorithm executed four times Bakhtar University 7
  • 8. Public-Key Applications • Classify uses into 3 categories • Encryption/Decryption (provide secrecy) • Digital Signatures (provide authentication) • Key Exchange (of session keys) Bakhtar University 8
  • 9. Example: Party A wants to send a message to party B • When only confidentiality is needed Bakhtar University 9
  • 10. Example: Party A wants to send a message to party B • When only authentication is needed Bakhtar University 10
  • 11. Example: Party A wants to send a message to party B • When confidentiality and authentication are needed Bakhtar University 11
  • 12. Type of Public-key cryptography •RSA Bakhtar University 12
  • 13. RSA • by Rivest, Shamir & Adleman of MIT in 1977 • best known & widely used public-key scheme • Block cipher scheme: plaintext and ciphertext are integer b/w 0 to n-1 for some n. • uses large integers (eg. 1024 bits) • security due to cost of factoring large numbers 12/1/2017 Bakhtar University 13
  • 14. RSA Key Setup • each user generates a public/private key pair by: • selecting two large primes at random - p, q • computing their system modulus N=p.q • note ø(N)=(p-1)(q-1) • selecting at random the encryption key e • where 1<e<ø(N), gcd(e,ø(N))=1 • solve following equation to find decryption key d • e.d=1 mod ø(N) and 0≤d≤N • publish their public encryption key: KU={e,N} • keep secret private decryption key: KR={d,p,q} 12/1/2017 Bakhtar University 14
  • 15. RSA Use • to encrypt a message M the sender: • obtains public key of recipient KU={e,N} • computes: C=Me mod N, where 0≤M<N • to decrypt the ciphertext C the owner: • uses their private key KR={d,p,q} • computes: M=Cd mod N • note that the message M must be smaller than the modulus N (block if needed) 12/1/2017 Bakhtar University 15
  • 16. RSA Example 1. Select primes: p=17 & q=11 2. Compute n = pq =17×11=187 3. Compute ø(n)=(p–1)(q-1)=16×10=160 4. Select e : gcd(e,160)=1; choose e=7 5. Determine d: de=1 mod 160 and d < 160 Value is d=23 since 23×7=161= (1×160)+1 6. Publish public key KU={7,187} 7. Keep secret private key KR={23,17,11} 12/1/2017 Bakhtar University 16
  • 17. RSA Example cont • sample RSA encryption/decryption is: • given message M = 88 (nb. 88<187) • encryption: C = 887 mod 187 = 11 • decryption: M = 1123 mod 187 = 88 12/1/2017 Bakhtar University 17
  • 18. RSA Key Generation • Select p, q • Calculate n=p x q • Calculate ǿ(n)= (p-1)(q-1) • Select integer e gcd(ǿ(n), e) =1; 1< e < ǿ(n) • Calculate d d e-1 mod(ǿ(n)) • Public Key PU= {e, n} • Private Key PR={d,n} 12/1/2017 Bakhtar University 18
  • 19. Encryption by Bob with Alice’s Public Key • Plaintext M<N • Ciphertext: C=Me mod n 12/1/2017 Bakhtar University 19
  • 20. Decryption by Alice with Alice’s private key • Ciphertext: C • Plaintext: M=Cd mod n 12/1/2017 Bakhtar University 20
  • 23. Thank You For Your Patience Bakhtar University 23