Home > php教程 > php手册 > php源码分析之DZX1.5加密解密函数authcode用法

php源码分析之DZX1.5加密解密函数authcode用法

WBOY
Release: 2016-06-06 20:03:21
Original
920 people have browsed it

这篇文章主要介绍了php源码分析之DZX1.5加密解密函数authcode用法,实例分析了DZX1.5中authcode函数加密与解密的使用技巧,需要的朋友可以参考下

本文实例讲述了php源码分析之DZX1.5加密解密函数authcode用法。分享给大家供大家参考。具体分析如下:

0) && substr($result, 10, 16) == substr(md5(substr($result, 26).$keyb), 0, 16)) { return substr($result, 26); } else { return ''; } } else { return $keyc.str_replace('=', '', base64_encode($result)); } } $str = '1234'; $key = '1234'; echo "明文:".$str; echo "
"; echo "密钥:".$key; $encode = authcode($str,'11',$key); echo "
"; echo "加密后的密文:".$encode; echo "
"; $decode = authcode($encode,'DECODE',$key); echo "解密后的明文:".$decode; /*End of php*/

运行结果如下:

明文:1234
密钥:1234
加密后的密文:a52f67eXZGVy0HtQBo4vOREhq3WxnL6E2zlx75JGfoJW
解密后的明文:1234

希望本文所述对大家的php程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template