Wednesday, 15 June 2011

passwords - crypt() from C -



passwords - crypt() from <unistd.h> C -

i know declaration of function crypt () should :

char *crypt(const char *key, const char *salt);

where *key text encrypt dont know salt (it says it's string containing 2 characters [a–za–z0–9./].

and don't know should able display encrypted password; ( need declaration of salt dont know how this).

here code in input.h file :

#ifndef input_h #define input_h #define _xopen_source /* see feature_test_macros(7) */ #include <unistd.h> char *crypt(const char *key, const char *salt); const char password_source[] = "source encrypted password"; #endif

here code main function:

#define _xopen_source #include <unistd.h> #include <stdio.h> #include <stdlib.h> #include "generator.h" #include "input.h" main (void) { printf("\n\n\nwhen utilize crypt() on password : \n\n\n",length); // here display encrypted password // tried , salt isn't declared : printf("%c",*crypt(*password_source, *salt)); homecoming 0; }

c passwords crypt

No comments:

Post a Comment