 Autodocs Static lib:
amiga.lib ACrypt AddTOF ArgArrayDone ArgArrayInit ArgInt ArgString BeginIO CallHook CallHookA CheckRexxMsg CoerceMethod CoerceMethodA CreateExtIO CreatePort CreateStdIO CreateTask CxCustom CxDebug CxFilter CxSender CxSignal CxTranslate DeleteExtIO DeletePort DeleteStdIO DeleteTask DoMethod DoMethodA DoSuperMethod DoSuperMethodA FastRand FreeIEvents GetRexxVar HookEntry HotKey InvertString LibAllocPooled LibCreatePool LibDeletePool LibFreePooled NewList RangeRand RemTOF SetRexxVar SetSuperAttrs TimeDelay afp arnd dbf fpa printf sprintf stdio Include GuruMeditation
|
Docs » Autodocs » amiga.lib » ACrypt
ACrypt -- Encrypt a password
newpass = ACrypt( buffer, password, username ) UBYTE *ACrypt( UBYTE *, UBYTE *, UBYTE *) ;
This function takes a buffer of at least 12 characters in length, an unencrypted password and the user's name (as known to the host system) and returns an encrypted password in the passed buffer. This is a one-way encryption. Normally, the user's encrypted password is stored in a file for future password comparison.
buffer - a pointer to a buffer at least 12 bytes in length. password - a pointer to an unencrypted password string. username - a pointer to the user's name.
newpass - a pointer to the passed buffer if successful, NULL upon failure. The encrypted password placed in the buffer will be be eleven (11) characters in length and will be NULL-terminated.
UBYTE *pw, *getpassword() ; UBYTE *user = "alf" UBYTE *newpass ; UBYTE buffer[16] ; /* size >= 12 */ pw = getpassword() ; /* your own function */ if((newpass = ACrypt(buffer, pw, user)) != NULL) { printf("pw = %s\n", newpass) ; /* newpass = &buffer[0] */ } else { printf("ACrypt failed\n") ; }
|