vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   vB 3.6.0 password question (https://vborg.vbsupport.ru/showthread.php?t=124724)

Ninth Dimension 08-23-2006 02:30 PM

vB 3.6.0 password question
 
Hello one and all, I'm in the process of adapting an existing site of mine to use data from the vB database, specifically the username and password.

On my existing site, I'm using a simple md5() to encode the password in the database, but it would appear that vB 3.6.0 uses a diffrent method. Can anyone tell me what this is, so I can adapt my existing script to do the same thing.

I would assume it has something to do with the passworddate field in the vb_user table, but I'm not sure.

Any help you can provide would be most helpful, thank you :D

UPDATE: It's OK, I think I've found out how to do it: https://vborg.vbsupport.ru/showpost....6&postcount=32

DWard 08-28-2006 01:53 PM

No that's not right, I've just done some looking into this because I wanted to make a quick vblogin script...OK,

When you make a login script, you query the password from the row that belongs to that user right? OK, on the same row, you will find a cell called 'salt', which holds a random peice of junk. You need to use that salt cell along with the MD5 encryption of the entered password to make the same as what's in the database.

You almost have it right on that thread, but you are just putting 'salt' as a normal piece of text when it is actually a variable that you need to gather from the user records.

Don't just copy the whole lot, this is just an extract of the script I used, but you can see what I am doing :)

PHP Code:

$result mysql_query("SELECT password, salt FROM `".$db_prefix."user` WHERE `username` = '".$_POST['username']."'");
$salt mysql_result($result0salt);
$passwd $_POST['password'];

// Then when encrypting, you'd use this to check against the user.password cell:
$enc_passwd md5(md5($passwd).$salt); 

Got it? :)

Ninth Dimension 08-28-2006 10:45 PM

I realised that salt didn't just mean 'salt', I saw the salt field in the database a while ago, and was always interested to find out what it was - now I know ;)

I've had my site converted to my new system for a while now, but thank you for the help anyway :)


All times are GMT. The time now is 02:32 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.01065 seconds
  • Memory Usage 1,718KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete