Jump to content

MySQL help needed


Newbie

Recommended Posts

Posted
function server.login( thePlayer, Username, Password ) 
    --// Login the Player 
    if ( thePlayer ~= "" and Username ~= "" and Password ~= "" ) then 
        if ( getElementData( thePlayer, "Connection" ) ~= 1 ) then 
            local accounts = dbQuery( server.connection, "SELECT * FROM hhc_accounts WHERE Accountname = '" .. Username .. "'" ) 
            local result, rows, errormessage = dbPoll( accounts, -1 ) 
             
            if ( rows == 1 ) then 
                for i, row in pairs( result ) do 
                    local pass = string.upper( row['Password'] ) 
                    local salt = row['Salt'] 
                    local gens = md5( md5( salt .. pass .. salt ) ) 
                    local ePass = md5( Password ) 
                    local salted = md5( md5( salt .. ePass .. salt ) ) 
                     
                    if ( gens == salted ) then --bla bla bla  
  

I've set data in dabatase correctly with Accountname "aaa" and Password "aaa"

The password is coded by md5, can someone help me to remove coding and just read the password normally

Posted

Its not possible to remove the MD5 encryption. So you have to encrypt whatever the player put in the "Password" field of your login panel and compare it to the encrypted MD5 in the SQL.

Posted

You don't need to decrypt it. Just like cont said. First get the encrypted pass then convert the normal pass to md5 and then compare them ( if oldPass == newPass then. )

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...