Skip to content

Instantly share code, notes, and snippets.

@dgrant
Created April 27, 2015 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dgrant/ecb1c309434f56e763de to your computer and use it in GitHub Desktop.
Save dgrant/ecb1c309434f56e763de to your computer and use it in GitHub Desktop.
Generate a difficult password
#!/usr/bin/perl
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";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment