1: #! /usr/bin/perl -w
2: use strict;
3:
4: # Creates passwords from a customizable list of characters
5: # (To make it easier on users, don't use zero or capital 'O', for example)
6: #
7: # *Not* a completely security-conscious implementation, especially when
8: # generating multiple passwords at once...
9: #
10: # Change @Chars to suit your preference
11: # Change the inner for loop to determine password length
12: #
13: # Usage: $0 [Number of passwords to generate]
14:
15: my @Chars = split '',
16: 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789@#$%&*=+_<>?~';
17:
18: for (1..($ARGV[0] ||= 1)){
19: my $Password;
20: for (1..6){
21: $Password .= $Chars[rand @Chars];
22: }
23: print "$Password\n";
24: }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Another Password Generator
by merlyn (Sage) on May 07, 2000 at 03:50 UTC | |
by Russ (Deacon) on May 09, 2000 at 02:54 UTC |