SA-MP Forums Archive
"Hash" -> Safe enough? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: "Hash" -> Safe enough? (/showthread.php?tid=242861)



"Hash" -> Safe enough? - Kwarde - 20.03.2011

The title says it.
Is this hash thing safe enough? (So that you can't see what for a string it was)

pawn Код:
/*
    Sorry, Censored.
    - Kevin
*/
Tests:
pawn Код:
printf("%d", Hash("K"));
printf("%d", Hash("e"));
printf("%d", Hash("v"));
printf("%d", Hash("i"));
printf("%d", Hash("n"));
printf("%d", Hash("Kevin"));
Output:
Код:
1779205644
1777501708
1776387596
1777239564
1776911884
2009237004
Is this safe enough?
I did make this just because I was bored. It's quite useless and too "complicated". I just wanna know if this is safe enough :P

- Kevin


Re: "Hash" -> Save enough? - xTeChNiQuEz-- - 20.03.2011

save enough or safe enough?


Re: "Hash" -> Save enough? - Kwarde - 20.03.2011

Ehm, yes I meant safe enough. My bad.
Sorry but I'm not English :P. I make alot that kind of mistakes, the same with 'live' and 'life'.


Re: "Hash" -> Safe enough? - Kwarde - 21.03.2011

Anyone?


Re: "Hash" -> Safe enough? - pawn_ - 21.03.2011

Looks like you're just adding a bunch of numbers up together and returning it.

Well, adler32 is similar to this one, but I wouldn't say, ehh, really safe.


Re: "Hash" -> Safe enough? - Damian - 21.03.2011

Depends on the popularity of your server, the type of protection you have over your database, and the strength, knowledge, and persistence of people who would actually go as far as to try and hijack your member database. Also if it's your own little hash function I'd assume they would have to go through all sorts of algorithms just to decrypt it.

So all in all, a hash is just a hash. Focus on your security and database privacy just as much if not more.


Re: "Hash" -> Safe enough? - Kwarde - 21.03.2011

Thank you for your reactions.
And ehm, I think I'm gonna use this then


Re: "Hash" -> Safe enough? - Mike Garber - 21.03.2011

Dude, SA:MP is not NASA or US Marines, we don't have to encrypt stuff, I mean worst thing could happend if someone with access takes it and uses It.

Who in the world uses their password they use somewhere else on SA:MP anyways?


Re: "Hash" -> Safe enough? - Snipa - 21.03.2011

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
Dude, SA:MP is not NASA or US Marines, we don't have to encrypt stuff, I mean worst thing could happend if someone with access takes it and uses It.

Who in the world uses their password they use somewhere else on SA:MP anyways?
*cough* Yeah, who would? I use Whirlpool anyway, easy to set up and its really safe.


Re: "Hash" -> Safe enough? - Kyosaur - 21.03.2011

Quote:
Originally Posted by Mike Garber
Посмотреть сообщение
Dude, SA:MP is not NASA or US Marines, we don't have to encrypt stuff, I mean worst thing could happend if someone with access takes it and uses It.

Who in the world uses their password they use somewhere else on SA:MP anyways?
With the #1 password commonly used being "123456" and the #2 being "123456789", im willing to make the bet that TONS of people actually do this. I used to be admin on a VERY popular server that didnt have any form of encryption, as such anyone who had DB access (hacked, or granted) could see everyone's passwords. You can surely bet that this was hardcore abused. At one point a developer actually (illegally) entered a users email account to read the users personal information.

Its a VERY stupid not to encrypt your users passwords. It actually goes against one of the major rules of programming, don't assume anything . Assumptions always lead to disaster.



@OP - I wouldnt use that function if you made it / have no experience if the fields of hashes. To make a GOOD hash requires a lot of math/schooling. The big issue is how secure it is, and also how often it clashes. Clashing is more of an issue in this case (due to the audience sa-mp attracts), i would thoroughly test this before using it. Honestly i would just go with something that is guaranteed to be safe and have very little clashes (There are tons of plugins, and also mysql supports a lot of different hashes!).