1: Good for creating passwords for .htpasswd files or for any other *nix password file:
2:
3: <CODE>
4: sub mkpasswd{
5: my($plaintextpass)=@_;
6: my($salt1, $salt, $encrypted);
7:
8: $salt1 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./';
9: $salt = substr($salt1,rand(length($salt1)),1);
10: $salt .= substr($salt1,rand(length($salt1)),1);
11: $encrypted = crypt($plaintextpass, $salt);
12:
13: return $encrypted;
14: }
15: </CODE>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Create encrypted passwords
by Anonymous Monk on Mar 27, 2000 at 13:52 UTC | |
|
RE: Create encrypted passwords
by IndyZ (Friar) on Apr 19, 2000 at 06:46 UTC | |
|
RE: Create encrypted passwords
by Anonymous Monk on Mar 28, 2000 at 08:08 UTC | |
by ducky (Scribe) on Mar 28, 2000 at 23:34 UTC | |
by btrott (Parson) on Mar 28, 2000 at 23:50 UTC | |
by chromatic (Archbishop) on Mar 28, 2000 at 23:42 UTC | |
by Anonymous Monk on Mar 28, 2000 at 08:15 UTC |