Implement md5 encryption or decryption of text to create md5 encoding

user:visitors Date:2022-04-23 23:10:321795

In some website codes with membership system functions, garbled characters like mzae5e2t5k24x45g2gl3 are often found in the user table in the database, so what is it?

Generally, these are md5 encrypted passwords, which consist of a 128-bit 16-byte hash value that can be used to confirm the integrity and consistency of information transmission

sex.

md5 processes the input information in 512-bit groups, and then each group is divided into 16 32-bit subgroups. After multiple processing, the output is a 128-bit hash value consisting of four 32-bit groups.

So how to generate common strings into md5 encoding?


Here is an example of the common web programming language php.

<?php

$md5 = "aaa";

echo $md5dx=strtoupper(md5($md5));

echo $md5xx=strtolower(md5($md5);

?>

The default md5 function can be used in php, which can easily generate md5 values from specified strings.

In the above example, $md5dx will output the uppercase md5 value, and $md5xx will output the lowercase md5 value.


So why do we sometimes see the md5 value of 16 bits?

The 16-bit md5 is intercepted from the default 32-bit md5 value. We can directly use the substr() function to intercept the 16-bit md5 value from the 16-bit encrypted value.

code show as below:

<?php

$md5 = "bbb";

echo substr($md5,8,16);

?>

Start intercepting from the 8th bit, and then intercept 16 characters to change from 32-bit md5 to 16-bit md5 value.

If you need batch MD5 encryption, you can also use the md5 encryption tool on this site to create md5 encoding directly on the text in the browser.


In theory, the md5 value cannot be cracked or decrypted, so why are there many md5 decryption tools on the Internet?

In fact, these decryption functions depend on the database, not the algorithm. The larger the amount of data in the database, the higher the success rate of decryption.

Their principle is also very simple. Basically, by combining different alphabetic symbols according to the regular number of digits, one by one encrypted md5 strings and the original characters are stored in the database, and a large number of encrypted md5 strings are accumulated through infinite calculations. The string is compared with the original string.

Then when decryption is required, the existing md5 encrypted data in the database will be queried. If there is the same md5 value, the original character corresponding to it is the text content that needs to be decrypted. In this way, the decryption function of md5 can be realized.

Popular articles
latest article