Results 1 to 5 of 5

Thread: [RESOLVED]Encryption problem (mhash)

  1. #1

    Thread Starter
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Resolved [RESOLVED]Encryption problem (mhash)

    PHP Code:
    $hash base64_encode(mhash(MHASH_SHA1utf8_encode(str_replace("\'""''"$new_password)))); 

    I am not getting an error message, rather, my program just freezes and doesnt go anywhere when I have this line in my code.


    Anyone have any ideas what might be causing this?



    I also have it as follows

    PHP Code:
    $replaced_password str_replace("\'""''"$new_password);
    echo 
    "passed replace";
    $utf_encoded utf8_encode($replaced_password);
    echo 
    "passed utf";
    $hash_encoded mhash(MHASH_SHA1$utf_encoded);
    echo 
    "passed hash";
    $base64_encoded base64_encode($hash_encoded);
    echo 
    "passed base64"
    and it freezes on mhash
    Last edited by kfcSmitty; Jul 15th, 2006 at 12:45 AM.

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: [Re-Opened]Encryption problem (mhash)

    Are you using windows?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: [Re-Opened]Encryption problem (mhash)

    For the record..I never really solved it...but I did find a work around

    PHP Code:
    $replaced_password str_replace("\'""''"$l2_password);
    $utf_encoded utf8_encode($replaced_password);
    //The below sha1'd it, and setting the true parameter made sure it returned binary
    $hash sha1($utf_encoded,true);
    $base64_encoded base64_encode($hash); 
    I know I can do it all in 1 line...but its easier to read this way. Oh, and as for why my encryption was off...I accidentily was encrypting the password after it had already gone through an md5 encryption

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: [RESOLVED] [Re-Opened]Encryption problem (mhash)

    Is this thread resolved or re-opened or both?

  5. #5

    Thread Starter
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: [RESOLVED]Encryption problem (mhash)

    LoL, Sorry..I forgot I added the re-opened.

    Resolved

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width