Skip to content

Instantly share code, notes, and snippets.

@RickCogley
Created February 19, 2015 01:30
Show Gist options
  • Save RickCogley/a0703e654e267f28b40a to your computer and use it in GitHub Desktop.
Save RickCogley/a0703e654e267f28b40a to your computer and use it in GitHub Desktop.
# import best-practice standard perl modules
use strict;
use warnings;
# import the XKPassed module
use lib '/usr/local/xkpasswd.pm/';
use XKPasswd;
# create an XKPasswd password generator object with out custom config
my $config_overrides = {
num_words => 4,
word_length_max => 9,
word_length_min => 5,
padding_characters_before => 2,
padding_characters_after => 2,
case_transform => 'ALTERNATE',
padding_alphabet => ['!', '&', '?', '@', '=', '^', '~'],
separator_alphabet => ['-', '.', ':', ';', '_']
};
my $password_generator = XKPasswd->new('/usr/local/xkpasswd.pm/sample_dict.txt', 'APPLEID', $config_overrides);
# use our generator to create and random password and print it
print $password_generator->password()."\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment