开发者

MCRYPT DECRYPT email form w/encrypted email address

I pray someone can help me. I've been around and around... The situation is this. I have visible encrypted email addresses that an individual takes and puts into a form (enctype="multipart/form-data)and completes the email form prior to mailing. My php on a different page attempts to decrypt the TO: field of the html email form.

This is my php code, testing to see if I indeed am decrypting:

if (isset($_POST['submit'])) {

//just to echo the encrypted input for the email to field ECHOES PERFECTLY
$to = $_POST['to'];
echo $to;

//above echo displays correctly below is a jumbled mess
echo "<br>";
$ivs = mcrypt_get_iv_size(MCRYPT_3DES, MCRYPT_MODE_OFB);
        $iv = mcrypt_create_iv($ivs, MCRYPT_RAND);
        $key = "1开发者_高级运维2yeshua34";
        $message = $to;
$enc = mcrypt_decrypt(MCRYPT_3DES, $key, $message, MCRYPT_MODE_OFB, $iv); 
echo $enc;
}

This is what gets echoed:

feeb936a8e9896a849c67f011524f6f2e4d8

$p�������t���b�� �'����T���A�f~ 

As you can already tell I am also a newbie. And I believe I've read everything I could find... and I still can't solve this. If I could get this to decrypt, then I could remove the test portion of this code and get an email 'successfully sent off. Thank you and FATHER BLESS jim


assuming your encryption process works fine and uses 3DES in OFB mode to encrypt the address with the provided key "12yeshua34", you will also need the IV used for encryption for that specific address in order to be able to decrypt ... mcrypt_create_iv($ivs, MCRYPT_RAND) will create a random IV each time ... you need the very same IV for both operations: encryption and decryption

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