Raised This Month: $32 Target: $400
 8% 

Hashing passwords


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 11-04-2006 , 14:22   Hashing passwords
Reply With Quote #1

I'm creating a login back-end, and I need some kind of hashing algorithm for the passwords!
Is md5 or SHA-1 converted to pawn?
__________________
Sig(h)!
Obbin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 11-04-2006 , 14:26   Re: Hashing passwords
Reply With Quote #2

Code:
/* Calculates the md5 keysum of a string */ native md5(const szString[], md5buffer[34]);   /* Calculates the md5 keysum of a file */ native md5_file(const file[], md5buffer[34]);
?
VEN is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 11-04-2006 , 14:30   Re: Hashing passwords
Reply With Quote #3

Oops
__________________
Sig(h)!
Obbin is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 11-04-2006 , 14:48   Re: Hashing passwords
Reply With Quote #4

Here's a good hashing algorithm if you need it as an int:

Code:
// parameter macros #define HASH_ALG_PARAMS const str[], len #define HASH_STR str[] #define HASH_STR_LEN len // 'hash' value based macros #define HASH_VAL hash #define INITIALIZE_HASH_ALG(%1) new HASH_VAL = %1 #define SET_HASH_VAL(%1) HASH_VAL = (%1) // loop based macros #define HASH_LOOP_VAR loop_var #define HASH_LOOP_CHAR str[HASH_LOOP_VAR] #define HASH_ALG_LOOP() static HASH_LOOP_VAR; for( HASH_LOOP_VAR = 0; HASH_LOOP_VAR < HASH_STR_LEN ; HASH_LOOP_VAR ++) // returns a positive value, suitable for a hash algorithm. #define RETURN_HASHED_VALUE() return ( HASH_VAL & 0x7FFFFFFF) // Simple and proven algorithms #define HASHTABLE_SIMPALG_ADD RSHash #define HASHTABLE_SIMPALG_ROT JSHash // General purpose algorithms used by reputable companies // probably for 16-bit; don't work so well on 32-bit #define HASHTABLE_GENALG_BELL PJWHash #define HASHTABLE_GENALG_UNIX ELFHash // Specific purpose algorithms, designed for a certain use. #define HASHTABLE_SPALG_SEED BKDRHash #define HASHTABLE_SPALG_SORT DEKHash // These algorithms do very well in their areas of expertise. #define HASHTABLE_EXALG_VARIANCE SDBMHash #define HASHTABLE_EXALG_SPEED DJBHash #define HASHTABLE_EXALG_RELIABLE APHash // Simplest addative hashing algorithm // Speed: 129 || 1288 // Collisions: 2 || 462 // Renders very few collisions, the second lowest, and has a consistant speed of hashing, if a bit higher than normal. // General purpose RSHash(HASH_ALG_PARAMS) {     INITIALIZE_HASH_ALG(0);     new b = 378551;     new a = 63689;     HASH_ALG_LOOP()        {         SET_HASH_VAL( HASH_VAL * a + HASH_LOOP_CHAR );         a = a * b;     }     RETURN_HASHED_VALUE(); }
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
BAILOPAN
Join Date: Jan 2004
Old 11-04-2006 , 14:53   Re: Hashing passwords
Reply With Quote #5

That won't be as strong as using md5(), but it'll certainly be faster.
__________________
egg
BAILOPAN is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 11-04-2006 , 17:49   Re: Hashing passwords
Reply With Quote #6

Thanks!
Btw does old amx modules still work on amxx (thinking of the multi threading module)?
__________________
Sig(h)!
Obbin is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 01:19.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode