SlideShare ist ein Scribd-Unternehmen logo
1 von 22
Subject:- Information & Network Security
Topic:- RSA & Diffie-Hellman Algorithms
Daxesh Chauhan
Basic Terms in Cryptography
Plain text – A message in its natural format readable by
an attacker.
Cipher text – A message altered to be unreadable by
anyone except the intended recipients.
Key – Sequence that controls the operation and
behavior of the cryptographic algorithm.
Cryptosystem – The combination of algorithm, key, and
key management functions used to perform
cryptographic operations.
Cryptanalysis
• Definition:-
The art or process of deciphering coded
messages without being told the key.
The attacker or the intruder does not have
any knowledge of the key or the algorithm.
The attacker can use various methods
and try to break the code.
Public Key
• A cryptographic key that can be obtained
and used by anyone to encrypt messages
intended for a particular recipient, such
that the encrypted messages can be
deciphered only by using a second key
that is known only to the recipient
(the private key).
Private Key
• A Private key is an encryption
/decryption key known only to the party or
parties that exchange secret messages. In
cryptography, this key would be shared by
the communicators so that each
could encrypt and decrypt message.
Cryptography Methods
• Symmetric
– Same key for encryption and decryption
– Key distribution problem
• Asymmetric
– Mathematically related key pairs for
encryption and decryption
– Public and private keys
Introduction to RSA Algorithm
RSA was first described in 1977 by Ron Rivest, Adi
Shamir and Leonard Adleman of the Massachusetts
Institute of Technology.
Public-key cryptography, also known as asymmetric
cryptography, uses two different but mathematically
linked keys, one public and one private.
The public key can be shared with everyone,
whereas the private key must be kept secret.
• In RSA cryptography, both the public and the
private keys can encrypt a message; the opposite
key from the one used to encrypt a message is
used to decrypt it.
• This is one reason why RSA has become the
most widely used asymmetric algorithm.
• It provides a method of assuring the
confidentiality, integrity, and authenticity of
electronic communications and data storage.
Working of RSA
RSA Algorithm
1. Choose 2 distinct prime numbers.
p = 3 and q = 11.
2. Compute n = p * q = 3 * 11 = 33
3. Compute the Totient function
φ(n) = (p - 1) * (q - 1) = 2 * 10 = 20
4. Choose e such that 1 < e < φ(n) and e and n are co-
prime. Let e = 7
5. Compute a value for d such that (d * e) % φ(n) = 1.
Lets say d = 3
i.e. [(3 * 7) % 20 = 1]
6. Public key is (e, n) => (7, 33)
Private key is (d, n) => (3, 33)
7. For a plain text message m, the encryption function is
c(m) = me mod φ(n).
8. Assuming m=2,
The encryption of m = 2 is
c(m) = 27
mod 33
c(m) = 128 mod 33
c(m) = 29.
9. For cipher text c, the decryption function is
m(c) = cd mod φ(n)
m(c)= 293
mod 33
m(c)= 24389 mod 33
m(c) = 2.
Advantages of RSA
• Very fast and simple encryption.
• Easier to implement.
• Easier to understand.
• Widely deployed, better industry support.
Disadvantages of RSA
• Very slow key generation.
• Slow signing and decryption, which are
slightly tricky to implement securely.
• Key is vulnerable to various attacks if
poorly implemented.
Introduction to Diffie-Hellman
Algorithm
• Diffie–Hellman key exchange (D–H) is a specific
method of securely exchanging cryptographic
keys over a public channel.
• Traditionally, secure encrypted communication
between two parties requires that they first
exchange keys by some secure physical channel,
such as paper key lists transported by a
trusted courier.
• The Diffie–Hellman key exchange method
allows two parties that have no prior
knowledge of each other to jointly
establish a shared secret key over
an insecure channel.
• At the end of the communication both
sender and receiver have the same key.
Working of Diffie-Hellman
Diffie-Hellman Algorithm
1. Alice and Bob agree to use a modulus p = 23 and
base g = 5 (which is a primitive root modulo 23).
2. Alice chooses a secret integer a = 6, then sends Bob
A = ga
mod p
A = 56
mod 23
A = 8
3. Bob chooses a secret integer b = 15, then sends Alice
B = gb
mod p
B = 515
mod 23
B= 19
4. Alice computes s = Ba
mod p
s = 196
mod 23 = 2
5. Bob computes s = Ab
mod p
s = 815
mod 23 = 2
6. Alice and Bob now share a secret (the
number 2).
Hence both Alice and Bob have arrived at the
same value s.
Advantage of Diffie-Hellman Algorithm
• The sender and receiver have no prior
knowledge of each other.
• Communication can take place through an
insecure channel.
• Sharing of secret key is safe.
Disadvantages of Diffie-Hellman
Algorithm
• Can not be used for asymmetric key exchange.
• Can not be used for signing digital signatures.
• The nature of the Diffie-Hellman key exchange
does make it susceptible to man-in-the-middle
attacks since it doesn't authenticate either party
involved in the exchange.
Rsa and diffie hellman algorithms

