A simple implementation of the DES encryption algorithm

zhaozj2021-02-16  68

Write three algorithms, there is no matter recently, I want to sort it up. In case you lose it, you can find it here. However, it is doubtful that the stability of the truth 9CBS is also very doubtful.

DES Algorithm

Every group of DES is 64 bits, both of which are both 64 bits (the key actually uses 56 bits, each byte 8-bit bit). The core of this algorithm is the Feistel password. Due to the cleverness of its design, encrypted decryption uses a function, please refer to other information. The process of DES is basically performed in 16 rounds: 1 Initial Permutation 2 Right 32-bit F Function 2.1 E Replacement 2.2 and Rotary Key XOR 2.3 S Box Replace 2.4 P Replacement 2.5 and left 32-bit XOR 3 exchange, final Special attention is required that the last round does not need to be exchanged, some books are not clear enough, forced I have calculated it over again, but it is just 64.

Implementation analysis

It can be seen that the DES is based on BIT-based replacement, so my implementation is to save the 64-bit open space in the array, and write a function that deals with the replacement. Private int [] initial, int [] perm) {int [] result = new int [perm.Length]; for (int i = 0; i

I still don't write something.

.........

转载请注明原文地址:https://www.9cbs.com/read-16578.html

New Post(0)