Csc2110 discrete mathematics tutorial 6 chinese remainder theorem rsa and primality test l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 21

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


  • 481 Views
  • Uploaded on
  • Presentation posted in: General

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

Download Presentation

CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test

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 l.jpg

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

Hackson Leung


Announcement l.jpg

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 l.jpg

Agenda

  • Chinese Remainder Theorem

  • RSA

  • Primality Test


Chinese remainder theorem l.jpg

Chinese Remainder Theorem

  • Example 1

    • Solve for

    • Since

    • Then 3-1 exists and

    • Therefore,


Chinese remainder theorem5 l.jpg

Chinese Remainder Theorem

  • Example 2

    • Solve for

    • Since

    • We reduce it to

    • Same as example 1

    • What if ?

      • Contradiction!


Chinese remainder theorem6 l.jpg

Chinese Remainder Theorem

  • Solve the following


Chinese remainder theorem7 l.jpg

Chinese Remainder Theorem

  • Consider so that

  • Step 1: Let

  • Step 2: Construct


Chinese remainder theorem8 l.jpg

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 l.jpg

Chinese Remainder Theorem

  • Example 1

  • Solve for largest such that


Chinese remainder theorem10 l.jpg

Chinese Remainder Theorem

  • Step 1:

  • Step 2:

  • Step 3:

  • Step 4:

  • Step 5:


Chinese remainder theorem11 l.jpg

Chinese Remainder Theorem

  • What if ?

  • We can always reduce them

  • Example 2

    • Solve the largest such that


Chinese remainder theorem12 l.jpg

Chinese Remainder Theorem

  • Analyze first

  • Thus, we have


Chinese remainder theorem13 l.jpg

Chinese Remainder Theorem

  • Take a look at

  • So

  • Same as example 1

  • We want s to be relatively prime only!


Slide14 l.jpg

RSA

  • Step 1: , and very large prime

  • Step 2:

  • Step 3: Choose

  • Step 4: Find

  • Public key:

  • Private key:


Slide15 l.jpg

RSA

  • Example 1

    • Let

    • Give the public and private keys in RSA cryptosystem


Slide16 l.jpg

RSA

  • Step 1:

  • Step 2:

  • Step 3: , the choice is ok

  • Step 4:


Slide17 l.jpg

RSA

  • Public key:

  • Private key:

  • Example 2: Encrypt 5

  • Example 3: Decrypt


Slide18 l.jpg

RSA

  • Example 3


Primality test l.jpg

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 l.jpg

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


The end l.jpg

The End


  • Login