[RESOLVED]Encryption problem (mhash)
PHP Code:
$hash = base64_encode(mhash(MHASH_SHA1, utf8_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
Re: [Re-Opened]Encryption problem (mhash)
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 :blush:
Re: [RESOLVED] [Re-Opened]Encryption problem (mhash)
Is this thread resolved or re-opened or both?
Re: [RESOLVED]Encryption problem (mhash)
LoL, Sorry..I forgot I added the re-opened.
Resolved :)