You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
|
|
|
namespace Utils.Security
|
|
|
{
|
|
|
public static class SecurityUtil
|
|
|
{
|
|
|
//key长度必须为8
|
|
|
public static string Change(string data, string key)
|
|
|
{
|
|
|
DES2 des = new DES2();
|
|
|
return des.EncryptString(data, key);
|
|
|
}
|
|
|
|
|
|
//key长度必须为8
|
|
|
public static string ChangeBack(string data, string key)
|
|
|
{
|
|
|
DES2 des = new DES2();
|
|
|
return des.DecryptString(data, key);
|
|
|
}
|
|
|
}
|
|
|
}
|