aboutsummaryrefslogtreecommitdiffstats
path: root/fripost-mkpass
blob: 83a58acb54a52b7c6a627417d470132b2211359d (plain)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl

use 5.010_000;
use warnings;
use strict;

=head1 NAME

fripost-mkpass.pl - Create a random new password

=cut

use FindBin qw($Bin);
use lib "$Bin/lib";

our $VERSION = '0.01';

use Fripost::Password;
use String::MkPasswd qw/mkpasswd/;

# Generate password
my $password = $ARGV[0];

$password //= mkpasswd(
    -length => 20,
    -minnum => 5,
    -minspecial => 3
);

# Show the information that will be inserted
say "Password: $password";
say "Salted MD5: " . smd5($password);

=head1 AUTHOR

Stefan Kangas C<< <skangas at skangas.se> >>

=head1 COPYRIGHT

Copyright 2010 Stefan Kangas.

=head1 LICENSE

This program is free software; you can redistribute it and/or modify it
under the same terms as perl itself.

=cut