home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume23 / crack / part01 / Sources / tester.c < prev   
Encoding:
C/C++ Source or Header  |  1991-09-22  |  767 b   |  53 lines

  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. #define EEK 8192
  5. #define PROFx
  6.  
  7. static char *strings[] =
  8. {
  9.     "fredfred",
  10.     "brian",
  11.     "ab",
  12.     "qwerty",
  13.     "marginallytoolong",
  14.     (char *) 0
  15. };
  16.  
  17. main ()
  18. {
  19.     int i;
  20.     char **ptr;
  21.     char a[255];
  22.     char b[255];
  23.  
  24.     init_des ();
  25.  
  26. #ifndef PROF
  27.     for (ptr = strings; *ptr; ptr++)
  28.     {
  29.     strcpy (a, crypt (*ptr, *ptr));
  30.     strcpy (b, fcrypt (*ptr, *ptr));
  31.  
  32.     printf ("\nCheck Old: %s\tNew: %s\n", a, b);
  33.  
  34.     if (!strcmp (a, b))
  35.     {
  36.         printf ("fcrypt() is compatible with standard crypt()\n");
  37.     } else
  38.     {
  39.         printf ("fcrypt() is not compatible !!! \7\n");
  40.         exit (1);
  41.     }
  42.     }
  43.     printf ("Doing %d fcrypts()\n", EEK);
  44. #endif
  45.  
  46.     for (i = EEK; i; i--)
  47.     {
  48.     fcrypt ("fredfred", "eek");
  49.     }
  50.  
  51.     return (0);
  52. }
  53.