0% found this document useful (0 votes)
38 views27 pages

Introduction To Asymmetric Cryptography

The document provides an introduction to asymmetric cryptography, also known as public-key cryptography, which uses key pairs of public and private keys to securely transmit encrypted messages without having to first share a secret key. It explains the importance and basic architecture of asymmetric algorithms like RSA, which are widely used for internet security applications. Various aspects of the RSA algorithm are described, including key generation, encryption/decryption processes, and examples to illustrate solving modular exponential operations.

Uploaded by

Hasnain siddique
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views27 pages

Introduction To Asymmetric Cryptography

The document provides an introduction to asymmetric cryptography, also known as public-key cryptography, which uses key pairs of public and private keys to securely transmit encrypted messages without having to first share a secret key. It explains the importance and basic architecture of asymmetric algorithms like RSA, which are widely used for internet security applications. Various aspects of the RSA algorithm are described, including key generation, encryption/decryption processes, and examples to illustrate solving modular exponential operations.

Uploaded by

Hasnain siddique
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 27

Introduction to Asymmetric

Cryptography
Public key cryptography
Pair key cryptography
Public-Private key cryptosystem
Video Lectures Available at
https://drive.google.com/drive/folders/1vs9oXRkoNj5XMtsOvKqi_547xvrfxQzl
Agenda
• Introduction.
• Importance.
• Basic Architecture
• Related Algorithms
• RSA Algorithm
• RSA Example
• Attacks on RSA
• Modulo Exponent
Introduction to Asymmetric Cryptography
• Very important algorithm for Web-Browser.
• Security of Internet.
Importance.

• What is the issue with symmetric cryptography?


• We have to send the key using secure channel.
• Which is costly and painful.
Importance.

• In Internet, we can’t afford to have this cost because we have a very


large amount of data.
Importance.

• How can we transmit the key in symmetric cryptography.


• Physically
• A third party can select a key and deliver it to both A & B.
• A & B have a previously used key. One party used old key to deliver a new key
• Both have secure connection to the third party.
Importance.

• Solution?
• Public key cryptography
• In any sort of cryptography, encryption is not a problem.
• Actually decryption is a problem
• In public key cryptosystems, we will use two different keys for encryption and
decryption.
• Kprivate (KPr)
• Kpublic (KPub)
Asymmetric Algorithms – Basic Architecture

Alice Bob
KPub
KPub, KPr
Y
Y = eKPub(X) X = e-1KPr(Y)
Asymmetric Algorithms.

• There are three algorithms:


• RSA
• Discrete Logarithm
• Elliptic Curve
Some Facts about RSA Algorithm

• Invented in 1977, by
• Ronald Rivest, Adi Shamir and Leonard Adleman.
• Covers 70% of Internet Application
• Patent in USA until 2000
RSA Algorithm – Key Generation.

Alice Bob
KPub
KPub, KPr
Y
Y = eKPub(X) X = e-1KPr(Y)

Unlike symmetric algorithms (AES, 3DES), public key algorithms require


computation of pair keys (i.e. KPub, KPr )
Need Prime numbers computation.
RSA Algorithm – Key Generation.
1. Choose two large prime numbers p and q.
2. Calculate n = p.q
3. Calculate ɸ(n) = (p-1).(q-1)
4. Choose KPub = e Є {2,3,… … … .., ɸ(n)-1} ,
such that GCD (e, ɸ(n)) = 1
5. Compute KPr = d
such that e.d = 1 mod ɸ(n) -> e and d are inverse of each other
6. KPub = (n,e) and KPr = d.
RSA Algorithm – Encryption and Decryption.
Given KPub = (n,e)
Encryption Function is given as under:
Kpub

Given KPr = (d)


Decryption Function is given as under:
Kpr
RSA Algorithm – Example.
Alice Bob
1) p = 3 and q = 11
2) n = p . q = 33
3) ɸ(n) = (3-1).(11-1) = 20
4) Choose e = 3
5) d = 7
6) KPub = (n,e) = (33,3) ; KPr = d = 7
(n,e) = (33,3)
RSA Algorithm – Example continued...
Alice Bob
(n,e) = (33,3)
KPub = (n,e) = (33,3) ; KPr = d = 7

