Encryption algorithms based on "symmetric keys" mainly include DES, TripleDES, RC2, RC4, RC5 and Blowfish.
Symmetric key: DES TripleDES algorithm
The DES algorithm turns a 64-bit plaintext input block into a ciphertext output block with a data length of 64 bits, of which 8 bits are parity. bits, and the other 56 bits as the password length. First, DES recombines the input 64-bit data blocks bit by bit, and divides the output into two parts, L0 and R0. Each part is 32 bits long, and performs front and rear permutations. Finally, L0 outputs the left 32 bits, and R0 outputs the right 32 bits. bit, according to this rule, after 16 iterations, L16 and R16 are obtained, which are used as input and the inverse permutation of the initial permutation is performed to obtain the ciphertext output.
The DES algorithm has extremely high security. So far, apart from using the exhaustive search method to attack the DES algorithm, no more effective method has been found, and the exhaustive search method of the 56-bit long key The space is 2^56, which means that if a computer's speed is to detect 1 million keys per second, it will take nearly 2285 years to search all keys, so the DES algorithm is a very reliable Encryption method.
Symmetric key: RC algorithm
The principle of RC4 algorithm is "chaos". It includes two parts: initialization algorithm and pseudo-random sub-cipher generation algorithm. During the initialization process, The main function of the key is to randomly scramble a 256-byte initial number cluster. Different number clusters can obtain different sub-key sequences after being processed by the pseudo-random sub-key generation algorithm. The obtained sub-key sequence will be After performing an XOR operation (XOR) with the plaintext, the ciphertext is obtained.
Since the RC4 algorithm uses the XOR method for encryption, once the sub-key sequence is repeated, the ciphertext may be cracked. However, no RC4 with a key length of 128 bits has yet been found. There is the possibility of duplication, so RC4 is also one of the most secure encryption algorithms currently.
Symmetric key: BlowFish algorithm
The BlowFish algorithm is a 64-bit block and variable key length block cipher algorithm. The algorithm is non-patented.
The BlowFish algorithm uses two "boxes": pbox[18] and sbox[4256]. The BlowFish algorithm has a core encryption function. This function inputs 64-bit information and outputs it in the form of 64-bit ciphertext after operation. Encrypting information using the BlowFish algorithm requires two processes: key preprocessing and information encryption. The original keys pbox and sbox of the BlowFish algorithm are fixed. To encrypt a message, you need to select a key, use this key to transform pbox and sbox, and obtain the key_pbox and key_sbox used in the next step of information encryption.
BlowFish algorithm decryption also requires two processes: key preprocessing and information decryption. The process of key preprocessing is exactly the same as that of encryption. The process of information decryption is to use the key_pbox in the information encryption process in reverse order.