Weitere ähnliche Inhalte

Was ist angesagt?

X.509 Certificates
X.509 CertificatesX.509 Certificates
X.509 CertificatesSou Jana
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to CryptographySeema Goel
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication CodesDarshanPatil82
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
Message authentication
Message authenticationMessage authentication
Message authenticationCAS
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authenticationchauhankapil
 
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 UsesMohsin Ali
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMACKrishna Gehlot
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption StandardPrince Rachit
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherNiloy Biswas
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key CryptosystemDevakumar Kp
 
Digital signature schemes
Digital signature schemesDigital signature schemes
Digital signature schemesravik09783
 
An introduction to X.509 certificates
An introduction to X.509 certificatesAn introduction to X.509 certificates
An introduction to X.509 certificatesStephane Potier
 

Was ist angesagt? (20)

Cryptography
CryptographyCryptography
Cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
X.509 Certificates
X.509 CertificatesX.509 Certificates
X.509 Certificates
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
MAC-Message Authentication Codes
MAC-Message Authentication CodesMAC-Message Authentication Codes
MAC-Message Authentication Codes
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
Message authentication
Message authenticationMessage authentication
Message authentication
 
Message Authentication
Message AuthenticationMessage Authentication
Message Authentication
 
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
 
Cryptography
CryptographyCryptography
Cryptography
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
AES-Advanced Encryption Standard
AES-Advanced Encryption StandardAES-Advanced Encryption Standard
AES-Advanced Encryption Standard
 
Cryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipherCryptography - Block cipher & stream cipher
Cryptography - Block cipher & stream cipher
 
Public Key Cryptosystem
Public Key CryptosystemPublic Key Cryptosystem
Public Key Cryptosystem
 
RSA ALGORITHM
RSA ALGORITHMRSA ALGORITHM
RSA ALGORITHM
 
Digital signature schemes
Digital signature schemesDigital signature schemes
Digital signature schemes
 
PPT steganography
PPT steganographyPPT steganography
PPT steganography
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithm
 
An introduction to X.509 certificates
An introduction to X.509 certificatesAn introduction to X.509 certificates
An introduction to X.509 certificates
 

Ähnlich wie Rsa and diffie hellman algorithms

Ähnlich wie Rsa and diffie hellman algorithms (20)

Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
 
CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem CNS - Unit - 4 - Public Key Cryptosystem
CNS - Unit - 4 - Public Key Cryptosystem
 
White Paper on Cryptography
White Paper on Cryptography White Paper on Cryptography
White Paper on Cryptography
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 
Pooguzhali
PooguzhaliPooguzhali
Pooguzhali
 
Public key algorithm
Public key algorithmPublic key algorithm
Public key algorithm
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
Unit 7 : Network Security
Unit 7 : Network SecurityUnit 7 : Network Security
Unit 7 : Network Security
 
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
 
PUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.pptPUBLIC KEY & RSA.ppt
PUBLIC KEY & RSA.ppt
 
Introduction to cryptography
Introduction to cryptographyIntroduction to cryptography
Introduction to cryptography
 
Ch09
Ch09Ch09
Ch09
 
Applying Security Algorithms Using openSSL crypto library
Applying Security Algorithms Using openSSL crypto libraryApplying Security Algorithms Using openSSL crypto library
Applying Security Algorithms Using openSSL crypto library
 
Module2.pptx
Module2.pptxModule2.pptx
Module2.pptx
 
Ch9
Ch9Ch9
Ch9
 
Unit --3.ppt
Unit --3.pptUnit --3.ppt
Unit --3.ppt
 
