今天和大家探讨一个很重要的问题密码安全_PHP
PHP代码:--------------------------------------------------------------------------------
$sRand = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
$length = strlen($sRand);
if (!($dir = @opendir("/dic"))) {
mkdir ("dic", 0777);
}
for ($q=0; $q if ($q > 25 && $q $op = 'cap';
} else {
$op = ';
}
$fp = fopen("./dic/".$op.$sRand[$q].".txt", "w");
$crack = $sRand[$q];
fputs($fp, $crack."|".md5($crack)."\n");
for ($m=0; $m $crack = $sRand[$q].$sRand[$m];
fputs($fp, $crack."|".md5($crack)."\n");
for ($l=0; $l $crack = $sRand[$q].$sRand[$m].$sRand[$l];
fputs($fp, $crack."|".md5($crack)."\n");
for ($o=0; $o $crack = $sRand[$q].$sRand[$m].$sRand[$l].$sRand[$o];
fputs($fp, $crack."|".md5($crack)."\n");
}
}
}
fclose($fp);
}
--------------------------------------------------------------------------------
需要注意地是,这只是一个例子,为了简单期间,我们锁定密码字元为26个小写字母,26个大写字母,10个数字(相信应该适合大多数密码了,不知哪位BT朋友加标点符号呢?呵呵……),而我们只测试四位以内地密码,密码位数增多时原理相同,只是破解可能性大大降低,这个一会儿再讲。
这样,就再dic目录下产生了一系列字典文件。
现在,让我们来做一个MD5的随机密码:
PHP代码:--------------------------------------------------------------------------------
$afcontent = file("./dic/".$op.$sRand[$s].".txt", "r");
foreach($afcontent as $sdics) {
$adics = explode("|", $sdics);
if (substr($adics[1], 0, 32) == $md5_pwd) {
echo "破解密码为:".$adics[0]."
";
$mtime = explode(' ', microtime());
$endtime = $mtime[1] + $mtime[0];
echo "总耗时:".round($endtime - $starttime, 6)."秒
";
echo "继续测试";
exit();
}
}
for ($s=0; $s if ($s >25 && $s $op = 'cap';
} else {
$op = ';
}
$afcontent = file("./dic/".$op.$sRand[$s].".txt", "r");
foreach($afcontent as $sdics) {
if (md5($sdics) == $md5_pwd) {
echo "破解密码为:".$sdics;
exit();
}
}
}
--------------------------------------------------------------------------------
在程序中,你再加上检测运行时间的代码,就可以知道破解一个62字元四位长度的MD5密码需要多长时间了。。。
没测之前,大家先估计一下呢?
还有,现在默认要产生大概537M~~
且需花费15分钟左右生成字典(在我PIII733 256M 内存上)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



When using Win11 system, sometimes you will encounter a prompt that requires you to enter the administrator username and password. This article will discuss how to deal with this situation. Method 1: 1. Click [Windows Logo], then press [Shift+Restart] to enter safe mode; or enter safe mode this way: click the Start menu and select Settings. Select "Update and Security"; select "Restart Now" in "Recovery"; after restarting and entering the options, select - Troubleshoot - Advanced Options - Startup Settings -&mdash

Wireless networks have become an indispensable part of people's lives in today's digital world. Protecting the security of personal wireless networks is particularly important, however. Setting a strong password is key to ensuring that your WiFi network cannot be hacked by others. To ensure your network security, this article will introduce in detail how to use your mobile phone to change the router WiFi password. 1. Open the router management page - Open the router management page in the mobile browser and enter the router's default IP address. 2. Enter the administrator username and password - To gain access, enter the correct administrator username and password in the login page. 3. Navigate to the wireless settings page - find and click to enter the wireless settings page, in the router management page. 4. Find the current Wi

Wireless networks have become an indispensable part of our lives with the rapid development of the Internet. In order to protect personal information and network security, it is very important to change your wifi password regularly, however. To help you better protect your home network security, this article will introduce you to a detailed tutorial on how to use your mobile phone to change your WiFi password. 1. Understand the importance of WiFi passwords. WiFi passwords are the first line of defense to protect personal information and network security. In the Internet age, understanding its importance can better understand why passwords need to be changed regularly. 2. Confirm that the phone is connected to wifi. First, make sure that the phone is connected to the wifi network whose password you want to change before changing the wifi password. 3. Open the phone’s settings menu and enter the phone’s settings menu.

In the Windows 10 system, the password policy is a set of security rules to ensure that the passwords set by users meet certain strength and complexity requirements. If the system prompts that your password does not meet the password policy requirements, it usually means that your password does not meet the requirements set by Microsoft. standards for complexity, length, or character types, so how can this be avoided? Users can directly find the password policy under the local computer policy to perform operations. Let’s take a look below. Solutions that do not comply with password policy specifications: Change the password length: According to the password policy requirements, we can try to increase the length of the password, such as changing the original 6-digit password to 8-digit or longer. Add special characters: Password policies often require special characters such as @, #, $, etc. I

Wireless networks have become an integral part of people's lives in modern society. Or need to view saved passwords in WiFi list, sometimes we forget WiFi password, however. Mobile software came into being to solve this problem. To make it easy for you to master this magical tool, this article will introduce a software that can help you quickly unlock all WiFi passwords. 1. Powerful WiFi password unlocking tool - explore the wonderful world of WiFi password unlocking 2. Simple and easy-to-use interface design - convenient and fast operation methods 3. Supports multiple devices - meets the needs of different devices 4. Automatically Update - always keep the latest WiFi password 5. High-speed WiFi connection - easily cope with the simultaneous connection needs of multiple devices

Our mobile phones have become an integral part of our lives in modern society. Wireless network connections have also become an indispensable tool in our daily lives. However, sometimes we face such a situation: we want to connect to other devices but are unable to do so, we connect to WiFi but forget the password. How to easily get the WiFi password of a connected mobile phone? Find the saved WiFi password on the phone 1. Find the "WiFi" option in the settings, find and click it, and enter the phone's settings interface "WiFi" to enter the WiFi settings page, option. 2. Open the connected WiFi network details, find the name of the connected WiFi network, click to enter the detailed information page of the network, in the WiFi settings page. 3.

Wireless networks have become an integral part of our lives in modern society. Securing your home WiFi network is also becoming increasingly important, however. Resetting your WiFi password is a critical task to ensure network security. To protect your home network security, this article will introduce you how to reset your WiFi password through your router. Understand the router login interface. Connect to the router and open the management page. Enter the administrator username and password. Enter the wireless settings option. Find the current WiFi name and password. Back up the network settings. Select the modify password option. Enter the new WiFi password. Set a strong password. Save the settings and exit. Reconnect the device to Test the new WiFi network to see if the connection is successful. Configure other security settings. Change the WiFi password regularly to learn the route.

Java framework design enables security by balancing security needs with business needs: identifying key business needs and prioritizing relevant security requirements. Develop flexible security strategies, respond to threats in layers, and make regular adjustments. Consider architectural flexibility, support business evolution, and abstract security functions. Prioritize efficiency and availability, optimize security measures, and improve visibility.
