Home >Backend Development >PHP Problem >What is the difference between aes and des in php
Difference: 1. DES divides the plaintext into two halves for processing, while AES processes the whole block together to generate ciphertext; 2. AES is much faster than DES, and AES can encrypt large files in a few seconds. ;3. The functions used by DES round processing are expansion and replacement, while the functions used by AES round processing are mixing columns and adding round keys.
The operating environment of this article: Windows 10 system, PHP version 7.1, Dell G3 computer.
The main difference between DES and AES is the encryption process. In DES, the plaintext is divided into two halves before further processing, whereas in AES, the entire block is not divided and the entire block is processed together to generate the ciphertext.
Relatively speaking, AES is much faster than DES, and compared to DES, AES is able to encrypt large files in a few seconds.
Due to the smaller bit size of the shared key used in DES, it is considered less secure than AES. DES is considered more susceptible to brute force attacks, while AES has not encountered any serious attacks so far.
Evaluate the implementation of the algorithm on the basis of flexibility, and AES is more flexible than DES because it allows text of various lengths including 128, 192, 256 bits, while DES allows text of 64 Bit fixed text is encrypted.
The functions used in DES round processing are extend, permute and replace, XOR operations with round keys, while the functions used in AES round are subbytes, shift rows, mix columns and add round keys.
AES is actually efficient in both hardware and software implementations, while DES was initially only efficient in hardware.
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What is the difference between aes and des in php. For more information, please follow other related articles on the PHP Chinese website!