                               DHDEMO:
    Demonstration program for Diffie-Hellman extensions to RSAREF
                            User's manual

                           RSA Laboratories
                            March 21, 1994

                             Version 2.0

    Copyright (C) 1993-4 RSA Laboratories, a division of RSA Data
                            Security, Inc.


This note describes DHDEMO, a program that demonstrates the
Diffie-Hellman part of the RSAREF cryptographic toolkit.

DHDEMO is a simple program that exercises the Diffie-Hellman
extensions to RSAREF. With DHDEMO users can perform the
Diffie-Hellman key agreements, as well as generating parameters.

DHDEMO has a main menu with four commands. The main menu is displayed
when you start up DHDEMO, and is displayed again after DHDEMO
performs a command. After you select a command DHDEMO prompts for
parameters such as file names.

DHDEMO's commands and their parameters are summarized in the
following table.


          DHDEMO COMMAND                       PARAMETERS

S - Set up key agreement        which parameters to use
  generate private value        length of private value
  compute public value          name of two files in which to save
    from private value            public, private values

C - Compute agreed-upon key     which parameters to use
  compute Diffie-Hellman        name of two files in which other
    key from private value,       party's public value, and private  
    other party's public          value are saved
    value                       name of file in which to save agreed-
                                  upon key

G - Generate parameters         length of prime in bits (16-1024)
  generate Diffie-Hellman       length of "subprime" in bits
    prime and generator         name of file in which to save
                                  parameters

Q - Quit


NOTES

  1. You select parameters by number: '1' or '2'. The first parameters
     are built in. The second is the one generated by DHDEMO's 'Generate
     parameters' command. The second parameters are not active until
     they are generated.

  2. How you specify file names to DHDEMO depends on your operating
     system. DHDEMO recognizes the special file name '-' as the
     standard output stream (typically the screen display). You can
     usually cancel an DHDEMO command by giving a blank line in
     response to a prompt for a parameter.

  3. DHDEMO reads and writes all files except the parameters file
     (which it only writes) in binary mode.

  4. If you want DHDEMO not to display the main menu or any prompts,
     put the string '-s' on the command line when you start DHDEMO.
     This is useful when DHDEMO's input stream comes from a script
     file.

  5. DHDEMO seeds RSAREF's random number generator with a fixed value.
     As a result, DHDEMO sessions with the same commands and
     parameters produce the same results. The use of a fixed seed
     value is not recommended for non-demonstration applications.

  6. Two test scripts exercise DHDEMO's commands. '512dh.in' uses
     the built-in parameters to agree on a key; the resulting files
     '512dha.key' and '512dhb.key' should match. '256dh.in' generates
     new parameters, then agrees on a key. It writes the parameters
     to the file '256dh.par'. You can compare the results against
     reference files in the 'rdemo/scripts' directory.
