home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / des2.zip / tstdes.c < prev    next >
Text File  |  1993-03-19  |  538b  |  21 lines

  1. #define INCL_BASE
  2. #include <os2.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. SHORT EXPENTRY EncryptData(CHAR *key, CHAR *data, SHORT length) ;
  6. SHORT EXPENTRY DecryptData(CHAR *key, CHAR *data, SHORT length) ;
  7.  
  8. main(int argc, char *argv[], char *envp[])
  9. {
  10. static CHAR mytext[40] ;
  11. SHORT x ;
  12. if(argc < 2)
  13.     return 0 ;
  14. strncpy(mytext, argv[1], 40) ;
  15. x = strlen(mytext) + ((strlen(mytext) % 8));
  16. printf("%s\n", mytext) ;
  17. EncryptData("10000000", mytext, x) ;
  18. DecryptData("10000000", mytext, x) ;
  19. printf("%s\n", mytext) ;
  20. }
  21.