sqlite encryption
#1

Hello,
I have a problem.
i use the following query:
PHP код:
SELECT FROM `USERSWHERE `USERNAME` = '%s' AND `PASSWORD` = sha1('%s'
But it always returns wrong password. I have tried this with md5 and sha1. The database field has the correct type and it even works in PHP. Why does this not work with pawn?

I did also try to login without encryption so i created another field with a password for testing purposes.
like this:
PHP код:
db_get_field_assoc(LOGIN_RESULT"SPID"PasswordPlayer[playerid], 50);
        if(!
strcmp(PasswordLogin[playerid],PasswordPlayer[playerid],true))
        {
            
SendClientMessage(playerid,-1,"test");
        }
        else return 
ShowErrorDialog(playerid"Wrong password!"); 
And this actually works fine. strange...

Any help would be appreciated
Reply
#2

Make the password higher cased in PHP and then compare.
Reply
#3

Quote:
Originally Posted by Logic_
Посмотреть сообщение
Make the password higher cased in PHP and then compare.
Thanks for the quick response but i'm not sure if i understand you, but some password may be numeric only. as mine is.
Also PHP version works fine. Pawn is where the bug occurs.
Reply
#4

Dude, if you don't know where the problem is occuring then print out the both passwords - Debug it. If the case sensitivity is the issue, then disable the case sensitivity check.
Reply
#5

Nvm this plugin works fine:
https://sampforum.blast.hk/showthread.php?tid=152682
Reply
#6

Quote:
Originally Posted by ******
Посмотреть сообщение
I reported this to them years ago and they ignored it..
Probably because PHP is dieing
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)