information security(Public key encryption its characteristics and weakness, ...
information security(Public key encryption its characteristics and weakness, ...information security(Public key encryption its characteristics and weakness, ...
information security(Public key encryption its characteristics and weakness, ...
 

Mehr von daxesh chauhan

Elastic beam (bending of beam model)
Elastic beam (bending of beam model)Elastic beam (bending of beam model)
Elastic beam (bending of beam model)daxesh chauhan
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalizationdaxesh chauhan
 
Insertionsort shellsort heapsort
Insertionsort shellsort heapsortInsertionsort shellsort heapsort
Insertionsort shellsort heapsortdaxesh chauhan
 
COMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINESCOMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINESdaxesh chauhan
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop pptdaxesh chauhan
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzationdaxesh chauhan
 

Mehr von daxesh chauhan (7)

Elastic beam (bending of beam model)
Elastic beam (bending of beam model)Elastic beam (bending of beam model)
Elastic beam (bending of beam model)
 
Functional dependencies and normalization
Functional dependencies and normalizationFunctional dependencies and normalization
Functional dependencies and normalization
 
Insertionsort shellsort heapsort
Insertionsort shellsort heapsortInsertionsort shellsort heapsort
Insertionsort shellsort heapsort
 
COMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINESCOMBINATIONAL PLD-BASED STATE MACHINES
COMBINATIONAL PLD-BASED STATE MACHINES
 
Principles and advantages of oop ppt
Principles and advantages of oop pptPrinciples and advantages of oop ppt
Principles and advantages of oop ppt
 
Cn ppt
Cn  pptCn  ppt
Cn ppt
 
Input - output organzation
Input - output organzationInput - output organzation
Input - output organzation
 

Kürzlich hochgeladen

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 

Kürzlich hochgeladen (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

Rsa and diffie hellman algorithms

  • 1. Subject:- Information & Network Security Topic:- RSA & Diffie-Hellman Algorithms Daxesh Chauhan
  • 2. Basic Terms in Cryptography Plain text – A message in its natural format readable by an attacker. Cipher text – A message altered to be unreadable by anyone except the intended recipients. Key – Sequence that controls the operation and behavior of the cryptographic algorithm. Cryptosystem – The combination of algorithm, key, and key management functions used to perform cryptographic operations.
  • 3. Cryptanalysis • Definition:- The art or process of deciphering coded messages without being told the key. The attacker or the intruder does not have any knowledge of the key or the algorithm. The attacker can use various methods and try to break the code.
  • 4. Public Key • A cryptographic key that can be obtained and used by anyone to encrypt messages intended for a particular recipient, such that the encrypted messages can be deciphered only by using a second key that is known only to the recipient (the private key).
  • 5. Private Key • A Private key is an encryption /decryption key known only to the party or parties that exchange secret messages. In cryptography, this key would be shared by the communicators so that each could encrypt and decrypt message.
  • 6.
  • 7. Cryptography Methods • Symmetric – Same key for encryption and decryption – Key distribution problem • Asymmetric – Mathematically related key pairs for encryption and decryption – Public and private keys
  • 8. Introduction to RSA Algorithm RSA was first described in 1977 by Ron Rivest, Adi Shamir and Leonard Adleman of the Massachusetts Institute of Technology. Public-key cryptography, also known as asymmetric cryptography, uses two different but mathematically linked keys, one public and one private. The public key can be shared with everyone, whereas the private key must be kept secret.
  • 9. • In RSA cryptography, both the public and the private keys can encrypt a message; the opposite key from the one used to encrypt a message is used to decrypt it. • This is one reason why RSA has become the most widely used asymmetric algorithm. • It provides a method of assuring the confidentiality, integrity, and authenticity of electronic communications and data storage.
  • 11. RSA Algorithm 1. Choose 2 distinct prime numbers. p = 3 and q = 11. 2. Compute n = p * q = 3 * 11 = 33 3. Compute the Totient function φ(n) = (p - 1) * (q - 1) = 2 * 10 = 20 4. Choose e such that 1 < e < φ(n) and e and n are co- prime. Let e = 7 5. Compute a value for d such that (d * e) % φ(n) = 1. Lets say d = 3 i.e. [(3 * 7) % 20 = 1]
  • 12. 6. Public key is (e, n) => (7, 33) Private key is (d, n) => (3, 33) 7. For a plain text message m, the encryption function is c(m) = me mod φ(n). 8. Assuming m=2, The encryption of m = 2 is c(m) = 27 mod 33 c(m) = 128 mod 33 c(m) = 29. 9. For cipher text c, the decryption function is m(c) = cd mod φ(n) m(c)= 293 mod 33 m(c)= 24389 mod 33 m(c) = 2.
  • 13. Advantages of RSA • Very fast and simple encryption. • Easier to implement. • Easier to understand. • Widely deployed, better industry support.
  • 14. Disadvantages of RSA • Very slow key generation. • Slow signing and decryption, which are slightly tricky to implement securely. • Key is vulnerable to various attacks if poorly implemented.
  • 15. Introduction to Diffie-Hellman Algorithm • Diffie–Hellman key exchange (D–H) is a specific method of securely exchanging cryptographic keys over a public channel. • Traditionally, secure encrypted communication between two parties requires that they first exchange keys by some secure physical channel, such as paper key lists transported by a trusted courier.
  • 16. • The Diffie–Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel. • At the end of the communication both sender and receiver have the same key.
  • 18. Diffie-Hellman Algorithm 1. Alice and Bob agree to use a modulus p = 23 and base g = 5 (which is a primitive root modulo 23). 2. Alice chooses a secret integer a = 6, then sends Bob A = ga mod p A = 56 mod 23 A = 8 3. Bob chooses a secret integer b = 15, then sends Alice B = gb mod p B = 515 mod 23 B= 19
  • 19. 4. Alice computes s = Ba mod p s = 196 mod 23 = 2 5. Bob computes s = Ab mod p s = 815 mod 23 = 2 6. Alice and Bob now share a secret (the number 2). Hence both Alice and Bob have arrived at the same value s.
  • 20. Advantage of Diffie-Hellman Algorithm • The sender and receiver have no prior knowledge of each other. • Communication can take place through an insecure channel. • Sharing of secret key is safe.
  • 21. Disadvantages of Diffie-Hellman Algorithm • Can not be used for asymmetric key exchange. • Can not be used for signing digital signatures. • The nature of the Diffie-Hellman key exchange does make it susceptible to man-in-the-middle attacks since it doesn't authenticate either party involved in the exchange.