C# 简单的加密解密方法
两个方法如下:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace databackupandfilebackup
{
public class DESEncryptHelper
{
/// <summary>
/// Encrypt string
/// </summary>
/// <param name="value">The string which to be encrypted.</param>
/// <param name="encryptKey">The encrypt Key.</param>
/// <returns>The value after being encrypted.</returns>
public static string Encrypt(string value, string encryptKey)
{
try
{
byte[] rgbKey = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8));
byte[] rgbIV = Encoding.UTF8.GetBytes(encryptKey.Substring(0, 8));
byte[] inputByteArray = Encoding.UTF8.GetBytes(value