ICS 6D Sandy Irani Cryptography Intro Alice wants to send a message to Bob so that even if Eve can see the transmitted information she does not learn the true message message message message ID: 535004
Download Presentation The PPT/PDF document "Intro to Cryptography" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Intro to Cryptography
ICS 6D
Sandy
IraniSlide2
Cryptography Intro
Alice wants to send a message to Bob so that even if Eve can see the transmitted information, she does not learn the true message.
message
message
message
messageSlide3
Sending Numbers as Messages
Modern cryptography is based on number theory
Usually we want to send text messages.
Need to convert text to a number and back.
Translation between text and numbers does not need to be secure.Text to number function must be one-to-one so that translation back to text is well defined.Slide4
Sending Numbers as Messages
Function mapping text to numbers
Could use ASCII representation of each
characher
Simple example mapping {A, B,…, Z, _ } to {01,02,…,27}
SEND_HELP
190514042708051216
805121215Slide5
Sending Numbers as Messages
Can break up message so that each individual message is a number in the range from 0 through N-1 for some large N.
Cryptographic scheme will use arithmetic mod N
m: plaintext
c: cyphertext
encrypt: ℤN → ℤN encrypt(m) = c
decrypt: ℤN → ℤN decrypt(c) = mSlide6
A Simple Cryptosystem
Alice: message sender
Bob: message received
Alice and Bob meet in advance and agree on a secret key k
∈ ℤN
Encrypt: c = (m+k) mod NDecrypt: m = (c-k) mod N
Encrypt is one-to-oneSlide7
A Simple Cryptosystem
Alice and Bob meet in advance and agree on a secret key k
∈
ℤ
NEncrypt: c = (m+k
) mod NDecrypt: m = (c-k) mod NNot very secureOne (
m,c) pair reveals kCan infer k from many c’s.
Example
:N = 79, k = 55m = 41Slide8
Public Key Cryptography
Private key cryptography
requires that communicating parties agree in advance on a secret key.
Public key cryptography
:Bob publishes an encoding key (public key) so that anyone can send Bob a message
encode(m, e) = c e: public keyOnly Bob has the decryption key (private key) that can decode messages sent by the public key.decode(c, d) = m d: private keySlide9
Public Key Cryptography
Security of a public key cryptosystem relies on the assumption that some functions are hard to compute:
If Eve knows c, she can test
all possible messages m to see
if encrypt(m, e) = c.
Prohibitively expensive if the spaceof all possible messages is largeAssume that there is no fast way to
directly compute the decryptionfunction without knowing the privatekey in advanceSlide10
RSA
Bob picks
two
large prime numbers p and q
Bob computes:N = pq
φ = (p-1)(q-1)Find e such that gcd(e,
φ) = 1. (Usually e is prime)Compute d = multiplicative inverse of e mod φ
:de mod φ = 1
Public key: e, NPrivate key: d
Anyone who knows
p and q can compute
d, the private keySlide11
RSA
Bob picks to large prime numbers p and q
Bob computes:
N =
pqφ = (p-1)(q-1)
Find e such that gcd(e, φ
) = 1. (Usually e is prime)Compute d = multiplicative inverse of e mod φ:
de mod φ = 1
Public key: e, NPrivate key: d
Encrypt m: c = me
mod NDecrypt c: m = cd
mod NSlide12
RSA
Example: p = 5, q = 11
Pick e = 37 and find d:Slide13
RSA
Example: p = 5, q = 11
N = 55,
φ
= 40Pick e = 37, so d = 13Encrypt m: c = me
mod NDecrypt c: m = cd mod N
m = 17Slide14
RSA: why does it work?
Euler’s Theorem
(special case):
If p and q are prime and gcd(m,pq) = 1, then
m(p-1)(q-1) mod pq = 1
Know: c = me
mod N want to know that m = cd
mod NAlso know that d·e mod (p-1)(q-1) = 1Slide15
RSA
Example: p = 7, q = 13
Pick e = 41 and find d:Slide16
RSA
Example: p = 7, q = 13, N = 91,
φ
= 72
Pick e = 41 d = 65m = 55