Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-22-2004, 11:57 PM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default salt/hash passwords

i need to create a form so my members can register outside of my forums, from my site. i know how to query the database etc. in PHP, but i'm having problems with the passwords. i know the query uses MD5('pw', salt), but i need help with using the salt part of it. i need code so i can create a form asking for username and a password, after the user submits it, it will search for the username and password they entered...however, the salt function is confusing to me. how do i set up the function to do this? i'm looked at the login.php, but its so huge i dont know where to start to be honest...i only need the part to find a record based on the password. any script or info on this would be helpful, thanks.
Reply With Quote
  #2  
Old 11-23-2004, 12:16 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by XFSIllusion
i need to create a form so my members can register outside of my forums, from my site. i know how to query the database etc. in PHP, but i'm having problems with the passwords. i know the query uses MD5('pw', salt), but i need help with using the salt part of it. i need code so i can create a form asking for username and a password, after the user submits it, it will search for the username and password they entered...however, the salt function is confusing to me. how do i set up the function to do this? i'm looked at the login.php, but its so huge i dont know where to start to be honest...i only need the part to find a record based on the password. any script or info on this would be helpful, thanks.
Close but not really

md5(md5('password' . 'salt'))
Reply With Quote
  #3  
Old 11-23-2004, 02:01 AM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

okay, well i've got that far, now answer this question for me....

i register as username 'test', and the pw is 'test' as well. Then I look in the database and get this:
password: 1b413dc15691f817a4891ea48b2c0ef0 salt:%eX

Then I delete the test user, and re-register a user under the SAME user and pw (test). now the database reads...
cdf189fe40f9d20a8194de2a2e74ec02 salt: Y"+

So my question is, why is it different everytime. when i use that line you gave me, it gives the same MD5 encryption but is not calling the salt. is there some function i should be calling in my script, like a salt function? I think the salt field is what causes this, but how does the script know what is in the 'salt' field? should i be calling these varibles with a query or something? this is really getting confusing.
Reply With Quote
  #4  
Old 11-23-2004, 02:07 AM
Zachery's Avatar
Zachery Zachery is offline
 
Join Date: Jul 2002
Location: Ontario, Canada
Posts: 11,440
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by XFSIllusion
okay, well i've got that far, now answer this question for me....

i register as username 'test', and the pw is 'test' as well. Then I look in the database and get this:
password: 1b413dc15691f817a4891ea48b2c0ef0 salt:%eX

Then I delete the test user, and re-register a user under the SAME user and pw (test). now the database reads...
cdf189fe40f9d20a8194de2a2e74ec02 salt: Y"+

So my question is, why is it different everytime. when i use that line you gave me, it gives the same MD5 encryption but is not calling the salt. is there some function i should be calling in my script, like a salt function? I think the salt field is what causes this, but how does the script know what is in the 'salt' field? should i be calling these varibles with a query or something? this is really getting confusing.
there is a salt function. every time a new password is generated a new salt is generated, the chances of them being the same are about 1 in infinity +1
Reply With Quote
  #5  
Old 11-23-2004, 07:42 PM
XFSIllusion XFSIllusion is offline
 
Join Date: Aug 2004
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

o ok, i figured something like that. i've been programming in PHP for about 6 months...i can do queries and stuff like that, simple things i guess. anyway, does anyone out there know how i can go about calling this function and producing the query. i basically want registered members to enter a username and password on the form i give, which goes to a PHP file for processing. the file will check to see if the username and password they entered in the form matches in the vb3_user table. prior to this i used $PHP_AUTH_ACCESS to do this, however, my members had to register for both my site and forums....i'd like to just authorize them with thier forum information. tips on doing this would be great, some scripting advice and/or code would be even better. thanks guys.
Reply With Quote
Reply


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. The time now is 12:49 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08758 seconds
  • Memory Usage 2,200KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete