Home Backend Development PHP Tutorial Can md5 be decrypted?

Can md5 be decrypted?

Mar 14, 2017 pm 10:47 PM
md5 Decrypt

Anyone who has come into contact with md5 knows that md5 cannot be decrypted, but why are there many websites on the Internet claiming to be able to crack MD5? This article will discuss this issue.


First of all, as said on the Internet, there are many cracked versions of md5 that can be reversed, but they are only based on running a dictionary. The so-called dictionary running is to use the md5 encoding of some commonly used words and phrases for comparison. Notice! It's "commonly used"!
If anyone can't understand what commonly used means, let me give you a mathematical example.
Assume that when x=1, y=1, and when x=0, y=0. What is everyone’s first reaction to this function? y=x^n(n>0)or (y-0.5)^2+(x-0.5)^2=(0.5)^2
This is a commonly used function.
Then what is not commonly used? It’s still the same condition as above: y=log2(x+1)
Okay, it’s actually a commonly used function = =, but it’s too troublesome to compile a less commonly used one - Please forgive me for being lazy.
Suddenly I had an idea and thought of a function that is not commonly used: y=∫ (upper limit 1) (lower limit 0) (8x^3+8x^2-16x)dx.


Let’s look at an example:

MD5 processes the input information in 512-bit groups. Each group is divided into 16 32-bit sub-groups. After a series of processing, the output of the algorithm consists of four 32-bit groups. These four 32-bit sub-groups are The group concatenation will produce a 128-bit hash value. In the MD5 algorithm, the information first needs to be processed so that its byte length is 448 after the remainder of 512. Therefore, the byte length of the information will be extended to N*512+448, that is, N*64+56 bytes, where N is a positive integer. The filling method is as follows: fill in a 1 at the end of the information, and then supplement it with 0 until the conditions are met. This result is then appended with a pre-padding information length expressed in 64-bit binary. After these two steps of processing, the direct length of the information changes to N*512+448+64=(N+1)*512, that is, the length is exactly an integer multiple of 512. This is done to meet the information length requirements in subsequent processing.

There are four 32-bit integer parameters called connection variables in MD5, which are:

A=0x01234567;

B=0x89abcdef;

C=0xfedcba98;

D=0x76543210.

There are also 4 processing bit operation functions, they are:

F(X,Y,Z)=(X&Y)|((~X)&Z);

G(X,Y,Z)=(X&Z)|(Y&(~Z));

H(X,Y,Z)=X^Y^Z;

I(X,Y,Z)=Y^(X|(~Z));

Among them, X, Y, Z respectively represent any 32-bit integer. & is the AND operation, | is the OR operation, ~ is the NOT operation, and ^ is the XOR operation [4].

The specific steps are:

First, copy A to the a variable, B to the b variable, C to the c variable, and D to the d variable. Then, four rounds of the main loop are performed, each round performing 16 operations. Each operation performs a nonlinear function operation on three of a, b, c, and d, and then adds the result to the fourth variable, a subgroup of the text, and a constant. Then move the result to the right by an indefinite number, and add one of a, b, c, and d.


From the above example, we can clearly know that md5 is to simplify the text content of any length into a 128-bit hash number. Whether the text content has only one letter a, or a long paper with more than 10,000 words, it is all reduced (or filled) into a 128-bit hash number. This makes cracking almost impossible.

Why do you say that? Still in the example just now, I tell you the result "x=0, when y=0; when x=1, y=1" but I don't tell you (in fact, no one will count how many characters are in the document) what kind of function is this? , is it a log function, a linear function, or a higher-order function? I don’t know, how can I crack it?

Moreover, in fact, in the field of encryption, DES and RSA are the real encryption, while MD5 is more used for document verification and is used to generate keys to detect whether the document has been tampered with.

After seeing this, it should be clear to everyone that md5 cannot be decrypted


Two more good knowledge points:

1.So-called encryption:

Encryption technology is the most commonly used security and confidentiality method. It uses technical means to turn important data into garbled codes (encrypted) for transmission, and then restores (decrypts) it using the same or different means after reaching the destination.
Encryption technology consists of two elements: algorithm and algorithm (which is the step of combining ordinary information or understandable information with a string of numbers) to produce incomprehensible ciphertext. The key is used to encode and decrypt data. an algorithm. In security and confidentiality, the security of network information communication can be ensured through appropriate key encryption technology and management mechanisms.

2.So-called hash:

Hash, generally translated as "hash", and also directly transliterated as "hash", is to convert input of any length (also called pre-mapping, pre-image) into a fixed-length input through a hash algorithm. The output is the hash value. This conversion is a compressed mapping, that is, the space of hash values ​​is usually much smaller than the space of inputs. Different inputs may hash into the same output, and it is impossible to uniquely determine the input value from the hash value.
Simply put, it is a function that compresses a message of any length into a fixed-length information digest.
HASH is mainly used as an encryption algorithm in the field of information security. It converts information of different lengths into a messy 128-bit code, called a HASH value. It can also be said that hash is to find a data content and data storage address. mapping relationship between them.
The application of Hash algorithm in information security is mainly reflected in the following three aspects:
1) File verification
The verification algorithms we are more familiar with include parity check and CRC check. These two Checksums do not have the ability to resist data tampering. They can detect and correct channel errors in data transmission to a certain extent, but they cannot prevent malicious damage to data.
The "digital fingerprint" feature of the MD5 Hash algorithm makes it the most widely used file integrity checksum (Checksum) algorithm. Many Unix systems provide commands for calculating md5 checksum.
2) Digital signature
Hash algorithm is also an important part of modern cryptography system. Because asymmetric algorithms operate slowly, one-way hash functions play an important role in digital signature protocols. Digitally signing a hash value, also known as a "digital digest," can be considered statistically equivalent to digitally signing the file itself. And such an agreement has other advantages.
3) Authentication protocol
The following authentication protocol is also called "challenge-authentication mode: when the transmission channel can be intercepted but cannot be tampered with, this is a simple and Safe method.

