SlideShare a Scribd company logo
15
Most read
17
Most read
18
Most read
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.
Rsa and diffie hellman algorithms
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

More Related Content

What's hot (20)

PDF
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
JAINAM KAPADIYA
 
PPTX
Substitution techniques
vinitha96
 
PDF
RSA ALGORITHM
Dr. Shashank Shetty
 
PDF
Public Key Encryption & Hash functions
Dr.Florence Dayana
 
PPTX
Hash Function
ssuserdfb2da
 
PPTX
Key management and distribution
Riya Choudhary
 
PPT
Monoalphabetic Substitution Cipher
SHUBHA CHATURVEDI
 
PDF
Web Security
Dr.Florence Dayana
 
PPTX
Elliptic Curve Cryptography
JorgeVillamarin5
 
PPTX
Pgp pretty good privacy
Pawan Arya
 
PPT
Symmetric & Asymmetric Cryptography
chauhankapil
 
PPTX
Heap Management
Jenny Galino
 
PPTX
Rc4
Amjad Rehman
 
PPTX
RSA algorithm
Arpana shree
 
PPT
Chap4
nathanurag
 
PPTX
RSA ALGORITHM
Sathish Kumar
 
PPTX
Seminar on Chaos Based Cryptography
Muhammad Hamid
 
PPTX
The medium access sublayer
Lal Bahadur Gehlot
 
PPTX
Public key algorithm
Prateek Pandey
 
Symmetric Cipher Model, Substitution techniques, Transposition techniques, St...
JAINAM KAPADIYA
 
Substitution techniques
vinitha96
 
RSA ALGORITHM
Dr. Shashank Shetty
 
Public Key Encryption & Hash functions
Dr.Florence Dayana
 
Hash Function
ssuserdfb2da
 
Key management and distribution
Riya Choudhary
 
Monoalphabetic Substitution Cipher
SHUBHA CHATURVEDI
 
Web Security
Dr.Florence Dayana
 
Elliptic Curve Cryptography
JorgeVillamarin5
 
Pgp pretty good privacy
Pawan Arya
 
Symmetric & Asymmetric Cryptography
chauhankapil
 
Heap Management
Jenny Galino
 
RSA algorithm
Arpana shree
 
Chap4
nathanurag
 
RSA ALGORITHM
Sathish Kumar
 
Seminar on Chaos Based Cryptography
Muhammad Hamid
 
The medium access sublayer
Lal Bahadur Gehlot
 
Public key algorithm
Prateek Pandey
 

Similar to Rsa and diffie hellman algorithms (20)

PDF
CNS - Unit - 4 - Public Key Cryptosystem
Gyanmanjari Institute Of Technology
 
PPTX
Module 2 of cryptography old scheme VTU ppt
MonaReddy12
 
PPTX
information security(Public key encryption its characteristics and weakness, ...
Zara Nawaz
 
PDF
international security system data threats
gacop74666
 
PDF
PRINCIPLES OF INFORMATION SYSTEM SECURITY
gacop74666
 
PPTX
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
werip98386
 
PPTX
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
VishwanathMahalle
 
DOC
Unit 3(1)
Vinod Kumar Gorrepati
 
PPT
Rsa diffi-network security-itt
rameshvvv
 
PPTX
CNS 3RD UNIT PPT.pptx
pjeraids
 
PPT
RSA Algorithm - Public Key Cryptography
Md. Shafiul Alam Sagor
 
PPTX
RSA Algorithem and information about rsa
Mohsin Ali
 
PDF
RSA 32-bit Implementation Technique
Universitas Pembangunan Panca Budi
 
PPTX
Introduction to Cryptography CYB 303.pptx
Abolarinwa
 
PDF
CRYPTOGRAPHY (2).pdf
BhuvanaR13
 
PDF
Survey on asymmetric key cryptography algorithms
Editor Jacotech
 
DOCX
Prime Numbers, Fermat’s and Euler’s theorem, discrete logarithm. ASYMMETRIC C...
AneesFathima46
 
PDF
PKC&RSA
Anver S R
 
PPT
Network and Information Security unit2.ppt.ppt
Vivekananda Gn
 
PDF
2 IJAERS-JUN-2015-6-RSA and Modified RSA algorithm using C Programming
Puneeth Puni
 
CNS - Unit - 4 - Public Key Cryptosystem
Gyanmanjari Institute Of Technology
 
Module 2 of cryptography old scheme VTU ppt
MonaReddy12
 
information security(Public key encryption its characteristics and weakness, ...
Zara Nawaz
 
international security system data threats
gacop74666
 
PRINCIPLES OF INFORMATION SYSTEM SECURITY
gacop74666
 
Rivest Shamir Adleman Algorithm and its variant : DRSA.pptx
werip98386
 
Unit-III_3R-CRYPTO_2021-22_VSM.pptx
VishwanathMahalle
 
Rsa diffi-network security-itt
rameshvvv
 
CNS 3RD UNIT PPT.pptx
pjeraids
 
RSA Algorithm - Public Key Cryptography
Md. Shafiul Alam Sagor
 
RSA Algorithem and information about rsa
Mohsin Ali
 
RSA 32-bit Implementation Technique
Universitas Pembangunan Panca Budi
 
Introduction to Cryptography CYB 303.pptx
Abolarinwa
 
CRYPTOGRAPHY (2).pdf
BhuvanaR13
 
Survey on asymmetric key cryptography algorithms
Editor Jacotech
 
Prime Numbers, Fermat’s and Euler’s theorem, discrete logarithm. ASYMMETRIC C...
AneesFathima46
 
PKC&RSA
Anver S R
 
Network and Information Security unit2.ppt.ppt
Vivekananda Gn
 
2 IJAERS-JUN-2015-6-RSA and Modified RSA algorithm using C Programming
Puneeth Puni
 
Ad

More from daxesh chauhan (7)

PPTX
Elastic beam (bending of beam model)
daxesh chauhan
 
PPTX
Functional dependencies and normalization
daxesh chauhan
 
PPTX
Insertionsort shellsort heapsort
daxesh chauhan
 
PPTX
COMBINATIONAL PLD-BASED STATE MACHINES
daxesh chauhan
 
PPTX
Principles and advantages of oop ppt
daxesh chauhan
 
PPTX
Cn ppt
daxesh chauhan
 
PPTX
Input - output organzation
daxesh chauhan
 
Elastic beam (bending of beam model)
daxesh chauhan
 
Functional dependencies and normalization
daxesh chauhan
 
Insertionsort shellsort heapsort
daxesh chauhan
 
COMBINATIONAL PLD-BASED STATE MACHINES
daxesh chauhan
 
Principles and advantages of oop ppt
daxesh chauhan
 
Input - output organzation
daxesh chauhan
 
Ad

Recently uploaded (20)

PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PPTX
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
PDF
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PPTX
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
Dimensions of Societal Planning in Commonism
StefanMz
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
Stereochemistry-Optical Isomerism in organic compoundsptx
Tarannum Nadaf-Mansuri
 
The-Ever-Evolving-World-of-Science (1).pdf/7TH CLASS CURIOSITY /1ST CHAPTER/B...
Sandeep Swamy
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
CATEGORIES OF NURSING PERSONNEL: HOSPITAL & COLLEGE
PRADEEP ABOTHU
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
How to Create a PDF Report in Odoo 18 - Odoo Slides
Celine George
 

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.
  • 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.