𝑌 =31
RSA Algorithm – Practical aspect
Real world RSA parameters are very large
p & q are at least 512 bits long prime numbers (
n ≥ ( but in practical it is (
No other mechanism (date encryption and error correction) has this long pattern.
This is the setup time and we have to do it once (key generation).
We don’t need to repeat it.
Bank ATM cards, we did it only once, infact the company has burned it with smart
card.
Online Purchase (like Amazon), we do it with every purchase.
RSA Algorithm – Practical aspect
p=
E0DFD2C2A288ACEBC705EFAB30E4447541A8C5A47A37185C5A9CB98389CE4DE19199AA3069B404FD98C801568CB9
170EB712BF10B4955CE9C9DC8CE6855C6123h
q=
EBE0FCF21866FD9A9F0D72F7994875A8D92E67AEE4B515136B2A778A8048B149828AEA30BD0BA34B977982A3D421
68F594CA99F3981DDABFAB2369F229640115h
n=
CF33188211FDF6052BDBB1A37235E0ABB5978A45C71FD381A91AD12FC76DA0544C47568AC83D855D47CA8D8A779
579AB72E635D0B0AAAC22D28341E998E90F82122A2C06090F43A37E0203C2B72E401FD06890EC8EAD4F07E686E906
F01B2468AE7B30CBD670255C1FEDE1A2762CF4392C0759499CC0ABECFF008728D9A11ADFh
e=
40B028E1E4CCF07537643101FF72444A0BE1D7682F1EDB553E3AB4F6DD8293CA1945DB12D796AE9244D60565C2EB
692A89B8881D58D278562ED60066DD8211E67315CF89857167206120405B08B54D10D4EC4ED4253C75FA74098FE3F
7FB751FF5121353C554391E114C85B56A9725E9BD5685D6C9C7EED8EE442366353DC39h
d=
C21A93EE751A8D4FBFD77285D79D6768C58EBF283743D2889A395F266C78F4A28E86F545960C2CE01EB8AD5246905
163B28D0B8BAABB959CC03F4EC499186168AE9ED6D88058898907E61C7CCCC584D65D801CFE32DFC983707F87F5A
A6AE4B9E77B9CE630E2C0DF05841B5E4984D059A35D7270D500514891F7B77B804BED81
Attacks on RSA Cryptosystem
There are three general attack families against RSA:
1. Protocol attacks
RSA has another undesirable property, namely that it is malleable. A cryptoscheme is said to be malleable if
the attacker Oscar is capable of transforming the ciphertext into another ciphertext which leads to a known
transformation of the plaintext. Note that the attacker does not decrypt the ciphertext but is merely capable
of manipulating the plaintext in a predictable manner.
2. Mathematical attacks
The best mathematical cryptanalytical method we know is factoring the modulus. An attacker, Oscar, knows
the modulus n, the public key e and the ciphertext y. His goal is to compute the private key d which has the
property that e · d ≡ modΦ(n)
3. Side-channel attacks
A third and entirely different family of attacks are side-channel attacks. They exploit information about the
private key which is leaked through physical channels such as the power consumption or the timing
behavior. In order to observe such channels, an attacker must typically have direct access to the RSA
implementation, e.g., in a cell phone or a smart card.
How to solve Modular Exponential
Formula:

(a.b mod n) = ((a mod n)(b mod n)) mod n


 
Example 1:
5000 mod 13 = 50.100 mod 13
= ((50 mod 13)(100 mod 13)) mod 13
= ((11)(9)) mod 13
=8
How to solve Modular Exponention
Example 2:
Using : (a.b mod n) = ((a mod n)(b mod n)) mod n
7256 mod 13 = ?
71 mod 13 = 7
72 mod 13 = 71.71 mod 13 = ((71 mod 13)( 71 mod 13)) mod 13
= 7.7 mod 13
= 10
74 mod 13 = 72. 72 mod 13
= 10.10 mod 13
=9
78 mod 13 = 74. 74 mod 13
= 9.9 mod 13
=3
How to solve Modular Exponential
Example 2 continued….:
716 mod 13 = 78. 78 mod 13
= ((78 mod 13)( 78 mod 13)) mod 13
= 3.3 mod 13
=9
Similarly,
732 mod 13 = 3
764 mod 13 = 9
7128 mod 13 = 3
7256 mod 13 = 9
How to solve Modular Exponential
Example 3:
5117 mod 19 = ?
We break the power as base 2, we get
117 = 64 + 32 + 16 + 4 + 1
51 mod 19 = 5
52 mod 19 = 6
54 mod 19 = 6.6 mod 19 = 17
58 mod 19 = 17.17 mod 19 = 4
516 mod 19 = 4.4 mod 19 = 16
532 mod 19 = 16.16 mod 19 = 9
564 mod 19 = 9.9 mod 19 = 5
 
5117 mod 19 = (564 . 532 516 54 51 ) mod 19
= (5 . 9 . 16 . 17 . 5 ) mod 19
= 61200 mod 19
=1
How to solve Modular Exponential
Example 4:
317 mod 33 = 314 312 311 mod 33
311 mod 33 = 31
312 mod 33 = 31.31 mod 33 = 4
314 mod 33 = 4.4 mod 33 = 16
317 mod 33 = 314 312 311 mod 33
317 mod 33 = 16 . 4 . 31 mod 33
=4
How to solve Modular Exponential
Fermet Little Theorem:
ap-1 = 1 mod p where p is a prime number

ap-1 mod p = 1
217-1 = 1 mod 17
Or we can write as

216 mod 17 = 1
How to solve Modular Exponention
Fermets Little Theorem:
ap-1 = 1 mod p where p is a prime number

250 mod 17 = 216.3 + 2 mod 17


= (23 )16 . 22 mod 17
= (((23 )16 mod 17) . ((22) mod 17)) mod 17
= (1 . 4) mod 17
= 4
 
4532 mod 11 = 4530 . 42 mod 11
= (453)10 . 42 mod 11
= (((453)10 mod 11) . ((42) mod 11)) mod 11
= (1.5) mod 11
=5
RSA – Bi-directional Communication.
Alice Bob

KPub(A) , KPr(A) KPub(B) , KPr(B)


KPub(B)
KPub(B)
KPub(A)
KPub(A)
Y
Y = eKPub(B)(X) X = e-1KPr(B)(Y)
Y
X=e -1
KPr(A) (Y) Y = eKPub(A)(X)
Internet Security Architecture
Alice Bob

You might also like