This is my encryption code
Code: Select all
if (isset($_POST["encrypt"]))
{
$public = $_SESSION['xpublic'];
$msg = $_REQUEST['emailmsg'];
openssl_public_encrypt($msg, $crypttext, $public);
?>Code: Select all
<tr>
<td><textarea name="emailmsg" id ="emailmsg" rows="15" cols="90"><? echo $crypttext?></textarea></td>
</tr>Code: Select all
<tr>
<td><textarea name="emailmsg" id ="emailmsg" rows="15" cols="90"><?php echo $body?></textarea></td>
</tr>Code: Select all
<?php
if (isset($_POST["decrypt"]))
{
$private = $_SESSION['xprivate'];
openssl_private_decrypt($body, $decrypted, $private);
echo $decrypted;
}
?>and this is how i called the body of my email msgWarning: imap_body() [function.imap-body]: Bad message number in /var/www/MySecureEmail/view.php on line 20
Code: Select all
<?php
$user = $_SESSION['xemail'];;
$password = $_SESSION['xpassword'];
$mail = '{mail.secure.sec:143/notls}INBOX';
$num = $_GET['num'];
$inbox = imap_open($mail, $user, $password) or die ("It was not possible to establish the imap connection.");
/* get information specific to this email */
$overview = imap_fetch_overview($inbox,$num,0);
/* output the email header information */
$output.= $overview[0]->from;
// echo (imap_fetchheader($inbox,$num));
echo ("<BR><P>");
$body = imap_body($inbox,$num);
?>