SlideShare a Scribd company logo
1 of 21
Public-key cryptography
and RSA
Some unanswered questions on
symmetric cryptosystems
• Key management: changing the secret key or
establishing one is nontrivial
– Change the keys two users share (should be done reasonably
often)
– Establish a secret key with somebody you do not know and
cannot meet in person: (e.g., visiting secure websites such as e-
shops)
– This could be done via a trusted Key Distribution Center (details
in a future lecture)
– Can (or should) we really trust the KDC?
– “What good would it do after all to develop impenetrable
cryptosystems, if their users were forced to share their keys with
a KDC that could be compromised by either burglary or
subpoena?” –Diffie, 1988
• Digital signatures: one should make sure that a message
came intact from the claimed sender
A breakthrough idea
• Rather than having a secret key that the two users
must share, each users has two keys
– One key is secret and he is the only one who knows it
– The other key is public and anyone who wishes to
send him a message uses that key to encrypt the
message
– Diffie and Hellman first (publicly) introduced the idea in
1976 –this was radically different than all previous efforts
– NSA claims to have known it sine mid-1960s!
– Communications-Electronic Security Group (the British
counterpart of NSA) documented the idea in a classified
report in 1970
A word of warning
• Public-key cryptography complements rather
than replaces symmetric cryptography
• There is nothing in principle to make public-key
crypto more secure than symmetric crypto
• Public-key crypto does not make symmetric
crypto obsolete: it has its advantages but also its
(major) drawbacks such as speed
• Due to its low speed, it is mostly confined to
key management and digital signatures
The idea of public-key cryptography
• The concept was proposed in 1976 by Diffieand Hellman
although no practical way to design such a system was
suggested
• Each user has two keys: one encryption key that he makes
public and one decryption key that he keeps secret
– Clearly, it should be computationally infeasible to determine the
decryption key given only the encryption key and the
cryptographic algorithm
• Some algorithms (such as RSA) satisfy also the following
useful characteristic:
– Either one of the two keys can be used for encryption –the other
one should then be used to decrypt the message
• First we will investigate the concept with no reference yet to
practical design of a public-key system
Essential steps in public-key encryption
• Each user generates a pair of keys to be used for encryption
and decryption
• Each user places one of the two keys in a public register and
the other key is kept private
• If B wants to send a confidential message to A, B encrypts the
message using A’s public key
• When A receives the message, she decrypts it using her
private key
– Nobody else can decrypt the message because that can only be
done using A’s private key
– Deducing a private key should be infeasible
• If a user wishes to change his keys –generate another pair of
keys and publish the public one: no interaction with other
users is needed
Bob sends an encrypted message to
Alice
Some notation
• The public key of user A will be denoted
KUA
• The private key of user A will be denoted
KRA
• Encryption method will be a function E
• Decryption method will be a function D
• If B wishes to send a plain message X to
A, then he sends the cryptotext
Y=E(KUA,X)
A first attack on the public-key scheme
–authenticity
• Immediate attack on this scheme:
• An attacker may impersonate user B: he sends a message
E(KUA,X) and claims in the message to be B –A has no
guarantee this is so
– This was guaranteed in classical cryptosystems simply through knowing
the key (only A and B are supposed to know the symmetric key)
• The authenticity of user B can be established as follows:
• B will encrypt the message using his private key: Y=E(KRB,X)
• This shows the authenticity of the sender because (supposedly) he
is the only one who knows the private key
• The entire encrypted message serves as a digital signature
– Note: this may not be the best possible solution: ideally, digital
signatures should be rather small so that one can preserve many of
them over a long period of time
• Better schemes will be presented a couple of lectures on
A scheme to authenticate the sender of
the message
Encryption and authenticity
• Still a drawback: the scheme on the previous slide
authenticate but does not ensure security:
anybody can decrypt the message using B’s
public key
• One can provide both authentication and
confidentiality using the public-key scheme twice:
– B encrypts X with his private key: Y=E(KRB,X)
– B encrypts Y with A’s public key: Z=E(KUA,Y)
– A will decrypt Z (and she is the only one capable of
doing it): Y=D(KRA,Z)
– A can now get the plaintext and ensure that it comes
from B (he is the only one who knows his private key):
decrypt Y using B’s public key: X=E(KUB,Y)
Applications for public-key
cryptosystems
1.Encryption/decryption: sender
encrypts the message with the
receiver’s public key
2.Digital signature: sender “signs” the
message (or a representative part of
the message) using his private key
3.Key exchange: two sides cooperate to
exchange a secret key for later use in a
secret-key cryptosystem
Requirements for public-key
cryptosystems
• Generating a key pair (public key, private key) is
computationally easy
• Encrypting a message using a known key (his own private or
somebody else’s public) is computationally easy
• Decrypting a message using a known key (his own private or
somebody else’s public) is computationally easy
• Knowing the public key, it is computationally infeasible for an
opponent to deduce the private key
• Knowing the public key and a ciphertext, it is computationally
infeasible for an opponent to deduce the private key
• Useful extra feature: encryption and decryption can be applied
in any order:
• E( KUA, D(KRA,X) ) =D(KRA, E( KUA, X)
RSA
• One of the first proposals on implementing the concept of public-key
cryptography was that of Rivest, Shamir, Adleman–1977: RSA
• The RSA scheme is a block cipher in which the plaintext and the ciphertext
are integers between 0 and n-1 for some fixed n
– Typical size for n is 1024 bits (or 309 decimal digits)
– To be secure with today’s technology size should between 1024 and 2048 bits
• Idea of RSA: it is a difficult math problem to factorize (large)integers
– Choose p and q odd primes, n=pq
– Choose integers d,e such that M^ed=M mod n, for all M<n
– Plaintext: block of k bits, where 2k<n≤2k+1–can be considered a number M with
M<n
– Encryption: C=M^e mod n
– Decryption: C^d mod n = M^de mod n = M
– Public key: KU={e,n}
– Private key:KR={d,n}
• Question: How do we find d,e?
– Answer: Number Theory!
Notions of number theory
• Fermat’s little theorem: if p is prime and a is positive integer not divisible
by p, then
• if p is a prime which does not divide a, then ap-1=1 (mod p)
• In more simple language this says that if p is a prime that is not a factor of a,
then when a is multiplied together p-1 times, and the result divided by p, we
get a remainder of one
• if we use a=7 and p=3, the rule says that 7^2 divided by 3 will have a
remainder of one. In fact 49/3 does have a remainder of one
• Comments:
– This is a first step in our quest to find M^ed=M mod n –not quite enough though
– Fermat’s little theorem provides a necessary condition for an integer p to be
prime –the condition is not sufficient
• We will turn this theorem into a (probabilistic) test for primality
• Fermat’s theorem, as useful as will turn out to be does not provide us with
integers d,e we are looking for –Euler’s theorem (a refinement of Fermat’s)
does
Euler’s totient function
• �Euler’s function
– If N is a positive integer, then phi(N) is defined to be the number of positive
integers less than or equal to N and coprime (do not contain any factor in
common with) to N.
• �Example:
• �Prime factor of 10 are 2 and 5 => 10 = (2^1) * (5^1)
phi(10) = phi(2) * phi(5) = (2-1) * (5-1) = 1 * 4 = 4.
The numbers of integers less than 10 that co prime with 10 are 4, they are
1, 3, 7 and 9.
•
To calculate Euler totient function, we need to find prime factors, this is the
hardest part, for big number it is very hard to find all of its prime factors, this
is the security in RSA which is hard to factor a large number.
• �Easy to see that for any two primes p,q, φ(pq)=(p-1)(q-1)
• ��Euler’s theorem: for any relatively prime integers a,n we have aφ(n)≡1
mod n
• Corollary: Let p,q be two odd primes and n=pq. Then:
Back to RSA
• �Euler’s theorem provides us the numbers d,e such that Med=M mod n
– �We have to choose d,e such that ed=kφ(n)+1, or equivalently, d≡e-1mod φ(n)
– �Extended Euclid’s algorithm!
• �The RSA scheme
– �Key generation
• �Choose two odd primes p,q –keep private
• �Compute n=pq–make public
• �Choose e, 1<e<φ(n) with gcd(φ(n),e)=1 –make public
• �Compute d≡e-1mod φ(n) –keep private
• i.e find d such that phi divides ed-1.
• �Private key is {d,n}
• �Public key is {e,n}
• �Encryption
• �Plaintext: block of k bits, where 2k<n≤2k+1–can be considered a number M with M<n
• �Ciphertext: C=M^emod n
• �Decryption:
• �Ciphertext: C
• �Plaintext: C^dmod n = Mdemod n = M
Example
• �Key generation
• �Select primes p=17, q=11
• �Compute n=pq=187
• �Compute φ(n)=(p-1)(q-1)=160
• �Select e=7
• �Compute d: d=23 (use the extended Euclid’s algorithm)
• �KU={7,187}
• �KR={23,187}
• �Encrypt M=88: 88^7mod 187
• �88^7mod 187 = 11
• �Decrypt C=11: 11^23mod 187
• �M=11^23 mod 187=88
Attacking RSAďż˝
• Brute force attacks: try all possible private keys�
• As in the other cases defend using large keys: nowadays integers between 1024 and
2048 bitsďż˝
• Mathematical attacks�
• Factor n into its two primes p,q: this is a hard problem for large n�
– Challenges by RSA Labs to factorize large integers�
– Smallest unsolved challenge: 704 bits�
• Determine φ(n) directly without first determining p,q: this math problem is equivalent
to factoringďż˝
• Determine d directly, without first determining φ(n): this is believed to be at least as
difficult as factoringďż˝
• Suggestions for design�
• The larger the keys, the better but also the slower the algorithm�
• Choosing p,q badly may weaken the algorithm�
– p,q should differ in length by only a few bits: for a 1024-bit key, p,q should be on the order of
magnitude 1075to 10100ďż˝
– p-1 and q-1 should both contain a large prime factor�
– gcd(p-1,q-1) should be small�
– hd should be larger than n1/4RSA
RSA attack
• Timing attacks: determine a private key by keeping track of how
long a computer takes to decipher a message (ciphertext-only
attack) –this is essentially an attack on the fast exponentiation
algorithm but can be adapted for any other algorithmďż˝
• Whenever a bit is 1 the algorithm has more computations to do and
takes more timeďż˝
• Countermeasures:�
• Ensure that all exponentiations take the same time before returning
a result: degrade performance of the algorithmďż˝
• Add some random delay: if there is not enough noise the attack
succeedsďż˝
• Blinding: multiply the ciphertext by a randomnumber before
performing exponentiation –in this way the attacker does not know
the input to the exponentiation algorithm. (implemented in the
commercial products from RSA Data Security Inc.)

More Related Content

What's hot

Cryptography and Information Security
Cryptography and Information SecurityCryptography and Information Security
Cryptography and Information SecurityDr Naim R Kidwai
 
Diffiehellman
DiffiehellmanDiffiehellman
Diffiehellmanchenlahero
 
Lecture 5 ip security
Lecture 5 ip securityLecture 5 ip security
Lecture 5 ip securityrajakhurram
 
Digital signature(Cryptography)
Digital signature(Cryptography)Digital signature(Cryptography)
Digital signature(Cryptography)Soham Kansodaria
 
Symmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.pptSymmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.pptHassanAli980906
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSASrilal Buddika
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithmComputer_ at_home
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMACKrishna Gehlot
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSADr.Florence Dayana
 
Introduction to Public Key Infrastructure
Introduction to Public Key InfrastructureIntroduction to Public Key Infrastructure
Introduction to Public Key InfrastructureTheo Gravity
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithmKomal Singh
 
Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Ahmed Mohamed Mahmoud
 

What's hot (20)

Ipsec
IpsecIpsec
Ipsec
 
Cryptography and Information Security
Cryptography and Information SecurityCryptography and Information Security
Cryptography and Information Security
 
Kerberos
KerberosKerberos
Kerberos
 
Diffiehellman
DiffiehellmanDiffiehellman
Diffiehellman
 
Lecture 5 ip security
Lecture 5 ip securityLecture 5 ip security
Lecture 5 ip security
 
Digital signature(Cryptography)
Digital signature(Cryptography)Digital signature(Cryptography)
Digital signature(Cryptography)
 
Symmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.pptSymmetric and Asymmetric Encryption.ppt
Symmetric and Asymmetric Encryption.ppt
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Elliptic curve cryptography
Elliptic curve cryptographyElliptic curve cryptography
Elliptic curve cryptography
 
Presentation about RSA
Presentation about RSAPresentation about RSA
Presentation about RSA
 
RSA
RSARSA
RSA
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithm
 
encryption and decryption
encryption and decryptionencryption and decryption
encryption and decryption
 
Cryptography
CryptographyCryptography
Cryptography
 
Message Authentication Code & HMAC
Message Authentication Code & HMACMessage Authentication Code & HMAC
Message Authentication Code & HMAC
 
WPA2
WPA2WPA2
WPA2
 
2. public key cryptography and RSA
2. public key cryptography and RSA2. public key cryptography and RSA
2. public key cryptography and RSA
 
Introduction to Public Key Infrastructure
Introduction to Public Key InfrastructureIntroduction to Public Key Infrastructure
Introduction to Public Key Infrastructure
 
The rsa algorithm
The rsa algorithmThe rsa algorithm
The rsa algorithm
 
Trible data encryption standard (3DES)
Trible data encryption standard (3DES)Trible data encryption standard (3DES)
Trible data encryption standard (3DES)
 

Similar to Public key cryptography and RSA

UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptxSunnyAnchews
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-ittrameshvvv
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network SecurityKathirvel Ayyaswamy
 
Public Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithmIndra97065
 
OS ppt Modified.pptx
OS ppt Modified.pptxOS ppt Modified.pptx
OS ppt Modified.pptxStudyvAbhi
 
CNS 3RD UNIT PPT.pptx
CNS 3RD UNIT PPT.pptxCNS 3RD UNIT PPT.pptx
CNS 3RD UNIT PPT.pptxpjeraids
 
sheet1.pdf
sheet1.pdfsheet1.pdf
sheet1.pdfaminasouyah
 
lecture7.pdf
lecture7.pdflecture7.pdf
lecture7.pdfaminasouyah
 
paper1.pdf
paper1.pdfpaper1.pdf
paper1.pdfaminasouyah
 
paper8.pdf
paper8.pdfpaper8.pdf
paper8.pdfaminasouyah
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptxSurendraBasnet6
 

Similar to Public key cryptography and RSA (20)

UNIT-IV.pptx
UNIT-IV.pptxUNIT-IV.pptx
UNIT-IV.pptx
 
CNS.ppt
CNS.pptCNS.ppt
CNS.ppt
 
Ch9
Ch9Ch9
Ch9
 
Rsa diffi-network security-itt
Rsa diffi-network security-ittRsa diffi-network security-itt
Rsa diffi-network security-itt
 
18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security18CS2005 Cryptography and Network Security
18CS2005 Cryptography and Network Security
 
RSA
RSARSA
RSA
 
Rsa
RsaRsa
Rsa
 
3 pkc+rsa
3 pkc+rsa3 pkc+rsa
3 pkc+rsa
 
Pooguzhali
PooguzhaliPooguzhali
Pooguzhali
 
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 algorithm
Public Key Cryptography and RSA algorithmPublic Key Cryptography and RSA algorithm
Public Key Cryptography and RSA algorithm
 
Unit 3(1)
Unit 3(1)Unit 3(1)
Unit 3(1)
 
OS ppt Modified.pptx
OS ppt Modified.pptxOS ppt Modified.pptx
OS ppt Modified.pptx
 
CNS 3RD UNIT PPT.pptx
CNS 3RD UNIT PPT.pptxCNS 3RD UNIT PPT.pptx
CNS 3RD UNIT PPT.pptx
 
doc1.pdf
doc1.pdfdoc1.pdf
doc1.pdf
 
sheet1.pdf
sheet1.pdfsheet1.pdf
sheet1.pdf
 
lecture7.pdf
lecture7.pdflecture7.pdf
lecture7.pdf
 
paper1.pdf
paper1.pdfpaper1.pdf
paper1.pdf
 
paper8.pdf
paper8.pdfpaper8.pdf
paper8.pdf
 
Cryptography Key Management.pptx
Cryptography Key Management.pptxCryptography Key Management.pptx
Cryptography Key Management.pptx
 

More from Shafaan Khaliq Bhatti

2- System Initialization in Red Hat
2- System Initialization in Red Hat2- System Initialization in Red Hat
2- System Initialization in Red HatShafaan Khaliq Bhatti
 
3 - Disk Partitioning in Red Hat
3 - Disk Partitioning in Red Hat3 - Disk Partitioning in Red Hat
3 - Disk Partitioning in Red HatShafaan Khaliq Bhatti
 
6 - Package Management in Red Hat
6 - Package Management in Red Hat6 - Package Management in Red Hat
6 - Package Management in Red HatShafaan Khaliq Bhatti
 
7 - User Administration in Red Hat
7 - User Administration in Red Hat7 - User Administration in Red Hat
7 - User Administration in Red HatShafaan Khaliq Bhatti
 
12 - System Security in Red Hat
12 - System Security in Red Hat12 - System Security in Red Hat
12 - System Security in Red HatShafaan Khaliq Bhatti
 
15 lecture - acl part1, introduction to access control list
15   lecture  - acl part1, introduction to access control list15   lecture  - acl part1, introduction to access control list
15 lecture - acl part1, introduction to access control listShafaan Khaliq Bhatti
 
13 lecture - introduction and configuration of eigrp
13   lecture  - introduction and configuration of eigrp13   lecture  - introduction and configuration of eigrp
13 lecture - introduction and configuration of eigrpShafaan Khaliq Bhatti
 
10 lecture - ospf part1 , introduction to ospf , areas and abr
10   lecture  - ospf part1 , introduction to ospf , areas and abr10   lecture  - ospf part1 , introduction to ospf , areas and abr
10 lecture - ospf part1 , introduction to ospf , areas and abrShafaan Khaliq Bhatti
 
Message Authentication: MAC, Hashes
Message Authentication: MAC, HashesMessage Authentication: MAC, Hashes
Message Authentication: MAC, HashesShafaan Khaliq Bhatti
 
Protocols for Public Key Management
Protocols for Public Key ManagementProtocols for Public Key Management
Protocols for Public Key ManagementShafaan Khaliq Bhatti
 
Block Ciphers Modes of Operation
Block Ciphers Modes of OperationBlock Ciphers Modes of Operation
Block Ciphers Modes of OperationShafaan Khaliq Bhatti
 
Chapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardChapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardShafaan Khaliq Bhatti
 
Chapter 1: Overview of Network Security
Chapter 1: Overview of Network SecurityChapter 1: Overview of Network Security
Chapter 1: Overview of Network SecurityShafaan Khaliq Bhatti
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System StructuresShafaan Khaliq Bhatti
 

More from Shafaan Khaliq Bhatti (20)

1- Introduction to Red Hat
1- Introduction to Red Hat1- Introduction to Red Hat
1- Introduction to Red Hat
 
Linux Servers
Linux ServersLinux Servers
Linux Servers
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
 
2- System Initialization in Red Hat
2- System Initialization in Red Hat2- System Initialization in Red Hat
2- System Initialization in Red Hat
 
3 - Disk Partitioning in Red Hat
3 - Disk Partitioning in Red Hat3 - Disk Partitioning in Red Hat
3 - Disk Partitioning in Red Hat
 
6 - Package Management in Red Hat
6 - Package Management in Red Hat6 - Package Management in Red Hat
6 - Package Management in Red Hat
 
11 - SELinux in Red Hat
11 - SELinux in Red Hat11 - SELinux in Red Hat
11 - SELinux in Red Hat
 
7 - User Administration in Red Hat
7 - User Administration in Red Hat7 - User Administration in Red Hat
7 - User Administration in Red Hat
 
12 - System Security in Red Hat
12 - System Security in Red Hat12 - System Security in Red Hat
12 - System Security in Red Hat
 
15 lecture - acl part1, introduction to access control list
15   lecture  - acl part1, introduction to access control list15   lecture  - acl part1, introduction to access control list
15 lecture - acl part1, introduction to access control list
 
13 lecture - introduction and configuration of eigrp
13   lecture  - introduction and configuration of eigrp13   lecture  - introduction and configuration of eigrp
13 lecture - introduction and configuration of eigrp
 
10 lecture - ospf part1 , introduction to ospf , areas and abr
10   lecture  - ospf part1 , introduction to ospf , areas and abr10   lecture  - ospf part1 , introduction to ospf , areas and abr
10 lecture - ospf part1 , introduction to ospf , areas and abr
 
Message Authentication: MAC, Hashes
Message Authentication: MAC, HashesMessage Authentication: MAC, Hashes
Message Authentication: MAC, Hashes
 
Protocols for Public Key Management
Protocols for Public Key ManagementProtocols for Public Key Management
Protocols for Public Key Management
 
Authentication: keys, MAC
Authentication: keys, MACAuthentication: keys, MAC
Authentication: keys, MAC
 
Block Ciphers Modes of Operation
Block Ciphers Modes of OperationBlock Ciphers Modes of Operation
Block Ciphers Modes of Operation
 
Chapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption StandardChapter 3: Block Ciphers and the Data Encryption Standard
Chapter 3: Block Ciphers and the Data Encryption Standard
 
Chapter 1: Overview of Network Security
Chapter 1: Overview of Network SecurityChapter 1: Overview of Network Security
Chapter 1: Overview of Network Security
 
Chapter 3: Processes
Chapter 3: ProcessesChapter 3: Processes
Chapter 3: Processes
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 

Recently uploaded

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
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
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
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
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
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
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 

Recently uploaded (20)

Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
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
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
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
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
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 ...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 

Public key cryptography and RSA

  • 2. Some unanswered questions on symmetric cryptosystems • Key management: changing the secret key or establishing one is nontrivial – Change the keys two users share (should be done reasonably often) – Establish a secret key with somebody you do not know and cannot meet in person: (e.g., visiting secure websites such as e- shops) – This could be done via a trusted Key Distribution Center (details in a future lecture) – Can (or should) we really trust the KDC? – “What good would it do after all to develop impenetrable cryptosystems, if their users were forced to share their keys with a KDC that could be compromised by either burglary or subpoena?” –Diffie, 1988 • Digital signatures: one should make sure that a message came intact from the claimed sender
  • 3. A breakthrough idea • Rather than having a secret key that the two users must share, each users has two keys – One key is secret and he is the only one who knows it – The other key is public and anyone who wishes to send him a message uses that key to encrypt the message – Diffie and Hellman first (publicly) introduced the idea in 1976 –this was radically different than all previous efforts – NSA claims to have known it sine mid-1960s! – Communications-Electronic Security Group (the British counterpart of NSA) documented the idea in a classified report in 1970
  • 4. A word of warning • Public-key cryptography complements rather than replaces symmetric cryptography • There is nothing in principle to make public-key crypto more secure than symmetric crypto • Public-key crypto does not make symmetric crypto obsolete: it has its advantages but also its (major) drawbacks such as speed • Due to its low speed, it is mostly confined to key management and digital signatures
  • 5. The idea of public-key cryptography • The concept was proposed in 1976 by Diffieand Hellman although no practical way to design such a system was suggested • Each user has two keys: one encryption key that he makes public and one decryption key that he keeps secret – Clearly, it should be computationally infeasible to determine the decryption key given only the encryption key and the cryptographic algorithm • Some algorithms (such as RSA) satisfy also the following useful characteristic: – Either one of the two keys can be used for encryption –the other one should then be used to decrypt the message • First we will investigate the concept with no reference yet to practical design of a public-key system
  • 6. Essential steps in public-key encryption • Each user generates a pair of keys to be used for encryption and decryption • Each user places one of the two keys in a public register and the other key is kept private • If B wants to send a confidential message to A, B encrypts the message using A’s public key • When A receives the message, she decrypts it using her private key – Nobody else can decrypt the message because that can only be done using A’s private key – Deducing a private key should be infeasible • If a user wishes to change his keys –generate another pair of keys and publish the public one: no interaction with other users is needed
  • 7. Bob sends an encrypted message to Alice
  • 8. Some notation • The public key of user A will be denoted KUA • The private key of user A will be denoted KRA • Encryption method will be a function E • Decryption method will be a function D • If B wishes to send a plain message X to A, then he sends the cryptotext Y=E(KUA,X)
  • 9. A first attack on the public-key scheme –authenticity • Immediate attack on this scheme: • An attacker may impersonate user B: he sends a message E(KUA,X) and claims in the message to be B –A has no guarantee this is so – This was guaranteed in classical cryptosystems simply through knowing the key (only A and B are supposed to know the symmetric key) • The authenticity of user B can be established as follows: • B will encrypt the message using his private key: Y=E(KRB,X) • This shows the authenticity of the sender because (supposedly) he is the only one who knows the private key • The entire encrypted message serves as a digital signature – Note: this may not be the best possible solution: ideally, digital signatures should be rather small so that one can preserve many of them over a long period of time • Better schemes will be presented a couple of lectures on
  • 10. A scheme to authenticate the sender of the message
  • 11. Encryption and authenticity • Still a drawback: the scheme on the previous slide authenticate but does not ensure security: anybody can decrypt the message using B’s public key • One can provide both authentication and confidentiality using the public-key scheme twice: – B encrypts X with his private key: Y=E(KRB,X) – B encrypts Y with A’s public key: Z=E(KUA,Y) – A will decrypt Z (and she is the only one capable of doing it): Y=D(KRA,Z) – A can now get the plaintext and ensure that it comes from B (he is the only one who knows his private key): decrypt Y using B’s public key: X=E(KUB,Y)
  • 12. Applications for public-key cryptosystems 1.Encryption/decryption: sender encrypts the message with the receiver’s public key 2.Digital signature: sender “signs” the message (or a representative part of the message) using his private key 3.Key exchange: two sides cooperate to exchange a secret key for later use in a secret-key cryptosystem
  • 13. Requirements for public-key cryptosystems • Generating a key pair (public key, private key) is computationally easy • Encrypting a message using a known key (his own private or somebody else’s public) is computationally easy • Decrypting a message using a known key (his own private or somebody else’s public) is computationally easy • Knowing the public key, it is computationally infeasible for an opponent to deduce the private key • Knowing the public key and a ciphertext, it is computationally infeasible for an opponent to deduce the private key • Useful extra feature: encryption and decryption can be applied in any order: • E( KUA, D(KRA,X) ) =D(KRA, E( KUA, X)
  • 14. RSA • One of the first proposals on implementing the concept of public-key cryptography was that of Rivest, Shamir, Adleman–1977: RSA • The RSA scheme is a block cipher in which the plaintext and the ciphertext are integers between 0 and n-1 for some fixed n – Typical size for n is 1024 bits (or 309 decimal digits) – To be secure with today’s technology size should between 1024 and 2048 bits • Idea of RSA: it is a difficult math problem to factorize (large)integers – Choose p and q odd primes, n=pq – Choose integers d,e such that M^ed=M mod n, for all M<n – Plaintext: block of k bits, where 2k<n≤2k+1–can be considered a number M with M<n – Encryption: C=M^e mod n – Decryption: C^d mod n = M^de mod n = M – Public key: KU={e,n} – Private key:KR={d,n} • Question: How do we find d,e? – Answer: Number Theory!
  • 15. Notions of number theory • Fermat’s little theorem: if p is prime and a is positive integer not divisible by p, then • if p is a prime which does not divide a, then ap-1=1 (mod p) • In more simple language this says that if p is a prime that is not a factor of a, then when a is multiplied together p-1 times, and the result divided by p, we get a remainder of one • if we use a=7 and p=3, the rule says that 7^2 divided by 3 will have a remainder of one. In fact 49/3 does have a remainder of one • Comments: – This is a first step in our quest to find M^ed=M mod n –not quite enough though – Fermat’s little theorem provides a necessary condition for an integer p to be prime –the condition is not sufficient • We will turn this theorem into a (probabilistic) test for primality • Fermat’s theorem, as useful as will turn out to be does not provide us with integers d,e we are looking for –Euler’s theorem (a refinement of Fermat’s) does
  • 16. Euler’s totient function • ďż˝Euler’s function – If N is a positive integer, then phi(N) is defined to be the number of positive integers less than or equal to N and coprime (do not contain any factor in common with) to N. • ďż˝Example: • ďż˝Prime factor of 10 are 2 and 5 => 10 = (2^1) * (5^1) phi(10) = phi(2) * phi(5) = (2-1) * (5-1) = 1 * 4 = 4. The numbers of integers less than 10 that co prime with 10 are 4, they are 1, 3, 7 and 9. • To calculate Euler totient function, we need to find prime factors, this is the hardest part, for big number it is very hard to find all of its prime factors, this is the security in RSA which is hard to factor a large number. • ďż˝Easy to see that for any two primes p,q, φ(pq)=(p-1)(q-1) • ��Euler’s theorem: for any relatively prime integers a,n we have aφ(n)≡1 mod n • Corollary: Let p,q be two odd primes and n=pq. Then:
  • 17. Back to RSA • ďż˝Euler’s theorem provides us the numbers d,e such that Med=M mod n – ďż˝We have to choose d,e such that ed=kφ(n)+1, or equivalently, d≡e-1mod φ(n) – ďż˝Extended Euclid’s algorithm! • ďż˝The RSA scheme – ďż˝Key generation • ďż˝Choose two odd primes p,q –keep private • ďż˝Compute n=pq–make public • ďż˝Choose e, 1<e<φ(n) with gcd(φ(n),e)=1 –make public • ďż˝Compute d≡e-1mod φ(n) –keep private • i.e find d such that phi divides ed-1. • ďż˝Private key is {d,n} • ďż˝Public key is {e,n} • ďż˝Encryption • ďż˝Plaintext: block of k bits, where 2k<n≤2k+1–can be considered a number M with M<n • ďż˝Ciphertext: C=M^emod n • ďż˝Decryption: • ďż˝Ciphertext: C • ďż˝Plaintext: C^dmod n = Mdemod n = M
  • 18. Example • ďż˝Key generation • ďż˝Select primes p=17, q=11 • ďż˝Compute n=pq=187 • ďż˝Compute φ(n)=(p-1)(q-1)=160 • ďż˝Select e=7 • ďż˝Compute d: d=23 (use the extended Euclid’s algorithm) • ďż˝KU={7,187} • ďż˝KR={23,187} • ďż˝Encrypt M=88: 88^7mod 187 • ďż˝88^7mod 187 = 11 • ďż˝Decrypt C=11: 11^23mod 187 • ďż˝M=11^23 mod 187=88
  • 19.
  • 20. Attacking RSAďż˝ • Brute force attacks: try all possible private keysďż˝ • As in the other cases defend using large keys: nowadays integers between 1024 and 2048 bitsďż˝ • Mathematical attacksďż˝ • Factor n into its two primes p,q: this is a hard problem for large nďż˝ – Challenges by RSA Labs to factorize large integersďż˝ – Smallest unsolved challenge: 704 bitsďż˝ • Determine φ(n) directly without first determining p,q: this math problem is equivalent to factoringďż˝ • Determine d directly, without first determining φ(n): this is believed to be at least as difficult as factoringďż˝ • Suggestions for designďż˝ • The larger the keys, the better but also the slower the algorithmďż˝ • Choosing p,q badly may weaken the algorithmďż˝ – p,q should differ in length by only a few bits: for a 1024-bit key, p,q should be on the order of magnitude 1075to 10100ďż˝ – p-1 and q-1 should both contain a large prime factorďż˝ – gcd(p-1,q-1) should be smallďż˝ – hd should be larger than n1/4RSA
  • 21. RSA attack • Timing attacks: determine a private key by keeping track of how long a computer takes to decipher a message (ciphertext-only attack) –this is essentially an attack on the fast exponentiation algorithm but can be adapted for any other algorithmďż˝ • Whenever a bit is 1 the algorithm has more computations to do and takes more timeďż˝ • Countermeasures:ďż˝ • Ensure that all exponentiations take the same time before returning a result: degrade performance of the algorithmďż˝ • Add some random delay: if there is not enough noise the attack succeedsďż˝ • Blinding: multiply the ciphertext by a randomnumber before performing exponentiation –in this way the attacker does not know the input to the exponentiation algorithm. (implemented in the commercial products from RSA Data Security Inc.)