MD5 or SHA1 encrypter
#1

Hello,

I'm working on making my own gamemode running on MySQL, I want a password encrypter that I can match with PHP. I.E: MD5 or SHA1 the letters needs to be lowercased. Have searched but couldn't find a suitable plugin.

Answers would be appreciated
Regards' hanzen
Reply
#2

You know the SQL scripting language has a built in MD5 encrypter? For example:

pawn Код:
format(query,sizeof(query),"SELECT Information FROM `users` WHERE Password = md5(%s)",params);
Is that what you were looking for?

Additionally there is an MD5 function specifically for Pawn made by ******, if that's something you're also looking for?
Reply
#3

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
You know the SQL scripting language has a built in MD5 encrypter? For example:

pawn Код:
format(query,sizeof(query),"SELECT Information FROM `users` WHERE Password = md5(%s)",params);
Is that what you were looking for?

Additionally there is an MD5 function specifically for Pawn made by ******, if that's something you're also looking for?
Jizzz. I'm actually aware of that, just didn't think of it, haha. Thanks

Edit:
Shit didn't work.
Reply
#4

If it didn't work then you wrote your query wrong
Reply
#5

Quote:
Originally Posted by hanzen
Посмотреть сообщение
Jizzz. I'm actually aware of that, just didn't think of it, haha. Thanks

Edit:
Shit didn't work.
What didn't work about it? What's wrong? Give some information
Reply
#6

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
What didn't work about it? What's wrong? Give some information
Well, now it returns that the password is wrong.
Код:
format(query, sizeof(query), "SELECT * FROM `players` WHERE `name` = '%s' AND `password` = 'md5(%s)';", escname, inputtext);
When I try to enter this as a query:
Код:
format(query, sizeof(query), "UPDATE players SET password = 'md5(%s)' WHERE name = '%s'", inputtext, escname);
It only saves md5(inputtext).
Reply
#7

'md5(%s)' -> mdt('%s')
Isn't this logical enough?
Reply
#8

You've written it wrong, md5 is a function, but you're writing it as a string, so that's what you're actually writing into the table!

pawn Код:
format(query, sizeof(query), "SELECT * FROM `players` WHERE `name` = '%s' AND `password` = md5('%s');", escname, inputtext);
And the same for your other one!
Reply
#9

Quote:
Originally Posted by JaTochNietDan
Посмотреть сообщение
You've written it wrong, md5 is a function, but you're writing it as a string, so that's what you're actually writing into the table!

pawn Код:
format(query, sizeof(query), "SELECT * FROM `players` WHERE `name` = '%s' AND `password` = md5('%s');", escname, inputtext);
And the same for your other one!
Grr. Top of stupidness. Hahahaha, thanks for the help
Reply
#10

Your query is wrong the ' character should be around the %s and not around md5() so it should look like this md5('%s')!

btw i think mysql has sha1() encryption support too so it's better to use that instead!


EDIT: late buu
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)