Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

How to use the password hash and salt algorithm

bling1009bling1009 New
edited July 2012 in Vanilla 2.0 - 2.8

I tried referring to this question, but I am having a small problem.
(http://http://vanillaforums.org/discussion/comment/161762/#Comment_161762)
I'm fairly new to PHP, but not to java.

I have a page added to the website called mobile.php, and I'm trying to hash the password the user enters on the mobile and check it with the database, however, the hashing is much different than a simple md5($pw) or sha1($pw).

i tried using these lines of code that the link above has offered
$Vanilla_PasswordHash = new PasswordHash();

$a =  $Vanilla_PasswordHash->HashPassword('123456');
echo $Vanilla_PasswordHash->CheckPassword('123456', $a, 'Vanilla');
echo $a;

and using the include -- include PATH_LIBRARY . '/vendors/phpass/PasswordHash.php';
which was already in the page - passwordhash.php

but the web page crashes... am I doing something wrong?

Comments

  • Options

    When you post code highlight your code with your mouse and click the C in the buttonbar, it much more readable.

    To debug your problem add this to the conf/config.php

    $Configuration['Garden']['Errors']['MasterView'] = 'deverror.master.php';
    $Configuration['Garden']['Debug'] = TRUE;

    then post the info it gives you.

    After you resolve it remove the above config lines from your config.php

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    so, i added the code you asked and i connected to the site /config.php and the errors it show have no relevance to the page
    as of right now the page mobile.php is just a separately standing page on the site, it has no influence on whether or not the entire site crashes (not sure if this matters)

  • Options

    I can't tell, you didn't post your errors.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    bling1009bling1009 New
    edited July 2012
      }
              if (!class_exists($this->ControllerName())) {
                  if ($ThrowErrorOnFailure === TRUE) {
                     if (ForceBool(Gdn::Config('Garden.Debug'))) {
                        trigger_error(ErrorMessage('Controller not found: '.$this->ControllerName(), 'Dispatcher', '_FetchController'), E_USER_ERROR);
                     } else {
                        $MissingRoute = Gdn::Router()->GetRoute('Default404');
    
                       // Return a 404 message
    
    
    Variables in local scope:
    [ThrowErrorOnFailure] true
    [ControllerWhiteList] array (
      0 => 'dashboard',
      1 => 'conversations',
      2 => 'vanilla',
    )
    [PathParts] array (
      0 => 'controllers',
      1 => 'class.config.phpcontroller.php',
    )
    [ControllerFileName] 'controllers/class.config.phpcontroller.php'
    [ControllerPath] false
    

    but again, if i remove the code from the mobile page so it works again, the errors are the exact same

  • Options
    what happen when you comment line 2 
    
    // echo $Vanilla_PasswordHash->CheckPassword('123456', $a, 'Vanilla');
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options
    bling1009bling1009 New
    edited July 2012

    page is still down, and the errors are the same as the other post

    edit: because i include it, i should be able to use those functions right?

  • Options

    don't know its too hard to read your error results.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    ok, thanks a lot for trying

  • Options

    bling1009 said:
    ok, thanks a lot for trying

    Wait, Wait, Wait! @bling1009 the code that you posted in this comment: http://vanillaforums.org/discussion/comment/165137/#Comment_165137 didn't show the actual error that you received. You actually posted the text that's less interesting than the actual error. That is what @peregrine means and he's correct that he said that it's too hard to read your error message
    Can you please post just the error message that you receive? Thanks.

    There was an error rendering this rich post.

Sign In or Register to comment.