当前位置 : 主页 > 网络编程 > PHP >

php 加密加密字符串函数

来源:互联网 收集:自由互联 发布时间:2021-07-03
function encryptDecrypt($key, $string, $decrypt){ if($decrypt){ $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "12"); return $decrypted; }else{ $encrypted = base64
 
function encryptDecrypt($key, $string, $decrypt){
  if($decrypt){
      $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, md5($key), base64_decode($string), MCRYPT_MODE_CBC, md5(md5($key))), "12");
      return $decrypted;
  }else{
      $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5($key), $string, MCRYPT_MODE_CBC, md5(md5($key))));
      return $encrypted;
  }
}
 
网友评论