密码直接md5和sha1不安全!!!crypt()和hash_equals():http://php.net/manual/zh/function.crypt.php<?php
// crypt()和hash_equals()
$pwds = [‘123456‘, ‘123456‘, ‘123456‘, ‘aaa‘, ‘_123456789zxcvbnmasdfghjklqwertyuiop‘];
function get_random_bytes($size){return function_exists(‘random_bytes‘) ? random_bytes($size) : mcrypt_create_iv($size);
}
function get_salt($size){return substr(strtr(base6...
需要修改phpmyadmin的配置文件,让其连接到MySQL数据库,用记事本打开 config.inc.php 文件 1 <?php2 3/* Servers configuration */ 4$i = 0;5 6/* Server: localhost [1] */ 7$i++;8$cfg[‘Servers‘][$i][‘verbose‘] = ‘localhost‘;9$cfg[‘Servers‘][$i][‘host‘] = ‘localhost‘;
10$cfg[‘Servers‘][$i][‘port‘] = ‘3306‘;
11$cfg[‘Servers‘][$i][‘socket‘] = ‘‘;
12$cfg[‘Servers‘][$i][‘connect_type‘...
1. MD5加密string md5 ( string $str [, bool $raw_output = false ] )参数str -- 原始字符串。raw_output -- 如果可选的 raw_output 被设置为 TRUE,那么 MD5 报文摘要将以16字节长度的原始二进制格式返回。这是一种不可逆加密,执行如下的代码$password = ‘123456‘;echo md5($password);得到结果是e10adc3949ba59abbe56e057f20f883e2. Crype加密string crypt ( string $str [, string $salt ] )crypt() 返回一个基于标准 U...
1>找配置文件 在phpadmin安装目录下->libraries下的config.default.php;2>修改配置文件 71.$cfg[‘Servers‘][$i][‘auth_type‘] = ‘config‘; // Authentication method (config, http or cookie based)? 72.$cfg[‘Servers‘][$i][‘user‘] = ‘root‘; // MySQL user 73.$cfg[‘Servers‘][$i][‘password‘] = ‘yhai1981‘; //默认时这是为空 本文出自 “生命奇迹泉” 博客,请务必...
本文实例讲述了php基于表单密码验证与HTTP验证用法。分享给大家供大家参考。具体分析如下:PHP 的 HTTP 认证机制仅在 PHP 以 Apache 模块方式运行时才有效,因此该功能不适用于 CGI 版本。在 Apache 模块的 PHP 脚本中,可以用 header() 函数来向客户端浏览器发送“Authentication Required”信息,使其弹出一个用户名/密码输入窗口。当用户输入用户名和密码后,包含有 URL 的 PHP 脚本将会加上预定义变量 PHP_AUTH_USER , PHP_A...
密码直接md5和sha1不安全!!!crypt()和hash_equals():http://php.net/manual/zh/function.crypt.php<?php
// crypt()和hash_equals()
$pwds = [‘123456‘, ‘123456‘, ‘123456‘, ‘aaa‘, ‘_123456789zxcvbnmasdfghjklqwertyuiop‘];
function get_random_bytes($size){return function_exists(‘random_bytes‘) ? random_bytes($size) : mcrypt_create_iv($size);
}
function get_salt($size){return substr(strtr(base6...
WAMP安装好后,mysql密码是为空的,那么要如何修改呢?其实很简单,通过几条指令就行了,下面我就一步步来操作。首先,通过WAMP打开mysql控制台。 提示输入密码,因为现在是空,所以直接按回车。然后输入“use mysql”,意思是使用mysql这个数据库,提示“Database changed”就行。然后输入要修改的密码的sql语句“update user set password=PASSWORD(‘hooray‘) where user=‘root‘;”,注意,sql语句结尾的分号不能少,提示什么...
打开 phpmyadmin数据表,点击权限如果没有,请参考:http://jingyan.baidu.com/article/636f38bb293a9bd6b846100d.html 创建 在表中找到用户为:root、主机为:localhost的数据行,点击编辑权限按钮 再点击右下角的按钮 再点击相应行的 编辑权限按钮 设置新的密码 点击执行,修改成功 最后同步将 config.inc.php 文件里的 用户名密码修改为自己新改的8提示,消失了。酷毙了。 原文:http://jingyan.baidu.com/article/4dc40848909...
一个很常见的功能,用户忘记密码了,通过输入之前注册的邮件,我们向用户的邮箱发一个链接以重设密码。用户名 + 随机字符串+过期时间,之后用md5加密一下,这样的设计是否可行?如果用户没有点击链接,已过期的标识符要如何清除?回复内容:一个很常见的功能,用户忘记密码了,通过输入之前注册的邮件,我们向用户的邮箱发一个链接以重设密码。用户名 + 随机字符串+过期时间,之后用md5加密一下,这样的设计是否可行?如果用户没...
产生随机字串,可用来自动生成密码。
特点:
1. 可以指定密码包含数字或字符,默认为混和模式
2. 指定随意密码长度,默认长度为6位代码如下:
#-------------------------------------------
# 产生随机字串,可用来自动生成密码
# 默认长度6位 字母和数字混合
# $format ALL NUMBER CHAR 字串组成格式
#-------------------------------------------
function randStr($len=6,$format='ALL') {
switch($format) {
case 'ALL':
$ch...
本篇文章主要介绍php基于cookie实现记录用户名和密码,感兴趣的朋友参考下,希望对大家有所帮助。具体如下:<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form id="form1" name="form1" method="post" action="check_remember.php">
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0">
<thead><tr> <td colspan="2" align="center"><b>记住用户名和密码</b></td> </tr>
...
<?php2 3 /* Servers configuration */4 $i = 0;5 6 /* Server: localhost [1] */7 $i++;8 $cfg[‘Servers‘][$i][‘verbose‘] = ‘localhost‘;9 $cfg[‘Servers‘][$i][‘host‘] = ‘localhost‘;
10 $cfg[‘Servers‘][$i][‘port‘] = ‘3306‘;
11 $cfg[‘Servers‘][$i][‘socket‘] = ‘‘;
12 $cfg[‘Servers‘][$i][‘connect_type‘] = ‘tcp‘;
13 $cfg[‘Servers‘][$i][‘extension‘] = ‘mysqli‘;
14 $cfg[‘Ser...
Discuz密码加密规则:md5(md5(字符串).固定字串); 固定字符串是在注册用户的时候随机生成的,且保存在数据表pre_ucenter_members的salt字段中。 举例:假如密码为 123456789 ,固定字符串为jb51, 那么加密规则为:md5(md5(123456789).jb51); 得出的结果就是:96122ff0dd306c912aab15adccf21df1Discuz密保加密规则: 加密过程是value的值先加密一次,比如我的提问是“驾驶执照的最后四位数字”value的值就是...
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<form id="form1" name="form1" method="post" action="check_remember.php">
<table width="300" border="1" align="center" cellpadding="0" cellspacing="0">
<thead><tr> <td colspan="2" align="center"><b>记住用户名和密码</b></td> </tr>
</thead> <tr align="center"><td>用 户 名:</td><td><input type="text" value="<?php echo $_COOKIE[name...
用这个可以来验证用户和生成随机密码--teaman <? //---------------------------------------------------- // Function GetSID() // // Parameters : $nSize number of caracters, default 24 // Return value : 24 caracters string // // Description : This function returns a random string // of 24 caracters that can be used to identify users ...