Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cryptography Prof. Seth D. Bergmann Rowan University Computer Science.

Similar presentations


Presentation on theme: "Cryptography Prof. Seth D. Bergmann Rowan University Computer Science."— Presentation transcript:

1 Cryptography Prof. Seth D. Bergmann Rowan University Computer Science

2 Cryptography: Why? Secure communication is needed by:
Government Military Financial organizations Individual citizens The Internet is not a secure channel.

3 Cryptography Alice wishes to send a confidential message to Bob.

4 Cryptography (Evil) Eve wants to intercept the message
To learn what Alice is sending to Bob To change all or part of the message to Bob To pretend that she is Alice (and/or Bob). Eve Bob Alice

5 How Can Alice and Bob Thwart Eve?
Encrypt the message (plain text) into an unreadable form (cipher text) which only Bob can decipher Authenticate Alice’s message, to prove that it is really sent directly by Alice Provide a message ‘digest’ which guarantees that Eve has not tampered with the message.

6 Secure Communication Terminology
Cryptology Cryptography (Encryption and decryption) Cryptanalysis (“Breaking” a code) Authentication Integrity Verification (of authenticity and integrity) Key Distribution Certificates.

7 Metaphors Authentication Certificate Encryption and Integrity
Ordinary To::

8 Private-key Cryptography
Same key used for encryption and decryption Symmetric Key distribution is a major problem.

9 Private-key Cryptography
OK, How about ? We need to agree on a Key!

10 Key Distribution Could Be a Problem
OK, I’ve got your key!!! OK, How about ? We need to agree on a Key!

11 Private-key Cryptography
We both need to know how to use this key for encryption and decryption !

12 Math for Encryption and Decryption
All information is coded as 0’s and 1’s For example: ‘A’ is 00000 ‘B’ is 00001 ‘C’ is 00010 ‘Z’ is 11001

13 Math for Encryption and Decryption
Exclusive OR is defined as: + x y 1 0 = false 1 = true Exclusive OR means ‘different’

14 Math for Encryption and Decryption
x y 1

15 Using XOR to Encrypt a Message
Example: plain = “HI” key = “LG” cipher = “MO”

16 Using XOR to Decrypt the Cipher

17 Using XOR to Decrypt the Cipher
Example: cipher = “MO” key = “LG” plain = “HI”

18 Private-Key Cryptography Summary
Encryption: Decryption:

19 Public-key Cryptography
Each person has two keys: Public key, used by anyone encrypting messages to this person Private key, used by this person to decrypt received messages A person may announce the public key to the world, but the private key is secret. The public and private keys are related in such a way that the private key is used to decrypt any message encrypted with the public key.

20 Use it to encrypt messages to me!
Bob Has Two Keys My private key is My public key is ! Use it to encrypt messages to me!

21 Alice Uses Bob’s Public Key to Encrypt the Message
Encr( ,“Hey!”) = “gX&*3i” “gX&*3i”

22 Bob Uses His Private Key to Decrypt the Message
Decr(“gX&*3i”, ) = “Hey!”

23 Eve Has Been Thwarted “gX&*3i” “Hey!” ??? “Hey!”
No problem with key distribution!

24 How Does it Work? Prime numbers have no divisors:
2, 3, 5, 7, 11, 13, 17, 19, 23, ... Every number is the product of prime factors Examples 36 = 2 x 2 x 3 x 3 21 = 3 x 7 100 = 2 x 2 x 5 x 5 Finding factors of large numbers is hard

25 Public and Private Keys
The public and private keys are related To find Bob’s private key, using his public key, Eve will have to factor the public key. This could take years, even with a fast computer. Eve has been thwarted.

26 How Does Public Key Cryptography Work? Mathematics
Modular Arithmetic Exponents, modular Multiplicative inverse, modular.

27 Modular Arithmetic 2 1

28 Modular Arithmetic Remainder after division Example:

29 Mod 5 4 1 3 2

30 Multiplicative Inverses
if xy = 1, then x and y are inverses What is the inverse of 2 (mod 5)?

31 How Does Public Key Cryptography Work?
My private key is My public key is ! Use it to encrypt messages to me!

32 How Does Public Key Cryptography Work?
Bob chooses two random prime numbers: p and q Bob’s public modulus is m = pq n = (p-1) (q-1) Bob chooses a number, e, which is relatively prime to n (e and n share no factors) e is Bob’s (public) encryption exponent m and e, together, make up Bob’s public key.

33 How Does Public Key Cryptography Work?
Bob announces his public key (m,e) to the world To encrypt a message to Bob, Alice codes the message as a number and uses his public key:

34 Decryption Bob will need a private key, d, to decrypt the message:
The (private) decryption exponent is the inverse of the (public) encryption exponent

35 Decryption From Fermat’s Little Theorem (1636):
To decrypt the message from Alice, Bob uses his private key, d:

36 Can Eve Find Bob’s Private Key?
Hmm, m = 55 = 5*11 = p*q n = (p-1) * (q-1) = 4*10 = 40 d = e-1 (mod 40) = 23 Gotcha! My public key is: m = 55 e = 7

37 Public Key Cryptography
My private key is d = 103,583,939 I don’t care who intercepts the message. My public key is: m = 117,852,727 e = 24,059 Use these to encrypt messages to me!

38 Can Eve Find Bob’s Private Key?
Hmm, m = 117,852,727 = ??? Takes too long to factor!!! Foiled!! My public key is: m = 117,852,727 e = 24,059

39 Useful By-products of Public Key Cryptography
Integrity: Has somebody tampered with this message? Authentication: Is this message really coming from the person in the from field, or is it from an impostor? (Digital signature).

40 Integrity To: Alice From: Bob You stink! To: Alice From: Bob
I Love You Eve can intercept a message, change it, and forward it to Alice, without her knowing it! (Integrity is poor)

41 Authentication To: Alice From: Bob Meet me after school at McD’s!
Eve can send a message to Alice, pretending to be Bob! (The message is not authentic)

42 Digital Signatures Bob wishes to sign a message to Alice in such a way that she can be sure it is from him She will also know that nobody has tampered with the message.

43 Digital Signatures Solution to both problems
Ensure message integrity Provide authentication By-product of public-key cryptography.

44 Digital Signatures Bob encrypts the message with his private decryption key, d!!! This is his signature. Sig = Decr(msg) He sends his signature and the message to Alice. To: Alice From: Bob I Love You Signed:

45 Verification Alice uses Bob’s public encryption key (m,e) to decrypt the signature. Encr(sig) = msg If the result doesn’t match the message, she knows that either Someone altered the message or the signature, or The message did not come from Bob It’s really from Bob! To: Alice From: Bob I Love You Signed: To: Alice From: Bob I Love You Encr(011010) = I Love You

46 Digital Signatures Why does it work? (msgd)e (mod m) = msg
There is only one person who knows d: Bob He is the only one who could have created the signature, msgd.

47 Summary Communications Security is Improved by
Cryptography (Encryption & Decryption) Integrity (Tamper-proof communications) Authenticity (Impostors are ignored) No security system is 100% effective Thank you for listening... And be careful!!

48 Are You Interested in Computer Science?


Download ppt "Cryptography Prof. Seth D. Bergmann Rowan University Computer Science."

Similar presentations


Ads by Google