Suggestions for RSA assignment - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Suggestions for RSA assignment

Description:

Let bit [j] be an array contains zeros or 1 that is the binary representation of ... E-mail the decoded message to the instructor. ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 12
Provided by: EdwardDon8
Category:

less

Transcript and Presenter's Notes

Title: Suggestions for RSA assignment


1
Suggestions for RSA assignment
2
Generation of random primes
  • Use a value of n that is close to the size of the
    Java data type long. The largest signed long
    integer is ____________________.
  • Question. Does Java support unsigned data types?
  • Though there are interesting methods that can be
    used to generate random primes p and q, just pick
    a p and q from a table of primes.
  • Search the internet for p and q.
  • http//www.utm.edu/research/primes/lists/

3
more on n, p, and q
  • Since pq n choose p and q so that n will not
    be larger than the longest signed long integer.
  • Calculate (p-1)(q-1) and call this phi.

4
Choosing e
  • Choose e such that 1lte lt phi and gcd (e, phi)
    1.
  • In practice e 3, 7 or 65537 (216 1), called
    the Fermat primes. In the binary representation
    nearly all the bit are zero.

5
Choosing d
  • The public key is (n,e)
  • Choose d such that 1ltdltphi and
    ed 1 mod (phi).

6
Encoding
  • Let m be the numeric block number. The
    cipherText c me mod (n)
  • Method for the calculation of me mod (n).
  • In general y xe mod (n)
  • Express e in binary
  • Let bit j be an array contains zeros or 1 that
    is the binary representation of e. bit 0 is the
    least significant bit and bit j 1 is the first
    non zero bit.
  • Continued on next slide.

7
Modular exponentiation
  • y x
  • for k j 2 j gt0 j - -
  • y yy mod (n)
  • if ( bit k 1)
  • y y x mod n
  • return y

8
Decoding
  • Decoding, m cd mod (n), is not nearly as
    efficient since d does not have most of its bits
    as 1. For large message decoding can be quite
    lengthy

9
Project Summary
  • Create your own public and private key. Note n
    should be near the maximum size of long.
  • Send lackey your public key to be placed on the
    web at www3.ltu.edu/lackey.
  • Get the message intended for you and decode it.
  • Use A-1, B-2, ,Z-27,?-28 ,. -29, blank-30.
  • Block the message by 4s. Pad with blanks if
    short. Replace unknown characters with .

10
Methods
  • Convert a long to binary
  • Modular exponentiation
  • Encode
  • Decode
  • Convert one 8 digit number to 4 letters
  • Convert 4 letters to on 8 digit number
  • Note get p,q, n and phi by hand

11
The Project
  • E-mail the instructor (lackey_at_ltu.edu) your
    private key. This will be posted to the web.
  • An encoded message will be posted to the web (
    blocked 4) for you.
  • Decode the message.
  • E-mail the decoded message to the instructor.
  • Turn in a listing of all programs used and the
    lab handout.
Write a Comment
User Comments (0)
About PowerShow.com