Home > 类库下载 > PHP类库 > Non-reverse parameter md5 encryption method

Non-reverse parameter md5 encryption method

高洛峰
Release: 2016-10-21 10:23:07
Original
1384 people have browsed it

/*
* 如只传进一个$pass参数,则表示加密,并返回一数组
* 数组包含一个加密常量和加密后的密文,如:
* array('pass'=>$pass,'encrypt'=>$encrypt);
* 传进两个参数则返回密文
*/
function password($pass,$encrypt=''){
    if(empty($encrypt)){
        $code = rand(100000, 999999);
        $password = array(
            'password'    => password(trim($pass),$code),
             'encrypt' => $code,
        );
    }else{
        $password = md5(md5($pass).$encrypt);
    }
    return $password;
}
Copy after login

The above method is written to prevent some md5 encryption from being too simple and easily cracked

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