Related articles:
php md5 encryption and decryption algorithms and tools (with code)
php md5 decryption code sharing (with interface, personal test) Available)
Can php md5 encryption be cracked?
##MD5 encryption tool

The above is the detailed content of Can md5 be decrypted?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Revealing the causes of HTTP status code 460 Revealing the causes of HTTP status code 460 Feb 19, 2024 pm 08:30 PM

Decrypting HTTP status code 460: Why does this error occur? Introduction: In daily network use, we often encounter various error prompts, including HTTP status codes. These status codes are a mechanism defined by the HTTP protocol to indicate the processing of a request. Among these status codes, there is a relatively rare error code, namely 460. This article will delve into this error code and explain why this error occurs. Definition of HTTP status code 460: First, we need to understand the basics of HTTP status code

How to use MD5 encryption in MySQL How to use MD5 encryption in MySQL May 28, 2023 pm 02:16 PM

What is MD5? MD5 Message-DigestAgorithm (English: MD5Message-DigestAgorithm), a widely used cryptographic hash function, can produce a 128-bit (16-byte) hash value (hash value) to ensure complete and consistent information transmission. MD5 was designed by American cryptographer Ronald Linn Rivest and made public in 1992 to replace the MD4 algorithm. The program of this algorithm is specified in the RFC1321 standard. After 1996, the algorithm was proven to have weaknesses and could be cracked. For data requiring high security, experts generally recommend using other algorithms.

PHP calculates MD5 hash of file PHP calculates MD5 hash of file Mar 21, 2024 pm 01:42 PM

This article will explain in detail about PHP calculating the MD5 hash of files. The editor thinks it is quite practical, so I share it with you as a reference. I hope you can gain something after reading this article. PHP calculates the MD5 hash of a file MD5 (MessageDigest5) is a one-way encryption algorithm that converts messages of arbitrary length into a fixed-length 128-bit hash value. It is widely used to ensure file integrity, verify data authenticity and create digital signatures. Calculating the MD5 hash of a file in PHP PHP provides multiple methods to calculate the MD5 hash of a file: Use the md5_file() function. The md5_file() function directly calculates the MD5 hash value of the file and returns a 32-character

ThinkPHP6 data encryption and decryption: protecting sensitive data security ThinkPHP6 data encryption and decryption: protecting sensitive data security Aug 25, 2023 pm 10:52 PM

ThinkPHP6 Data Encryption and Decryption: Protecting Sensitive Data Security Overview: With the rapid development of the Internet, data security issues are becoming more and more important. Especially in network application development, the protection of some sensitive data is crucial. The ThinkPHP6 framework provides a powerful data encryption and decryption mechanism, which can effectively improve data security by encrypting sensitive data. Using the encryption functions of ThinkPHP6 The ThinkPHP6 framework has a variety of built-in encryption functions, which can be used as needed.

How to set up word decryption How to set up word decryption Mar 20, 2024 pm 04:36 PM

In today's work environment, everyone's awareness of confidentiality is getting stronger and stronger, and encryption operations are often performed to protect files when using software. Especially for key documents, the awareness of confidentiality should be increased, and the security of documents should be given top priority at all times. So I don’t know how well everyone understands word decryption. How to operate it specifically? Today we will actually show you the process of word decryption through the explanation below. Friends who need to learn word decryption knowledge should not miss today's course. A decryption operation is first required to protect the file, which means that the file is processed as a protective document. After doing this to a file, a prompt pops up when you open the file again. The way to decrypt the file is to enter the password, so you can directly

Java development skills revealed: implementing data encryption and decryption functions Java development skills revealed: implementing data encryption and decryption functions Nov 20, 2023 pm 05:00 PM

Java development skills revealed: Implementing data encryption and decryption functions In the current information age, data security has become a very important issue. In order to protect the security of sensitive data, many applications use encryption algorithms to encrypt the data. As a very popular programming language, Java also provides a rich library of encryption technologies and tools. This article will reveal some techniques for implementing data encryption and decryption functions in Java development to help developers better protect data security. 1. Selection of data encryption algorithm Java supports many

Complete list of PHP encryption and decryption functions: safe application methods of md5, sha1, base64_encode and other functions Complete list of PHP encryption and decryption functions: safe application methods of md5, sha1, base64_encode and other functions Nov 18, 2023 pm 04:18 PM

Complete list of PHP encryption and decryption functions: safe application methods of md5, sha1, base64_encode and other functions, requiring specific code examples. In the development of network applications, data encryption and decryption is very important. As a popular server-side scripting language, PHP provides a variety of encryption and decryption functions. This article will introduce commonly used functions and their secure application methods, and provide specific code examples. md5 function The md5 function is the most common encryption function that can convert a string of any length into 32 bits

Detailed introduction to the encryption and decryption methods of Vim text in CentOS Detailed introduction to the encryption and decryption methods of Vim text in CentOS Dec 31, 2023 pm 02:49 PM

CentOS uses vim/vi to encrypt and decrypt files 1. Use vim/vi to encrypt: Advantages: After encryption, if you don’t know the password, you cannot see the plain text, including root users; Disadvantages: It is obvious that others know the encryption , it is easy for others to destroy encrypted files, including content destruction and deletion; I believe everyone is familiar with the vi editor. There is a command in vi to encrypt files. For example: 1) First, in the root master Create an experimental file text.txt under the directory /root/: [root@www~]#vim/vitext.txt2) Enter the editing mode, press ESC after entering the content, and then enter: X (note the capital X), Enter; 3)

See all articles