最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
C#一个封装的加密解密类
时间:2022-07-02 11:10:51 编辑:袖梨 来源:一聚教程网
using System;
using System.Text;
using System.Globalization;
using System.Security.Cryptography;
using System.Windows.Forms;
namespace Jh.Encrypts
{
public class JhEncrypt
{
///
/// 构造方法
///
public JhEncrypt()
{
}
///
/// 使用缺省密钥字符串加密
///
/// 明文
///密文
public static string Encrypt(string original)
{
return Encrypt(original,"JASONHEUNG");
}
///
/// 使用缺省密钥解密
///
/// 密文
///明文
public static string Decrypt(string original)
{
return Decrypt(original,"JASONHEUNG",System.Text.Encoding.Default);
}
///
/// 使用给定密钥解密
///
/// 密文
/// 密钥
///明文
public static string Decrypt(string original, string key)
{
return Decrypt(original,key,System.Text.Encoding.Default);
}
///
/// 使用缺省密钥解密,返回指定编码方式明文
///
/// 密文
using System.Text;
using System.Globalization;
using System.Security.Cryptography;
using System.Windows.Forms;
namespace Jh.Encrypts
{
public class JhEncrypt
{
///
/// 构造方法
///
public JhEncrypt()
{
}
///
/// 使用缺省密钥字符串加密
///
/// 明文
///
public static string Encrypt(string original)
{
return Encrypt(original,"JASONHEUNG");
}
///
/// 使用缺省密钥解密
///
/// 密文
///
public static string Decrypt(string original)
{
return Decrypt(original,"JASONHEUNG",System.Text.Encoding.Default);
}
///
/// 使用给定密钥解密
///
/// 密文
/// 密钥
///
public static string Decrypt(string original, string key)
{
return Decrypt(original,key,System.Text.Encoding.Default);
}
///
/// 使用缺省密钥解密,返回指定编码方式明文
///
/// 密文
相关文章
- 《弓箭传说2》新手玩法介绍 01-16
- 《地下城与勇士:起源》断桥烟雨多买多送活动内容一览 01-16
- 《差不多高手》醉拳龙技能特点分享 01-16
- 《鬼谷八荒》毕方尾羽解除限制道具推荐 01-16
- 《地下城与勇士:起源》阿拉德首次迎新春活动内容一览 01-16
- 《差不多高手》情圣技能特点分享 01-16