Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
13 views
8 pages
RSA + Diffe Helman Key Notes CNS
Computer networking important topics for placement
Uploaded by
Mithilesh Patmase
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save RSA + Diffe Helman key Notes CNS (1) For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
13 views
8 pages
RSA + Diffe Helman Key Notes CNS
Computer networking important topics for placement
Uploaded by
Mithilesh Patmase
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save RSA + Diffe Helman key Notes CNS (1) For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save RSA + Diffe Helman key Notes CNS (1) For Later
You are on page 1
/ 8
Search
Fullscreen
@ 44 The RSA Algorithm @(,o ~ 4.4.1 Introduction The RSA algorithm is the most popular and proven asymm tric ke tographic senita hens \ discuss that, let us have a quick overview of prime ni mbers, as they form the basis of the RS algorithm. " zi Am A prime number is the one that is divisible only by 1 and itself. For instance, 3 is a prime numba, because it can be divided only by I or 3. However, 4 is not a prime number, because other than by Lal 4, it can also be divided by 2. Similarly, 5, 7, 11, 13, 17, ... are prime numbers, whereas 6, 8,9, 10,11 .. are non-prime numbers. A quick observation can also be made that a prime number above 2 must, an odd number (because all even numbers are divisible by 2, therefore, all even numbers fron! onwards are non-prime).ic Key Algorithms, Digital Signatures and RSA 157 Bank's private key FFig.42 Use of a public key-private key pair by a bank The RSA algorithm is based numbers together, but it is extre: are based on very Targe (made simple (unlike the symmetric k ‘BSAiis the selecti lowever, thi ion and gener: blic and private keys. _ et us ROW understand h 2 mi ow the. public and private keys are generated, using them, how we can perform encrypt decryption in RSANThe whole process is shown in Fig, 4.3- ( Choose two large prine nunbers p and Q. Calculate N= Px Q. Select the public key (i.e. the Sneryption key) E such that it is Rot a factor of (P= 1) and(Q 1), Select the private key (i.e, the decryption ke; equation is true: Y) D such that the following © x £) mod (P - 1) x (Q =H) =a For encryption, calculate the Cipher text ct T= TE nod Wy from the plain text PT as follows. Send CT as the Cipher text. to the receiver ELE EFFie42. mn,Wass = ———___ 4.4.2 Examples of RSA Let us take an example of this process to understand the concepts. For ease of reading, we shay, the example values along with the algorithm steps. This is shown in Fig. 4.4. Win — | 1. Choose two Targe prime nunbers P and Q. 2. Calculate N= P x 0. We have, N= 7x17 = 119 tion key) E such that it is not a factor 3. Select the public key (i.e. the encryp' of (P- 1) x (Q- 1D — © Let us find 7-1) x 7-1 © The factors of 96 are 2. 2. 2. 2. 2x3) Fe nave to choose E such that none of the factors of £ is 2 and TAS Stew examples. we cannot choose as 4 (because it has 2 as 2 3 te 5 TS checause it has 3 as a factor), 6 (because it has 2 and 3 both as 6 x 16 ~ %6. 2, and 3 (because 96 = 2x 2x2x2x factors) eens cose E as 5 (it cosd have been any other nunber that does not its factors as 2 and 3) following 4, Select the private Key (i.e. the decryption key) D such that the f equation is true: a (Dx £) mod (P- Dx @- Dal [et us substitute the values of E, P and Q in the equation ie have: (D x5) mod (7-1) x (17 -D = 1 That is, (D x 5) mod (6) x (16) = 1 That is. (D x 5) mod (96) = 1 take 0 = 77. Then the following is true After some calculations. Tet us (77 x 8) mod (96) = 385 mod 96 = 1. which is what we wanted For encryption, calculate the cipher text CT from the plain text PT as follows: cT = PTE mod N Tat us assume that we want to encrypt plain text 10. Then we have: CT = 10° nod 119 = 100000 mod 119 = 40 6. Send CT as the cipher text to the receiver. Send 40 as the cipher text to the receiver: For decryption, calculate the plain text PT from the cipher text CT as follows: PT = CT? mod N ‘© We perform the following: © PT = CT nod N # That = 4077 is, PT = 4077 mod 119 = 10, which was the original plain text of step 5. FFig.4.4 Example of RSA algorithmAsymmetr i __— Asymmetric Key Algorithms, Digital Signatures and RSA = a stake te same example slightly differently. 1 ye shall take P= 7 and Q = 17, 1 Wereore, N=PXQET x 17 =119, 2 Ke we ca Se (P~1)X (Q~1)=6 x 16=96. The factors of 96 are 2, 2,2, 2, 2 and 3. Therefore, 3. AS ablic Key E must not have a factor of 2 and 3. Let us choose the public key value of Eas 5. he private key D such that (D x E) mod (P ~ 1) x (Q~ 1) = I. Let us choose D as 77, we can see that (5 x 77) mod 96 = 385 mod 96 = 1, which satisfies our condition. select th ppecause based on these values, let us consider an encryption and decryption process as shown in Nov ere, A is the sender and B is the receiver. As we can see, here we use an encoding scheme of Fi ng alphabets a5 A=1,B=2,...,Z=26. Let us assume that we want to encrypt a single alphabet coool is scheme, with B’s public key as 77 (known to A and B) and B's private key (known only to fsité The description follows Fig. 4.5. i ayes Encryption algorithm using Decryption a 5 igorthm using the public key the private key 1. Encode the original original 41. Raise the number to Gharactr using A=1, the power, neve 17. 2. Raise the number to eee the power E, here 5. A48, ond ont te here 5. remainder. The resulting number is 3. Divide the result by y 119 and get the eae ' remainder. The 3. Decode the original resulting number is character using the cipher text = Bete. Fi e [Fe a4 aT F B LF les |" | Resuit modulo 119 == Result modulo 118 oe = 41 _ FFig.4.5 Example of the RSA algorithm This works as follows, assuming that the sender A wants to send a single character F to the receiver B.We have chosen such a simple case for the ease of understanding. Using the RSA algorithm, the character F would be encoded as follows: : 1. Use the alphabet-numbering scheme (i.e. 1 for A, 2 for B, 3 for C and so on). As per this rule, for F, we would have 6. Therefore, first, F would be encoded to 6. 2. Raise the number to the power of N, ie. 6° 3. Now calculate 6° modulo 119, which is 41. This is the encrypted information to be sent across the network, Atthe receiver's end, the number 41 is decrypted to get back the original letter F as follows: 1. Rai Raise the number to the power of N, ie. 41°, ie. 4177.—— - awe” " 2.6.2 Diffie-Hellman Key Exchange/Agreement Algorithm Introduction Whitefield Diffie and Martin Hellman devised an amazing solution to the problem of key agreement or key exchange in 1976. This solution is called as ind fie-Hellman Key Exchange/ Hies,-who want to communicate Agreement Algorithm. The beauty of this scheme is that the two pi securely, can agree on a symmetric key using this technique. This key can then be used for encryption/ decryption, However, we must note that Diffie-Hellman key exchange algorithm can be used only for key agreement, but not for encryption or decryption of messages. Once-both the parties agree on the key to be used, they need to use other symmetric key encryption algorithms.}we shall discuss some of those =a subsequently) for actual encryption or decryption of message’) Although the Diffie-Hellman key exchange algorithm is based on mathematical principles, itis quite simple to understand. We shall first describe the steps in the algorithm, then illustrate its use with a simple example and then discuss the mathematical basis for it. Description of the Algorithm Let us assume that Alice and Bob want to agree upon a key to be Used for encrypting/decrypting messages that would be exchanged between them. ‘Then, the Diffie- Hellman key exchange algorithm works as shown in Fig. 2.49.Firstly, Alice and Bob agree on two large prime numbers, n and g. These two integers need notbe best secret. Alice and Bob can use an insecure channeltoagreeon them 2. Alice chooses another large random number x, and calculates Asuch that: Azgmodn 3. Alice sends the number Ato Bob. 4. Bobindependently chooses another large random integer y and calculates B such that: B=g/modn 5. Bob sends the number B toAlice. 6. Anow computes the secret hey K1 as follows: Ki=B%modn 7. Bnow computes the secrethey K2as follows: K2=A! modn F Fig. 2.49 Diffie-Hellman key exchange algorithm This is shown diagrammatically in Fig. 2.50. Alice Bob Alice and Bob agree rs x ‘on two prime — Sa numbers, n and g. hag modn B= 9! modn 8 u x 2 & 5 Ki=B*modn ‘As it tums out, Kt = K2 = K. K thus becomes the shared symmetric key between Alice and Bob. F Fig. 2.50 Diffie-Hellman key exchange illustrated It might come as a surprise, but KI is actually equal to K2! This means that KI = K2 = K is the symmetric key, which Alice and Bob must keep secret and can henceforth use for encrypting/decrypting their messages with. The mathematics behind this is quite interesting. We shall first prove it and then examine it. Example of the Algorithm Let us take a small example to prove that the Diffie-Hellman works in practical situations. Of course, we shall use very small values for ease of understanding. In real life, these values are very large. The process of key agreement is shown in Fig. 2.51.Cryptograph oT Lriptograpin Concepts and Techniques Sy 1. Firstly, Alice ang Bob aaree on two large prime numbers, n and g. These two integers neednotbe Keptsecrel. Alicoand Bobcat uee fechante ‘an insecure channel to agree on them, Letn=11,9=7, Letx=3. Then, we have, A=7> Mod 11 =343 mod 11 =2. Alice sends the number to Bob, -————"" Alice sends 2to Bob, eo Bob | Bobipdependently chooses anothertarge random integer y and calculates B such that: B= modn Lety=6. Then, wehave, B= 7° mod 11 = 117649 mod 1 =4, Bob sends the number BtoAlice. Bob sends 4 toAlice, Lomesends4 toAlice, | ‘Anow computes the secretkey K1 as follows: K1=B%modn We have, K2=28 mod 11 =64mod 11=9, FFig.251 Example of Diffie-Hellman key exchange Having taken a look at the actual proof of Diffie-Hellman key exchange algorithm, let us now think about the mathematical theory behind it.Fig. 4.50 Knapsack example lar 4.8 Some Other Algorithms dw» ' oo Let us discuss some other public key algorithms. a 2 oi w an 4.8.1 Elliptic Curve Cryptography (ECC) og bo Introduction RSA is the most prominent algorithm used in public key me techniques f encryption and digital signatures. Over the years, the key lengths for RSA have been increasing. Ti puts considerable burden on RSA, Another public gaining popular the last few years, His called as ul : = like RSA, ECC offers the same level of secur ie and, therefore, We Shall just have: for smaller key sizes. 1 overview Of this technique. iptic Curves An cllipti nofmal-curve drawin as pi has points, Bach point Gan be desig coordinate, just like any other graph. ~point can be designated as (4,-9), wl ivis 4 nits on the right hand idle of ‘the x-axis from the center a shown it Consider an elliptic curve (E) with a point P, Now, generate-a random number d, Lét we have Q= d xP. Mathematics says that 1, P.and Q are public values * aind the challenge isto find d, This is called as elliptic FFig.4.51 Point with rference'o-xandy| curve te logarithm problem, As long as the “curve is big enough, it is almost impossible to find d. Thus, E, P, Q together form the public key a8! is the corresponding private’key. ; = SS
You might also like
Data Communication & Computer Networks (DCCN) IT-360: Cryptography
PDF
No ratings yet
Data Communication & Computer Networks (DCCN) IT-360: Cryptography
44 pages
Chapter 3 Public Key Crypto Digital Sign and Cert
PDF
No ratings yet
Chapter 3 Public Key Crypto Digital Sign and Cert
78 pages
Encryption AND Decryption: Presented By:-Anchal Bhardwaj (0581522008) and Ruchi Jain (0161522008)
PDF
No ratings yet
Encryption AND Decryption: Presented By:-Anchal Bhardwaj (0581522008) and Ruchi Jain (0161522008)
32 pages
Asymmetric or Public Key Cryptography
PDF
No ratings yet
Asymmetric or Public Key Cryptography
55 pages
CSCE 465 Computer & Network Security: Public Key Public Key Cryptogrophy Cryptogrophy
PDF
No ratings yet
CSCE 465 Computer & Network Security: Public Key Public Key Cryptogrophy Cryptogrophy
33 pages
Handout 7 PDF
PDF
No ratings yet
Handout 7 PDF
21 pages
Asymmetric key-RSA
PDF
No ratings yet
Asymmetric key-RSA
26 pages
Lecture 21 22 23 24
PDF
No ratings yet
Lecture 21 22 23 24
61 pages
Encryption Algorithms
PDF
No ratings yet
Encryption Algorithms
15 pages
A Comparison Between Encryption and Decryption'
PDF
No ratings yet
A Comparison Between Encryption and Decryption'
15 pages
Classical Two-Way Cryptography: Affine Cryptosystem
PDF
No ratings yet
Classical Two-Way Cryptography: Affine Cryptosystem
6 pages
Asymmetric Key Cryptography
PDF
No ratings yet
Asymmetric Key Cryptography
24 pages
Chapter-3 Computer Security
PDF
No ratings yet
Chapter-3 Computer Security
67 pages
Network Security - Cryptography
PDF
No ratings yet
Network Security - Cryptography
4 pages
3.2 - Criptography - Asym Encryption
PDF
No ratings yet
3.2 - Criptography - Asym Encryption
44 pages
PKC Algorithm
PDF
No ratings yet
PKC Algorithm
20 pages
ISS
PDF
No ratings yet
ISS
19 pages
L - 2.3, L-2.4 RSA - Diffie Hellman Algorithm
PDF
No ratings yet
L - 2.3, L-2.4 RSA - Diffie Hellman Algorithm
21 pages
Diffie Hellman Key & ELiptic Curve - 3
PDF
No ratings yet
Diffie Hellman Key & ELiptic Curve - 3
23 pages
Catherine Easton July 2007: This Paper Examines The Mathematics of The RSA Code Through A Simple Example
PDF
No ratings yet
Catherine Easton July 2007: This Paper Examines The Mathematics of The RSA Code Through A Simple Example
5 pages
CSPC-307 RSA and Public Key Cryptography September 2023
PDF
No ratings yet
CSPC-307 RSA and Public Key Cryptography September 2023
37 pages
4 PKC Example - Rsa
PDF
No ratings yet
4 PKC Example - Rsa
7 pages
Chapter 5 (Secure Messaging) - 1
PDF
No ratings yet
Chapter 5 (Secure Messaging) - 1
44 pages
Chapter 9. Public Key Cryptography and RSA
PDF
No ratings yet
Chapter 9. Public Key Cryptography and RSA
8 pages
Cryptography in Network Security
PDF
No ratings yet
Cryptography in Network Security
26 pages
RSA Encryption Packet 2
PDF
No ratings yet
RSA Encryption Packet 2
8 pages
Lecture 2 C Public Key Cryptography
PDF
No ratings yet
Lecture 2 C Public Key Cryptography
27 pages
19 Asymmetric Key Cryptography 1
PDF
No ratings yet
19 Asymmetric Key Cryptography 1
32 pages
14 Pubkeycrypto Notes
PDF
No ratings yet
14 Pubkeycrypto Notes
9 pages
Ex 6,7
PDF
No ratings yet
Ex 6,7
8 pages
Lecture 4-Asymmetric Encryption Algorithms
PDF
No ratings yet
Lecture 4-Asymmetric Encryption Algorithms
24 pages
Lab Number 9
PDF
No ratings yet
Lab Number 9
16 pages
Public Key
PDF
No ratings yet
Public Key
39 pages
CSS 2024 25 BE CE A B Sem VII OTH Lec 4 Unit II Asymmetric RSA DH Ciphers
PDF
No ratings yet
CSS 2024 25 BE CE A B Sem VII OTH Lec 4 Unit II Asymmetric RSA DH Ciphers
29 pages
RSA Encryption
PDF
No ratings yet
RSA Encryption
4 pages
Lec 7 - PKC
PDF
No ratings yet
Lec 7 - PKC
28 pages
Invented by Clifford Cocks (GCHQ) and Ivest, Hamir, and Dleman
PDF
No ratings yet
Invented by Clifford Cocks (GCHQ) and Ivest, Hamir, and Dleman
25 pages
5 Module3 Information Security Part1
PDF
No ratings yet
5 Module3 Information Security Part1
42 pages
CNS Unit 2
PDF
No ratings yet
CNS Unit 2
24 pages
ch09 Public Key Encryption
PDF
No ratings yet
ch09 Public Key Encryption
34 pages
Cryptography New
PDF
No ratings yet
Cryptography New
35 pages
CompSec 4035 Chapter 3 Lesson 4
PDF
No ratings yet
CompSec 4035 Chapter 3 Lesson 4
31 pages
Chapter 4
PDF
No ratings yet
Chapter 4
39 pages
Public Key Cryptography and RSA
PDF
No ratings yet
Public Key Cryptography and RSA
31 pages
Rku PPT-4
PDF
No ratings yet
Rku PPT-4
49 pages
MODULE III Question
PDF
No ratings yet
MODULE III Question
9 pages
Unit 5
PDF
No ratings yet
Unit 5
26 pages
A Survey of Cryptography (07 - 2024)
PDF
No ratings yet
A Survey of Cryptography (07 - 2024)
6 pages
(Draft) RSA v2
PDF
No ratings yet
(Draft) RSA v2
30 pages
Chapter 9
PDF
No ratings yet
Chapter 9
8 pages
Computer and Network Security - 4
PDF
No ratings yet
Computer and Network Security - 4
39 pages
7 Ch07
PDF
No ratings yet
7 Ch07
31 pages
UNIT 3 Vol1.0
PDF
No ratings yet
UNIT 3 Vol1.0
54 pages
RSA Algorithm
PDF
No ratings yet
RSA Algorithm
48 pages
T11 04 ExpNo 2 CSS
PDF
No ratings yet
T11 04 ExpNo 2 CSS
10 pages
CNS Unit-4
PDF
No ratings yet
CNS Unit-4
27 pages
Lecture6 RSA
PDF
No ratings yet
Lecture6 RSA
12 pages
4.3 RSA Algorithm
PDF
No ratings yet
4.3 RSA Algorithm
9 pages
Deffie Hellman Key Exchange and RSA
PDF
No ratings yet
Deffie Hellman Key Exchange and RSA
34 pages