how to use php generate passwords

Discussion in 'PHP' started by digitalspace, Mar 30, 2008.

  1. #1
    How to use php to generate many strong passwords one time?
     
    digitalspace, Mar 30, 2008 IP
  2. Ikki

    Ikki Peon

    Messages:
    474
    Likes Received:
    34
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Hi there,

    I believe that this might give you some ideas ;) It's an article about generating hashed passwords but I think you could use it to secure your passwords AND create strong ones at the same time.

    Hope that helps!
     
    Ikki, Mar 30, 2008 IP
  3. mythbuster08

    mythbuster08 Peon

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    free script like this:
    http://www.sentosoft.com/free-php-script-password-generator.php
    special chars like #, +, -, ... can be added to source string alfa. I'd remove 1, l, O, o, 0 at least, because they tend to cause trouble when you write down your pwd by hand and later try to "decipher" your own writing ;)

    If password is going to be used with encryption, at least 10 chars are needed for something that is more or lesss secure (depends on number of chars in source chars).

    Security in bits can be calculated like this:
    bits * log(2) = numcharspwd * log(numcharssrc)
    So if your number of possible chars is 70 and you want a minimum strength of 80 bit, you do
    80 * log(2) = numcharspwd * log(70)
    Would mean that you need at least 13 chars in the password to get around 80 bit security.
     
    mythbuster08, Mar 31, 2008 IP
  4. pfek

    pfek Member

    Messages:
    98
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #4
    You could try substr(md5(time()))
     
    pfek, Mar 31, 2008 IP
  5. Gonzo4u

    Gonzo4u Well-Known Member

    Messages:
    410
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #5
    Here you are:

    // Create Password
    $totalChar = 8; // number of chars in the password
    $salt = "abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789"; // salt to select chars from
    srand((double)microtime()*1000000); // start the random generator
    $Spass=""; // set the inital variable
    for ($i=0;$i<$totalChar;$i++) // loop and create password
    $Spass = $Spass . substr ($salt, rand() % strlen($salt), 1);


    Run this in a loop to generate as many password as you want.

    Enjoy!

    Gonzo
     
    Gonzo4u, Mar 31, 2008 IP
  6. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    HI just use simple metho for strong password, which can easily use by use

    $password=md5("mypassword".date(His));

    what you think.............
     
    singh.ajit05, Apr 1, 2008 IP
  7. singh.ajit05

    singh.ajit05 Peon

    Messages:
    83
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    HI just use simple metho for strong password, which can easily use by use

    $password=md5("mypassword");

    what you think.............
     
    singh.ajit05, Apr 1, 2008 IP