in reply to Words without a Dictionary

{ my @words = qw( perl monk vroom ); my %convert = ( i => '!', e => '#', s => '%', o => ')', ); sub generate_password { my $word = $words[rand @words] . $words[rand @words]; $word =~ s/(.)/$convert{$1} || $1/eg; $word; } }
That's actually the algorithm I use for my passwords at work (with different words). I then remember my passwords by having a sticky in my cube with a list of words, then "34" (or the like) to reference into that list, but with the appropriate numifying and shifting.

Is it secure? Depeneds on how secure you need to be. It wouldn't pass a strict security audit, but, then again, no-one's ever broken into an account of mine in over 4 years ...

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Replies are listed 'Best First'.
Re: Re: Words without a Dictionary
by sauoq (Abbot) on Jul 22, 2003 at 19:42 UTC
    no-one's ever broken into an account of mine in over 4 years ...

    Uh... at least, not that you know of... huh? ;-)

    -sauoq
    "My two cents aren't worth a dime.";
    
Re: Re: Words without a Dictionary
by Anonymous Monk on Jul 22, 2003 at 19:07 UTC
    Thanks dragonchild, but excuse me for being thick, but what is the generated word output to? i tried printing $word, but that always comes out blank??
      You are being thick. $word is a variable that's scoped to the generate_password() subroutine. Of course, you can't print it out. Try printing the value returned by calling the subroutine, as seen below:
      #!/usr/bin/perl { my @words = qw( perl monk vroom ); my %convert = ( i => '!', e => '#', s => '%', o => ')', ); sub generate_password { my $word = $words[rand @words] . $words[rand @words]; $word =~ s/(.)/$convert{$1} || $1/eg; $word; } } print generate_password(), $/;

      ------
      We are the carpenters and bricklayers of the Information Age.

      Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

      Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.