Home php教程 php手册 discuz密码加密方式

discuz密码加密方式

Jun 13, 2016 am 09:34 AM

discuz密码加密的方式,记录在此。 

discuz注册时,会把密码按一个规则加密。
比如我的密码是123456
echo md5("123456"); 

会输出:
e10adc3949ba59abbe56e057f20f883e

而数据库的值却为:
7839dc9437013b5c11a5d86e9b8350e9 

注意到:
有个叫salt的字段,其值为:d82a35
其实这是一个随机的字符串。
第一次md5后的值再加上盐值(salt)再进行md5,就是要得到的值了。
测试:www.jbxue.com
echo md5(md5('123456').'d82a35'); 

这回结果是:7839dc9437013b5c11a5d86e9b8350e9,是对的。
在php5.5之前的版本,并没有很好的加密机制。这是个不错的方式。已经大大地加强了密码的安全性了。
而php5.5中有更为可靠和方便的加密方式。

延伸:
password_hash()
http://www.php.net/manual/zh/function.password-hash.php

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 AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1249
24