SA-MP Forums Archive
sqlite encryption - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sqlite encryption (/showthread.php?tid=651635)



sqlite encryption - jasperschellekens - 24.03.2018

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


Re: sqlite encryption - Logic_ - 24.03.2018

Make the password higher cased in PHP and then compare.


Re: sqlite encryption - jasperschellekens - 24.03.2018

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.


Re: sqlite encryption - Logic_ - 24.03.2018

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.


Re: sqlite encryption - jasperschellekens - 24.03.2018

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


Re: sqlite encryption - jasperschellekens - 24.03.2018

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