csc2110 discrete mathematics tutorial 6 chinese remainder theorem rsa and primality test
Download
Skip this Video
Download Presentation
CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test

Loading in 2 Seconds...

play fullscreen
1 / 21

CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test - PowerPoint PPT Presentation


  • 557 Views
  • Uploaded on

CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test. Hackson Leung. Announcement. Homework Set 2 is released! Deadline 30 Oct 17:00 Sharp No late submission is accepted Submit at the drop box near SHB 924 Project

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test' - anastacia


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
csc2110 discrete mathematics tutorial 6 chinese remainder theorem rsa and primality test

CSC2110 Discrete MathematicsTutorial 6Chinese Remainder Theorem, RSA and Primality Test

Hackson Leung

announcement
Announcement
  • Homework Set 2 is released!
  • Deadline
    • 30 Oct 17:00 Sharp
    • No late submission is accepted
    • Submit at the drop box near SHB 924
  • Project
    • Those who have not registered, we assigned for you, please check CUHK email
agenda
Agenda
  • Chinese Remainder Theorem
  • RSA
  • Primality Test
chinese remainder theorem
Chinese Remainder Theorem
  • Example 1
    • Solve for
    • Since
    • Then 3-1 exists and
    • Therefore,
chinese remainder theorem5
Chinese Remainder Theorem
  • Example 2
    • Solve for
    • Since
    • We reduce it to
    • Same as example 1
    • What if ?
      • Contradiction!
chinese remainder theorem6
Chinese Remainder Theorem
  • Solve the following
chinese remainder theorem7
Chinese Remainder Theorem
  • Consider so that
  • Step 1: Let
  • Step 2: Construct
chinese remainder theorem8
Chinese Remainder Theorem
  • Step 3: Find the multiplicative inverse of
    • Remember how to find multiplicative inverse?
    • Extended Euclid’s Algorithm!
  • Step 4:
  • Step 5: Adjust to meet the requirement
chinese remainder theorem9
Chinese Remainder Theorem
  • Example 1
  • Solve for largest such that
chinese remainder theorem10
Chinese Remainder Theorem
  • Step 1:
  • Step 2:
  • Step 3:
  • Step 4:
  • Step 5:
chinese remainder theorem11
Chinese Remainder Theorem
  • What if ?
  • We can always reduce them
  • Example 2
    • Solve the largest such that
chinese remainder theorem12
Chinese Remainder Theorem
  • Analyze first
  • Thus, we have
chinese remainder theorem13
Chinese Remainder Theorem
  • Take a look at
  • So
  • Same as example 1
  • We want s to be relatively prime only!
slide14
RSA
  • Step 1: , and very large prime
  • Step 2:
  • Step 3: Choose
  • Step 4: Find
  • Public key:
  • Private key:
slide15
RSA
  • Example 1
    • Let
    • Give the public and private keys in RSA cryptosystem
slide16
RSA
  • Step 1:
  • Step 2:
  • Step 3: , the choice is ok
  • Step 4:
slide17
RSA
  • Public key:
  • Private key:
  • Example 2: Encrypt 5
  • Example 3: Decrypt
slide18
RSA
  • Example 3
primality test
Primality Test
  • Step 1: Pick a random number , set
  • Step 2: Calculate
  • Step 3: If not 1 (and not -1), composite, done
  • Step 4: If -1, “probably” prime, done
  • Step 5: If 1 and k is odd, “probably” prime,

done

  • Step 6: , go back to step 2

Check when k < n - 1

primality test20
Primality Test
  • Example: Test if 221 is prime
  • Pick 174 to test
  • Under this test, 221 is “probably” prime
  • Pick 137 to test
  • We are sure 221 is composite!
  • 174: strong liar, 137: witness
ad