Brian Dickson


PW44 - Perl password generator - generate 44-bit passwords using OPIE dictionary


  # In perl script:
  use Crypt::PW44 qw(generate);
  # 44 bit (4 word) password
  $output = generate(pack(Ll,int(rand(2**32)),int(rand(2**16))),3);
  # $output = generate($random_binary_data,$number_of_ascii_text_words_minus_1);
  # return value is N-word password of ascii text, with space delimiters between words


This module contains a simple password generator, based on the S/Key calculator (as described in RFC 1760) implemented in Perl. It exports the function generate.

This was inspired by the XKCD web comic "Password Strength", permalink .


(The usual.)

perl Makefile.PL make make test make install


generate($random_data, $count)

Given two arguments, uses provided entropic data, computes the hash value, and returns it as a string containing N+1 words separated by spaces. The meanings of the arguments is as follows:

  • random_data

    User/script-provided random data, must be binary, and more than N*11 bits in size

  • count

    AKA "N". Counting from zero, not 1, is number of ASCII words in the password generated.


Derived (heavily) from the Skey module, written by

Ken Williams,


Brian Dickson,


Copyright 2011 Brian Dickson. All rights reserved.

Copyright 2000-2009 Ken Williams. All rights reserved.

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


perl(1). RFC 1760. Digest::MD4(1). Digest::MD5(1). Term::ReadKey(1).