我试图履行能够产生随机密码的职能,必须符合以下要求:
- Between 8 & 14 characters
- Contain a least one of the following: lowercase letter, uppercase letter, punctuation, and number
实现这一目标的最佳途径是什么,这样,这一职能能够产生符合上述要求的所有可能的密码?
我试图履行能够产生随机密码的职能,必须符合以下要求:
实现这一目标的最佳途径是什么,这样,这一职能能够产生符合上述要求的所有可能的密码?
str_shuffle
.然而,应该指出,如果你重新产生随机特性,迫使每个密码至少有一个编号/图象等,实际上没有任何保障。 事实上,你可以说,这不太安全,因为它实际上限制了你的密码选择。
http://www.google.com/search?q=php+password+generator” rel=“nofollow noretinger”>PHP Password Plant(包括来源)。 其中几个国家有能力从你提到的品级中具体规定最低要求。
其中大部分依靠mt_rand(
功能,以方便随机。
如果你真的需要获得一个良好的随机来源,那么你需要把手法上打上灯(即:/dev/random
in linux or the ,
略微的怀疑做法:
Generate a random number between 8 and 14
generate a completely random string of characters that is that long
Check it against a regular expression that defines the lowercase/uppercase/etc requirement
If it fails, try again.
简言之,应简明扼要。 与此类似,只是为了纠正长度,随机抽取高压,插入随机校准:
sha1(microtime() . rand(0,100))
我应该指出,我看到,在某种地方,这种口号的形成确实是聪明的,可能比这好,但可以回顾到什么地方。
相关问题
Brute-force/DoS prevention in PHP [closed]
I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this:
User sends login information.
Check if username and password is ...
please can anyone check this while loop and if condition
<?php
$con=mysql_connect("localhost","mts","mts");
if(!con)
{
die( unable to connect . mysql_error());
}
mysql_select_db("mts",$con);
/*
date_default_timezone_set ("Asia/Calcutta");
$date = ...
How to Improve image quality when resized as a thumbnail using PHP?
I found this script online that creates a thumbnail out of a image but the thumbnail image is created with poor quality how can I improve the quality of the image.
And is there a better way to create ...
定值美元
如何确认来自正确来源的数字。
Generating a drop down list of timezones with PHP
Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5.
I need ...
how to use curl to post message to a facebook business page?
I wonder there is a way to post a message to a facebook business page with cURL?
thanks
Text as watermarking in PHP
I want to create text as a watermark for an image. the water mark should have the following properties
front: Impact
color: white
opacity: 31%
Font style: regular, bold
Bevel and Emboss
size: 30 ...
How does php cast boolean variables?
How does php cast boolean variables?
I was trying to save a boolean value to an array:
$result["Users"]["is_login"] = true;
but when I use debug the is_login value is blank.
and when I do ...
热门标签
- winforms
- combobox
- fogbugz
- java
- date
- internationalization
- asp.net
- iis
- url-rewriting
- urlrewriter
- c#
- enums
- ocaml
- haxe
- algorithm
- string
- viewstate
- .net
- c++
- c
- symbol-table
- mysql
- database
- postgresql
- licensing
- migration
- vb.net
- vb6
- declaration
- vb6-migration
- python
- psycopg2
- backup
- vmware
- virtualization
- gnu-screen
- authentication
- desktop
- excel
- xll
- cultureinfo
- regioninfo
- oracle
- client
- session
- download
- html
- virtual
- constructor
- scenarios
- perl
- full-text-search
- javascript
- ajax
- testing
- oop
- inheritance
- vim
- encapsulation
- information-hiding