Cryptography Project.

  • Project : ANSI X9.17 Pseudorandom Number Generator
  • Programming Language used for implementation : Java
  1. User chooses lucky numbers and then compares with the random numbers generated by the ANSI X9.17 Psuedo Random Number Generator. If the user's numbers match, then a congratulatory winning message is displayed.
  2. The combination of the numbers generated in the lotto should be unique.
  3. Develope a GUI application, i.e. a Java applet that runs the application using the functionality of DES and random number generator.
  4. I-Ri, Ri, I-Vi+1 and Vi+1 are generated at different stages of the ANSI X9.17 PRNG and are displayed. Ri is to be used for lottery random numbers.

The figure shows the steps in ANSI X9.17 . It uses Triple DES encryption decryption.

First click Generate to get Ri and than click on Buttons CA Lottery and Mega Lottery. Every time you click on Generate you will get different values. To get back I-Ri and I-Vi+1, click Decrypt Ri and Vi+1

When you click the link the applet starts and shows the following things:

  • I-Ri (Input to EDE(2))
  • Ri (Output of EDE(2))
  • I-Vi+1(Input to EDE(3))
  • Vi+1 (Output of EDE(3))
They are in hexadecimal form, values appear when you click button Generate.

Lottery Numbers: (Ticket number and Mega Number for each in decimal form using Ri)

CA Lottery: Ticket number of 5 unique digits between 1 to 50, one mega number between 1 to 26

Mega Lottery: Ticket number of 5 unique digits between 1 to 42, one mega number between 1 to 15

Input DTi is Date and time string which is obtained in the program itself by getting the current time and date which varies according to date and time.

Keys K1, K2 are same for each EDE:

K1= AABB09182736CCDD (hexadecimal form)

K2= A1B203182736CCDD Vi = initially all 64 bit are set to 0 and for next time, i.e. when you click Generate again, Vi = Vi+1.

Verification of results:

Written algorithm for decrypting - To decrypt the values of Ri and Vi+1 and get back I-Ri and I-Vi+1 respectively, by clicking button (Decrypt Ri and Vi+1)


Published papers online for DES in pdf format is found at the following website:

Published papers online for ANSI X9.52 in pdf format :