php-md5变换算法之密文分割MD5
May 25, 2016 pm 05:14 PMphp代码
<?php //把密文分割成两段,每段16个字符 function md5_2_1($data) { //先把密码加密成长度为32字符的密文 $data = md5($data); //把密码分割成两段 $left = substr($data, 0, 16); $right = substr($data, 16, 16); //分别加密后再合并 $data = md5($left).md5($right); //最后把长字串再加密一次,成为32字符密文 return md5($data); } //把密文分割成32段,每段1个字符 function md5_2_2($data) { $data = md5($data); //循环地截取密文中的每个字符并进行加密、连接 for ($i = 0; $i < 32; $i++) { $data .= md5($data{$i}); } //这时$data长度为1024个字符,再进行一次MD5运算 return md5($data); } ?>
Copy after login
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

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot tools Tags

Hot Article
Repo: How To Revive Teammates
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌
How Long Does It Take To Beat Split Fiction?
3 weeks ago
By DDD
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago
By 尊渡假赌尊渡假赌尊渡假赌

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)
