Based on this http://www.torrenttrader.xyz/index.php?threads/v2-08-mods-completed-encrypting-emails-in-bdd.26/ so credit to original author.
just a few more things to test but i have this installed on my live site, members do need to update emails but looking at adding staff to be able to see old un-encrypted emails and maybe a account-recovery1.php to allow members to recover account with old un-encrypted emails.
Upload encrypt_email.php to backend
[color=rgb(251, 160, 38)]backend/config.php add[/color]
[color=rgb(251, 160, 38)]backend/functions.php find[/color]
add below
[color=rgb(251, 160, 38)]account-ce.php find[/color]
add below
find
add below
[color=rgb(251, 160, 38)]account-details.php find[/color]
add after
find
replace with
[color=rgb(251, 160, 38)]account-recover.php[/color]
add after
find
replace with
find
replace with
[color=rgb(251, 160, 38)]account.php find[/color]
after add
find
replace with
find
replace with
[color=rgb(251, 160, 38)]admin-modtask.php find[/color]
add after
[color=rgb(251, 160, 38)]account-signup.php find[/color]
add after
find
replace with
find
replace with
find
replace with
[color=rgb(251, 160, 38)]admincp.php & mass mail[/color]
still checking these
just a few more things to test but i have this installed on my live site, members do need to update emails but looking at adding staff to be able to see old un-encrypted emails and maybe a account-recovery1.php to allow members to recover account with old un-encrypted emails.
Upload encrypt_email.php to backend
[color=rgb(251, 160, 38)]backend/config.php add[/color]
// email encrypt
$site_config["clef"] = 'AHIJKLMNOPQRSTUVWXYZabcde,;:!ยง#)nopqrstuvwxyz0123456789+@='; // change your key as you wish[color=rgb(251, 160, 38)]backend/functions.php find[/color]
require_once(BACKEND."/languages.php");add below
require_once($_SERVER["DOCUMENT_ROOT"]."/backend/encrypt_email.php");[color=rgb(251, 160, 38)]account-ce.php find[/color]
$email = $_GET["email"];add below
// encrypt email
$crypt = new Cryptage();
$clef = $site_config["clef"];
find
if ($md5 != md5($sec . $email . $sec))
show_error_msg(T_("ERROR"), T_("NOTHING_FOUND"), 1);
add below
// encrypt email
$email = $crypt->b64encode($email, $clef);[color=rgb(251, 160, 38)]account-details.php find[/color]
$modcomment = htmlspecialchars($user["modcomment"]);add after
// email encrypt
$crypt = new Cryptage();
$clef = $site_config["clef"];
$mail = $crypt->b64decode($user[email], $clef);
find
print("<tr><td>".T_("EMAIL")."</td><td align='left'><input type='text' size='67' name='email' value=\"$user[email]\" /></td></tr>\n");replace with
print("<tr><td>".T_("EMAIL")."</td><td align='left'><input type='text' size='67' name='email' value=\"$mail\" /></td></tr>\n");[color=rgb(251, 160, 38)]account-recover.php[/color]
dbconn();add after
// email encrypt
$crypt = new Cryptage();
$clef = $site_config["clef"];
find
$res = SQL_Query_exec("SELECT id, username, email FROM users WHERE email=" . sqlesc($email) . " LIMIT 1");replace with
// email encrypt
$mail = $crypt->b64encode($email, $clef);
$res = SQL_Query_exec("SELECT id, username, email FROM users WHERE email=" . sqlesc($mail) . " LIMIT 1");
find
$res2 = SQL_Query_exec("UPDATE `users` SET `secret` = ".sqlesc($sec)." WHERE `email`= ". sqlesc($email) ." LIMIT 1");replace with
$res2 = SQL_Query_exec("UPDATE `users` SET `secret` = ".sqlesc($sec)." WHERE `email`= ". sqlesc($mail) ." LIMIT 1");[color=rgb(251, 160, 38)]account.php find[/color]
loggedinonly();after add
// encrypt email
$crypt = new Cryptage();
$clef = $site_config["clef"];
$mail = $crypt->b64decode($CURUSER["email"], $clef);
find
print("<tr><td align='right' class='alt2'><b>" . T_("EMAIL") . ":</b> </td><td align='left' class='alt2'><input type=\"text\" name=\"email\" size=\"50\" value=\"" . htmlspecialchars($CURUSER["email"]) .
"\" /><br />\n<i>".T_("REPLY_TO_CONFIRM_EMAIL")."</i><br /></td></tr>");
replace with
print("<tr><td align='right' class='alt2'><b>" . T_("EMAIL") . ":</b> </td><td align='left' class='alt2'><input type=\"text\" name=\"email\" size=\"50\" value=\"" . $mail . "\" /><br />\n<i>".T_("REPLY_TO_CONFIRM_EMAIL")."</i><br /></td></tr>");
find
if ($email != $CURUSER["email"]) {replace with
if ($email != $mail) {[color=rgb(251, 160, 38)]admin-modtask.php find[/color]
//continue updatesadd after
// encrypt email
$crypt = new Cryptage();
$clef = $site_config["clef"];
$email = $crypt->b64encode($email, $clef);
[color=rgb(251, 160, 38)]account-signup.php find[/color]
dbconn();add after
// email encrypt
$crypt = new Cryptage();
$clef = $site_config["clef"];find
$maildomain = (substr($email, strpos($email, "@") + 1));
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$email'")));replace with
// encrypt email
$maildomain = (substr($email, strpos($email, "@") + 1));
$mail = $crypt->b64encode($email, $clef);
$maildomain = $crypt->b64encode($maildomain, $clef);
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$mail'")));find
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from users where email='$email'")));replace with
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from users where email='$mail'")));find
implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $email, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");replace with
implode(",", array_map("sqlesc", array($wantusername, $wantpassword, $secret, $mail, $status, get_date_time(), get_date_time(), $age, $country, $gender, $client, $site_config["default_theme"], $site_config["default_language"], $signupclass, getip()))).")");[color=rgb(251, 160, 38)]admincp.php & mass mail[/color]
still checking these

