home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / unix / crackunx.txt / Sources / tester.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-25  |  640 b   |  41 lines

  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. main (argc, argv)
  5.     int argc;
  6.     char *argv[];
  7. {
  8.     register int i;
  9.     long int t;
  10.  
  11.     if (argc < 2)
  12.     {
  13.     exit (1);
  14.     }
  15.     init_des ();
  16.  
  17.     printf ("%s\n", fcrypt ("fredfred", "fredfred"));
  18.  
  19.     if (strcmp (fcrypt ("fredfred", "fredfred"), "frxWbx4IRuBBA"))
  20.     {
  21.     printf ("Version of fcrypt() is not compatible with standard.\n");
  22.     exit (0);
  23.     }
  24.     i = atoi (argv[1]);
  25.  
  26.     printf ("Doing %d fcrypts()\n", i);
  27.  
  28.     time (&t);
  29.     printf ("%s", ctime (&t));
  30.  
  31.     while (i--)
  32.     {
  33.     fcrypt ("fredfred", "fredfred");
  34.     }
  35.  
  36.     time (&t);
  37.     printf ("%s", ctime (&t));
  38.  
  39.     return (0);
  40. }
  41.