Yuxi java training school tells you the algorithm problem of network running security key?

With the continuous development of the Internet, in order to protect our information security on the network, it is usually based on security algorithms and keys. Today's IT training/understanding the algorithm of security key through case analysis.

Brief introduction of DES algorithm

DES(DataEncryptionStandard) is one of the popular encryption algorithms. DES is symmetric, that is, it uses the same key to encrypt and decrypt data.

DES is also a block encryption algorithm, which deals with fixed-length data segments at a time, which is called grouping. The size of DES packet is 64 bits. If the length of encrypted data is not a multiple of 64 bits, these bits can be padded according to some specific rules.

In essence, the security of DES depends on pseudo-representation, and in cryptography, it depends on the principle of "chaos and diffusion". The purpose of confusion is to hide the relationship between any plaintext and ciphertext or key, and the purpose of diffusion is to make plaintext and significant bits in key form as many ciphertext as possible. The combination of the two makes the security relatively high.

DES algorithm encrypts plaintext through a series of permutation and replacement operations. The key of this process is to get the function of 16 subkey from the given initial key. Encrypt a group of plaintext, and each subkey is applied to the data in a series of bit operations in sequence (1- 16), each subkey is used once, and repeated 16 times. Each iteration is called a round. The same steps can be taken to decrypt the ciphertext except that the subkey processes the ciphertext in the reverse order (16- 1).

Calculate 16 subitem

One step of the DES algorithm is to calculate the 16 subkey from the initial key. DES uses a 56-bit initial key, but what is provided here is a 64-bit value, because every 8 bits can be used for parity check in hardware implementation, and the extra bits are simply ignored in software implementation. To obtain a 56-bit key, key conversion can be performed in the form of a license table 1.

Implementation of DES algorithm

Considering that DES algorithm involves many bit operations, DES algorithm is usually implemented in hardware. The charts and terms in DES algorithm (flow chart drawn with lines and boxes, S-box, P-box and other terms) make it more likely to be implemented in hardware. Of course, software implementation also has its value. In software development, it is very effective to help realize various permutation, transformation and replacement operations in DES through several basic instruction operations.