html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
<?php
mysqli_set_charset($dbc, "utf8");
require_once('includes/dbc_connect.php');
$q=" SELECT * FROM users WHERE id='3'";
$r=@mysqli_query($dbc,$q);
$row=mysqli_fetch_assoc($r);
$dece=$row['email'];
$stuff="$dece";
$key="XiTo74dOO09N48YeUmuvbL0E";
function nl() {
}
$iv = mcrypt_create_iv (mcrypt_get_block_size (MCRYPT_TripleDES, MCRYPT_MODE_CBC), MCRYPT_DEV_RANDOM);
// Encrypting
function encrypt($string, $key) {
$enc = "";
$enc=mcrypt_cbc (MCRYPT_TripleDES, $key, $string, MCRYPT_ENCRYPT, $iv);
}
// Decrypting
function decrypt($string, $key) {
$dec = "";
$dec = mcrypt_cbc (MCRYPT_TripleDES, $key, $string, MCRYPT_DECRYPT, $iv);
return $dec;
}
//$encrypted = encrypt($stuff, $key);
$decrypted = decrypt($stuff, $key);
//echo "Encrypted is ".$encrypted . nl();
echo "Decrypted is ".$decrypted . nl
();
//$q=" INSERT INTO users (email) VALUES ('$encrypted')";
//$r=@mysqli_query($dbc,$q);
?>
</body>
</html>