Retrieving a hashed password via MD5 and Mysql
#1

ALL HAIL ****** FOR WHIRLPOOL!
Reply
#2

use udb_hash(inputtext)
maybe wroks
Reply
#3

Quote:
Originally Posted by Newbie
Посмотреть сообщение
use udb_hash(inputtext)
maybe wroks
I'm assuming from your profile name that you're not getting what I meant either... udb_hash is weak! I want something strong like whiskey!
Reply
#4

Make your own hash algorithm. Idk how to get passwords from MD5 hashes in SQL.

Maybe you could use whirlpool as a hash too!
Reply
#5

pawn Код:
new
    escPass[45];

mysql_real_escape_string(inputtext, escPass);
format(Query, 200, "SELECT * FROM player_data WHERE `NAME` = '%s' AND `PASSWORD` = md5('%s')", ReturnPlayerName(playerid), escPass);

mysql_query(Query);
mysql_store_result();

if(mysql_num_rows() > 0)
{
    // Account matched Username's and hashed password
    // Load info
    mysql_free_result();
}
else
{
    // Account login was incorrect.
}
Reply
#6

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
new
    escPass[45];

mysql_real_escape_string(inputtext, escPass);
format(Query, 200, "SELECT * FROM player_data WHERE `NAME` = '%s' AND `PASSWORD` = md5('%s')", ReturnPlayerName(playerid), escPass);

mysql_query(Query);
mysql_store_result();

if(mysql_num_rows() > 0)
{
    // Account matched Username's and hashed password
    // Load info
    mysql_free_result();
}
else
{
    // Account login was incorrect.
}
Doesn't work, for some reason the actual md5 part doesn't even respond!
Reply
#7

Enable mysql_debug, that should tell what the problem might be.
Reply
#8

Код:
[01:25:10]  

[01:25:10] ---------------------------

[01:25:10] MySQL Debugging activated (09/17/11)

[01:25:10] ---------------------------

[01:25:10]  

[01:25:10] >> mysql_connect( )

[01:25:10] CMySQLHandler::CMySQLHandler() - constructor called.

[01:25:10] -- Connecting to "127.0.0.1" | DB: "blackops" | Username: "root" ...

[01:25:10] CMySQLHandler::Connect() - Connection was successful.

[01:25:10] >> mysql_query( Connection handle: 1 )

[01:25:10] CMySQLHandler::Query(CREATE TABLE IF NOT EXISTS PLAYER_DATA(.....)

[01:25:41] >> mysql_query( Connection handle: 1 )

[01:25:41] CMySQLHandler::Query(SELECT * FROM `player_data` WHERE NAME = 'Lorenc' LIMIT 1) - Successfully executed.

[01:25:41] >> mysql_store_result( Connection handle: 1 )

[01:25:41] CMySQLHandler::StoreResult() - Result was stored.

[01:25:41] >> mysql_num_rows( Connection handle: 1 )

[01:25:41] CMySQLHandler::NumRows() - Returned 0 rows(s)

[01:25:41] >> mysql_free_result( Connection handle: 1 )

[01:25:41] CMySQLHandler::FreeResult() - Result was successfully free'd.

[01:25:45] >> mysql_real_escape_string( Connection handle: 1 )

[01:25:45] CMySQLHandler::EscapeString(test); - Escaped 4 characters to test.

[01:25:45] >> mysql_query( Connection handle: 1 )

[01:25:45] CMySQLHandler::Query(INSERT INTO player_data......) - Successfully executed.

[01:25:46] >> mysql_real_escape_string( Connection handle: 1 )

[01:25:46] CMySQLHandler::EscapeString(test); - Escaped 4 characters to test.

[01:25:46] >> mysql_query( Connection handle: 1 )

[01:25:46] CMySQLHandler::Query(SELECT * FROM player_data WHERE `NAME` = 'Lorenc' AND `PASSWORD` = SHA1('test')) - Successfully executed.

[01:25:46] >> mysql_store_result( Connection handle: 1 )

[01:25:46] CMySQLHandler::StoreResult() - Result was stored.

[01:25:46] >> mysql_num_rows( Connection handle: 1 )

[01:25:46] CMySQLHandler::NumRows() - Returned 0 rows(s)
Just changed to SHA1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)