Added initial pwcrypt.c and Makefile
[staff/wgh1/pwcrypt.git] / pwcrypt.c
1 /*
2 * (c) 1994-2015 WGH1@BFH
3 *
4 * demonstrates the UNIX/Linux
5 * password encryption function crypt()
6 *
7 * more infos see "man 3 crypt"
8 *
9 */
10
11 #include <stdio.h>
12 #define _XOPEN_SOURCE
13 #define __USE_XOPEN
14 #include <unistd.h>
15
16 char * crypt();
17
18 int main(int argc, char * argv[])
19 {
20 if (argc != 3)
21 {
22 printf("Usage: pwcrypt salt password\n");
23 }
24 else
25 {
26 printf("%s",crypt(argv[2],argv[1]));
27 printf("\n");
28 }
29 return (0);
30 }