## RCM3720 Cryptography, Network and Computer Security

### Laboratory Class 6: Digital Signatures

You will need to read in the rcm3720.input file for the `str2num` and `num2str` procedures.
NOTE: To save typing in all the messages and long signature numbers, just copy them from signatures.txt

- For an RSA signature scheme, I provide the public key (n,e), where

            137
         n=2   -1,  e=17

- This value `n` has two large prime factors. Use my public key to verify my signature of the following message:

         This is my text.
         68767027465671577191073128495082795700768

- Now try with the public key

            67
        n=(6   - 1)/5,  e=17

- to verify my signature:

         Please feed my dog!
         1703215098456351993605104919259566435843590978852633

- For a Rabin signature scheme, I provide the public key

             74
         N=(7  -1)/6,

  which I know can be factorized into two large primes.
- Check the following message and signature:

         Arrive Thursday.
         189479723122534414019783447271411895509

- For an El Gamal signature scheme, I choose the next prime after

           150
          2

  which has a primitive root `a=2`. My public key is

          B=1369851585774063312693119161120024351761244461

- Verify the signature

          Leave AT ONCE!,
          1389080525305754392111976715361069425353578198
          1141326468070168229982976133801721430306004477

- For a DSS signature, choose `p` to be the next prime after

           170
          2     and q=143441505468590696209

- Verify that `q` is a divisor of `p-1`. A primitive root of `p` is `a=3`. Use this primitive root to determine

               (p-1)/q
          g = a        mod p

- The public key value is

          B=1394256880659595564848116770226045673904445792389839.

- Now using these values, verify this signature:

          Now's your chance!
          64609209464638355801
          13824808741200493330

- Now exchange some public keys with a friend, and sign messages to each other. Then verify the signatures you have been sent. Make sure you try each of
  - RSA signatures,
  - Rabin signatures,
  - El Gamal signatures,
  - DSS.