2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: Utility for crypt(3).
10 This is the sourcecode for crypt. It is a small program which makes
11 it more convenient to create Unix passwords with crypt(3).
17 If you get an error during link which says that "crypt" is an
18 unknown symbol, try this:
20 cc crypt.c -o crypt -lcrypt
22 Then run this with your password as the first argument. If you
23 want to test if it really works, try it like this:
29 Encrypting test: xx1LtbDbOY4/E
31 If it prints something else, then your version of crypt(3) is not
41 int main (int argc
, char ** argv
)
44 char set
[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./";
47 if (argc
< 2 || argc
> 3)
49 printf("Usage: %s <password> [<salt>]\n", argv
[0]);
55 salt
[0] = set
[getpid() % sizeof(set
)];
56 salt
[1] = set
[rand() % sizeof(set
)];
65 printf ("Encrypting %s: %s\n", argv
[1], crypt (argv
[1], salt
));