File: crypt.pl

package info (click to toggle)
libjdom1-java 1.1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 2,740 kB
  • sloc: java: 21,155; xml: 1,377; sh: 73; perl: 31; makefile: 17
file content (26 lines) | stat: -rw-r--r-- 588 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/perl
#
# Written by Karl Fogel
# Available under the standard JDOM License (see LICENSE.txt)
#
# Description
#
#    Generates a password hash from a plaintext password, to be used 
#    by new committers who send the hash to the CVS maintainer.
#
# Usage
#
#    crypt.pl plaintextpassword
#
# Example
#
#    crypt.pl try2gu3ss


srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);

print "${crypttext}\n";