DES is the abbreviation of Data Encryption Standard (Data Encryption Standard. It is a 56-bit key to encrypt 64-bit data. Its principles and algorithms are not introduced here. There is a lot of information on the Internet. The following is a DES encryption and decryption class that I modified by referring to other people's code. For your reference:
Code 1 public class EncryptUtility
2 {
3 # region DES
4 /// <summary>
5 // DES encryption
6 /// </summary>
7 // <param name = "code"> encrypted string </param>
8 /// <param name = "key"> key </param>
9 /// <returns> </returns>
10 public static string DesEncrypt (string code, string key)
11 {
12 string iv = StringUtility. Reverse (key );
13 return DesEncrypt (code, key, iv );
14}
15
16 /// <summary>
17 // DES encryption
18 /// </summary>
19 /// <param name = "code"> encrypted string </param>
20 ///