Computer Security Lecture 22 - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Computer Security Lecture 22

Description:

Impact of Background and Experience on Software Inspections. 11 AM, Friday March 7, 2003 ... Then if gd = 1 mod p, then g is not a generator. Diffie-Hellman Background ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 19
Provided by: pgb8
Category:

less

Transcript and Presenter's Notes

Title: Computer Security Lecture 22


1
Computer Security Lecture 22
  • Phillip G. Bradford
  • Computer Science
  • University of Alabama

2
Impact of Background and Experience on Software
Inspections
Dr. Jeffrey Carver Department of Computer
Science University of Maryland
  • 11 AM, Friday March 7, 2003
  • Houser 108

3
Outline
  • Review Last Lecture
  • Overview of the next lectures
  • RC5
  • Public Key Systems
  • Diffie-Hellman
  • RSA

4
Objectives
  • Understand the RC5 Hash Function
  • Public Key systems
  • Background for
  • Diffie-Hellman
  • Diffie-Hellman
  • Background for
  • RSA
  • RSA in next lecture

5
Rivests RC5See also RSA Research Web
  • Hash function
  • Xor, addition and rotation
  • Variable number of rounds r
  • Uses 2(r 1) key rounds
  • S1,,S2(r1)
  • Plaintext represented as LR

6
Rivests RC5
  • First L L S0 and R R S1
  • For i ? 1 to r do
  • L ? ((L xor R) ltltlt R) S2i
  • R ? ((R xor L) ltltlt L) S2i1
  • Where ltltlt is a right circular shift

7
Rivests RC5
  • Generating the keys, given T holding initial key
  • P and Q are constants
  • See page 345
  • S0 P
  • For i ? 1 to 2(r1) do
  • Si ? (Si-1 Q) mod 232

8
Rivests RC5
  • Mixing Key T, T is 32c for some const c
  • i ? j ? 0 A ? B ? 0
  • Loop 3n times (n max2(r1), c )
  • A ? Si ? (Si A B) ltltlt 3
  • B ? Ti ? (Ti A B) ltltlt (A B)
  • i ? (i1) mod 2(r1)
  • j ? (j1) mod c

9
Diffie-Hellman Background
  • Primitive Roots
  • Let p be prime, then the integer g lt p
  • Is a primitive root iff
  • For all a in Zp
  • Then there is an j such that gj a mod p
  • In other words, g is a generator of Zp

10
Diffie-Hellman Background
  • Examples, (page 253) where p 11
  • 21 2 mod 11
  • 22 4 mod 11
  • 23 8 mod 11
  • 24 5 mod 11
  • 25 10 mod 11
  • 26 9 mod 11
  • 27 7 mod 11
  • 28 3 mod 11
  • 29 6 mod 11
  • 210 1 mod 11

11
Diffie-Hellman Background
  • Not all elements in Zp are generators!
  • Example 3 is not primitive mod 11
  • Since 3j 2 mod 11 does not hold for any j
  • General algorithm for primitive roots
  • Take p-1s factors, say p-1 q1qn
  • Let d (p-1)/q, for each q in q1 , , qn
  • Then if gd 1 mod p, then g is not a generator

12
Diffie-Hellman Background
  • How can we find a primitive root?
  • Famous Theorem
  • If p gt 2 is prime, then it has Phi(p-1) primitive
    roots mod p.
  • Phi(n) is Eulers Phi-function
  • Number of integers between 1 and n that are
    relatively prime to n
  • Give a primitive root hunting algorithm!

13
Diffie-Hellman
  • Alice Bob agree on p and g that is a primitive
    root mod p
  • Allow p and g to be public, perhaps with
    verifying proofs

14
Diffie-Hellman
  • Alice chooses a large random integer x
  • Sends Bob X gx mod p x secret
  • Bob chooses a large random integer y
  • Sends Alice Y gy mod p y secret
  • Alice now computes k Yx mod p
  • Bob now computes k Xy mod p
  • Note secret key k k gxy mod p

15
Review of Public Keys
  • Two keys
  • The public Key is open to the world
  • The private key is secret, only you know it
  • Knowing the public key, it is intractable to
    compute the private key
  • Each key is the others inverse
  • In terms of the cipher

16
Background Review for RSA
  • Eulers Phi Function Again!
  • Phi(n) The number of relatively prime integers
    to n
  • If p is prime, then Phi(p) p-1
  • If p and q are prime
  • Then Phi(pq) (p-1)(q-1)
  • If p and q are relatively prime
  • Then Phi(pq) Phi(p) Phi(q)

17
RSA Algorithm
  • Find to (large) primes p and q, let npq
  • Compute Phi(n) (p-1)(q-1)
  • Find an integer exponent E so that
  • gcd(Phi(n),E) 1 relative primality
  • Compute d E-1 mod Phi(n)
  • Public Key KU ltE,ngt
  • Private Key KR ltd,ngt

18
RSA Encryption Decryption
  • Encryption
  • Given a block of plaintext M lt n
  • Ciphertext C ME mod n
  • Decryption
  • M Cd mod n
  • Next lecture Why this works!
Write a Comment
User Comments (0)
About PowerShow.com