一直想要md5那种加密等长,又能解密的对称加密解密方法,于是有了md6。
第一步,去OT扣来think_encrypt和think_decrypt函数。
第二步,打造自己的md6:function md6($str='',$de=false){<br>
$key=('yourkey');<br>
$char=('MDAwMDAwMDAwM');<br>
if($str!=''){ <br>
if($de){<br>
$str=$char.$str;<br>
$str=think_decrypt($str,$key);<br>
}else{<br>
$str=think_encrypt($str,$key);<br>
$str=str_replace($char, '',$str);<br>
}<br>
}<br>
return $str;<br>
}
用法举例:function test(){<br>
$str= '';<br>
for($i=1;$i
$str=md6($i);<br>
echo($str.' | '.md6($str,true).'<br>');<br>
}<br>
}
输出结果:IKKdXY | 1<br>
IKgdXY | 2<br>
IKwdXY | 3<br>
IN6dXY | 4<br>
IOKdXY | 5<br>
IOgdXY | 6<br>
IOwdXY | 7<br>
IR6dXY | 8<br>
ISKdXY | 9<br>
IKNeXY | 10 <br>
...<br>
<br>
IKNebCzdqRv | 10000<br>
IKNebCzdqhv | 10001<br>
IKNebCzdqxv | 10002<br>
IKNebCzdrBv | 10003<br>
IKNebCzdrRv | 10004<br>
IKNebCzdrhv | 10005<br>
IKNebCzdrxv | 10006<br>
IKNebCzdsZv | 10007<br>
IKNebCzdspv | 10008<br>
IKNebCzds5v | 10009<br>
IKNebCzhqRv | 10010 <br>
...<br>
<br>
IKNfbGzhqSpgqh2cg | 11110000<br>
IKNfbGzhqSpgqh6cg | 11110001<br>
IKNfbGzhqSpgqh-cg | 11110002<br>
IKNfbGzhqSpgqiCcg | 11110003<br>
IKNfbGzhqSpgqiGcg | 11110004<br>
IKNfbGzhqSpgqiKcg | 11110005<br>
IKNfbGzhqSpgqiOcg | 11110006<br>
IKNfbGzhqSpgqiYcg | 11110007<br>
IKNfbGzhqSpgqiccg | 11110008<br>
IKNfbGzhqSpgqigcg | 11110009<br>
IKNfbGzhqSpgrh2cg | 11110010
4-6位数(数字和英文)加密后的密文长度为:11,
7-9位数(数字和英文)加密后的密文长度为:17,
在一定范围内加密出来的密文是等长的,有什么作用就自己去发挥吧,我只能帮到这里了!
AD:真正免费,域名+虚机+企业邮箱=0元

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version
Useful JavaScript development tools

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Linux new version
SublimeText3 Linux latest version

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.