Haohappy/Text
2004-11-01
About random passwords
The system automatically generates random passwords or passwords, which are common functions of web programs. For example, you will not be unfamiliar with this registration mode: when a user registers, the system generates a random password for the user and sends it to the registered email address. After logging on to your mailbox, you can get the random password given by the system, and then log on to the system and change it to your desired password. Compared with sending a password directly to a user's mailbox, this avoids plaintext transmission of the user's password over the network and greatly enhances system security. Random passwords are also commonly used in the "forgot password" function. After a user forgets the password, the system can automatically generate a new password.
/* A cool application for generating random strings is the verification code. In pear, there is a corresponding class library text_captcha. Currently, text_captcha is only an alpha version, so we will not discuss it for the moment. I will introduce it to you after the stable version is released. Text_captcha is developed based on the text_password to be introduced. This article also provides an example of a graphic verification code, developed using text_password + GD. */
The passwords generated in Web development are composed of numbers, letters, and special characters. According to different combinations, the password types can be roughly divided into pure numbers, pure letters, pure special character types, mixed numbers, letters, and special characters.
Pear: text_password Introduction
Http://pear.php.net/package/Text_Password
The pear class introduced today is pear: text_password, which can be called a random password generator. Pear: text_password is a simple class that contains only one PHP file (password. php), and there are only more than 500 lines of code comments. Text_password is easy to learn and use, but its functions are quite powerful and can meet the needs of most web applications (if you think you need to customize some of your own functions, you can re-develop this class library, it is quite convenient ).
The main features of text_password are as follows:
2. You can create random passwords in multiple formats, such as letters, numbers, special characters, and mixed passwords;
2. Custom password length (number of characters );
2. The password can contain only some characters;
2. Multiple passwords can be created at one time;
2. Create a password based on a specific string (non-random, use different algorithms to process the string, such as flip ).
Text_password divides passwords into two types: pronounceable and unpronounceable. Only English letters are allowed. Although the entire password is not a normal English word, it can be divided into syllables for pronunciation, which is helpful for memory, such as steagionea ". Non-pronunciation is mixed, and cannot be pronounced, for example, "micloud aib7 ". Obviously, the deletable model is easy to remember, and the safety is relatively poor. The non-pronunciation model is not easy to remember, but the safety is better. Generally, we do not need to remember random passwords. Therefore, the use of unpronounceable is more common. You can select one based on the actual situation.
System Requirements:
Php4.3. */PhP5
Pear: text_password