home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Orlando_1993 / Devcon93.4 / Networking2 / AS225 / support / ACrypt.doc next >
Encoding:
Text File  |  1993-01-11  |  1.4 KB  |  50 lines

  1. ******* amiga.lib/ACrypt *************************************************
  2. *
  3. *   NAME
  4. *    ACrypt -- Encrypt a password (V37)
  5. *
  6. *   SYNOPSIS
  7. *    newpass = ACcrypt( buffer, password, username )
  8. *
  9. *    STRPTR ACrypt( STRPTR, STRPTR, STRPTR);
  10. *
  11. *   FUNCTION
  12. *    This function takes a buffer of at least 12 characters in length,
  13. *    an unencrypted password and the user's name (as known to the host
  14. *    system) and returns an encrypted password in the passed buffer. 
  15. *    This is a one-way encryption. Normally, the user's encrypted 
  16. *    password is stored in a file for future password comparison.
  17. *
  18. *   INPUTS
  19. *    buffer     - a pointer to a buffer at least 12 bytes in length.
  20. *    password   - a pointer to an unencrypted password string.
  21. *    username   - a pointer to the user's name.
  22. *
  23. *   RESULT
  24. *    newpass    - a pointer to the passed buffer if successful, NULL
  25. *                 upon failure. The encrypted password placed in the
  26. *                 buffer will be be eleven (11) characters in length
  27. *                 and will be NULL-terminated.
  28. *
  29. *   EXAMPLE
  30. *
  31. *    UBYTE *pw, *getpassword() ;
  32. *    UBYTE *user = "alf"
  33. *    UBYTE *newpass ;
  34. *    UBYTE buffer[16] ;         \* size >= 12 *\
  35. *
  36. *    pw = getpassword() ;   \* your own function *\
  37. *
  38. *    if((newpass = ACrypt(buffer, pw, user)) != NULL)
  39. *    {
  40. *        printf("pw = %s\n", newpass) ; \* newpass = &buffer[0] *\
  41. *    }
  42. *    else
  43. *    {
  44. *        printf("ACrypt failed\n") ;
  45. *    }
  46. *
  47. *   NOTES
  48. *
  49. ************************************************************************
  50.