将MD5更改为sha256或AES-256 SHA

时间:2017-11-01 07:21:18

标签: php hash aes md5 sha

有人可以教我如何将MD5更改为sha256或AES 256 SHA,现在我在注册处理程序和登录处理程序中使用md5加密,那么我该如何更改代码呢?我改变它有什么不利之处吗?

register_handler.php

$password = ""; //password

//Password
$password = strip_tags($_POST['reg_password']); //Remove html tags
$password2 = strip_tags($_POST['reg_password2']); //Remove html tags

if(empty($error_array)) {
    $password = md5($password); //Encrypt password before sending to database

这是我的login_handler.php

<?php

 if(isset($_POST['login_button'])){
 $email = filter_var($_POST['log_email'], FILTER_SANITIZE_EMAIL);

 $_SESSION['log_email'] = $email; //Store email into session variable 
$password = md5($_POST['log_password']); //Get password

0 个答案:

没有答案