|
-
Jul 13th, 2006, 12:04 PM
#1
[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
Last edited by kfcSmitty; Jul 15th, 2006 at 12:45 AM.
-
Jul 14th, 2006, 12:18 AM
#2
Re: [Re-Opened]Encryption problem (mhash)
-
Jul 14th, 2006, 08:12 PM
#3
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
-
Jul 15th, 2006, 12:13 AM
#4
Re: [RESOLVED] [Re-Opened]Encryption problem (mhash)
Is this thread resolved or re-opened or both?
-
Jul 15th, 2006, 12:45 AM
#5
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|