Professional Web Applications Themes

password generation - PHP Development

Hi i am using a pear addition Text_Password $pass = Text_Password::create($length = 8, $type = 'unpronounceable',$chars = ''); problem is $pass contains some chars that are not A-Za-z 0-9, i have seen underscores & accented chars returned. is there a better way to generate an 8 char password for users?. I will be using crypt to put in mysql database. Mark...

  1. #1

    Default password generation

    Hi

    i am using a pear addition Text_Password

    $pass = Text_Password::create($length = 8, $type = 'unpronounceable',$chars
    = '');

    problem is $pass contains some chars that are not A-Za-z 0-9, i have seen
    underscores & accented chars returned.
    is there a better way to generate an 8 char password for users?. I will be
    using crypt to put in mysql database.

    Mark

    Mark Guest

  2. #2

    Default Re: password generation

    function createpass($chars) {
    $array ("","0","1" etc.....
    while ($i != ($chars+1)) {
    $pass .= rand(1,36);
    $i++;
    return $pass;
    }
    }

    then use it like this:

    createpass([length chars]);

    --
    bebbet


    bebbet Guest

  3. #3

    Default Re: password generation

    I noticed that Message-ID:
    <33c3f$42a988df$d52e9932$chello.nl> from bebbet contained the
    following:
     

    I was asked to write a random password generator that created up to 2000
    memorable passwords. I used an array of syllables
    www.ckdog.co.uk/dev/randpass.php

    Of course you have to be a bit careful you don't use syllables that can
    be combined in - ah - unfortunate combinations.

    On the other hand you might, just for fun, deliberately do that. I'd
    probably name such a file randpasrude dot php - if it existed. ;-)


    --
    Geoff Berrow 0110001001101100010000000110
    001101101011011001000110111101100111001011
    100110001101101111001011100111010101101011
    Geoff Guest

  4. #4

    Default Re: password generation

    I noticed that Message-ID: <com>
    from Geoff Berrow contained the following:
     
    or even randpassrude.php

    --
    Geoff Berrow 0110001001101100010000000110
    001101101011011001000110111101100111001011
    100110001101101111001011100111010101101011
    Geoff Guest

  5. #5

    Default Re: password generation

    I noticed that Message-ID: <com>
    from Geoff Berrow contained the following:
     


    Grrr. It's been one of those days...
    http://www.ckdog.co.uk/php/test/randpass.php
    --
    Geoff Berrow 0110001001101100010000000110
    001101101011011001000110111101100111001011
    100110001101101111001011100111010101101011
    Geoff Guest

  6. #6

    Default Re: password generation

    "bebbet" <nl> wrote in message
    news:33c3f$42a988df$d52e9932$chello.nl... 
    Hi

    a little buggy!

    i added

    $chrs = array("","A","B",

    and fixed the while loop

    while ($i != ($chars+1)) {
    $pass .= $chrs[rand(1,36)];
    $i++;
    }
    return $pass;
    }

    now works just fine.

    Mark

    Mark Guest

  7. #7

    Default Re: password generation


    "Mark D Smith" <obantec.net> wrote: 

    If the lengh is not a problem, I would translate the result from
    Text_Password::create() like this base_convert(bin2hex($pass), 16, 36).
    In this way you would obtain just characters in a-z 0-9, but the password
    lenght would become 12 characters. As you already get an unpronunciable
    password, for the user would not be bothering to have to remember 4
    characters more.

    I hope this will help you.


    Xenophaw Guest

Similar Threads

  1. Replies: 1
    Last Post: September 10th, 07:15 AM
  2. Dynamic Password Generation
    By CFDevGuy in forum Coldfusion - Advanced Techniques
    Replies: 3
    Last Post: July 13th, 08:17 PM
  3. HTML Generation (Next Generation CGI)
    By John W. Long in forum Ruby
    Replies: 4
    Last Post: November 24th, 04:24 AM
  4. Replies: 1
    Last Post: September 18th, 12:09 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139