Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts

    How Can I echo password from mysql

    Can I echo password from mysql if so how do I do this as I done <?php echo $password; ?> but it blank


    Thank you for replys

  • #2
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    What code do you have so far?
    Logic will get you from A to B. Imagination will take you everywhere.
    Albert Einstein

  • #3
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,468
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    It's probably encrypted?
    But as Dan-Dan mentioned ... let's see the script so far.

  • #4
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    yes the password is encrypted can it be done?

  • #5
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,468
    Thanks
    8
    Thanked 1,085 Times in 1,076 Posts
    This is a better explanation that I can provide:
    http://webcheatsheet.com/php/md5_encrypt_passwords.php



    .

  • #6
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    so can I decipher the password then echo it?

  • #7
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    If its encrypted? Not really... some encryptions have been broken, like MD5, but if an encryption was easy to reverse engineer, it'd serve no purpose.
    Last edited by Keleth; 07-03-2012 at 06:49 PM.

  • #8
    Regular Coder dan-dan's Avatar
    Join Date
    Aug 2009
    Location
    England
    Posts
    483
    Thanks
    22
    Thanked 79 Times in 78 Posts
    No you can't! MD5 hashing is a one way encryption. That is why to match a password typed by a user to a password saved in the database, the typed password would also be hashed first.
    Logic will get you from A to B. Imagination will take you everywhere.
    Albert Einstein

  • #9
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Encrypted: yes, you sure can. If you know how it was generated you can reverse it.
    Hashed: no. Its purpose is one way, although you may be able to calculate an equivalency phrase (ie: more than one value hash to the same result).

    MD5 (don't use btw), sha, and many others are all hashing techniques. You cannot go backwards. Well designed salting techniques would also make creating a comparable phrase through brute a horrendously long task to calculate. As in years, if you're lucky (or by theory, best case scenario would be O(1), but good luck at that).

    You never compare the value of a database stored password. You compare the same hashed or encrypted value of a provided one to the database for comparison.

  • #10
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Thanks for the lingo correction Fou, I always got those confused.

  • #11
    New Coder
    Join Date
    Feb 2011
    Posts
    75
    Thanks
    9
    Thanked 2 Times in 2 Posts
    Code:
             if($database->addNewUser($subemail, md5($subpass), $subuser, $subgender, $subage)){
    that hash?

  • #12
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,535
    Thanks
    45
    Thanked 259 Times in 256 Posts
    Yes, MD5 is a hash, as Fou mentioned. So you can't get back the original password, it would defeat the entire purpose of password security.


  •  

    Posting Permissions

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