在.NET中,我们可以直接使用System.Security.Cryptography空间中的通过加密/解密类进行操作.
这几天在玩数据加密的时候用到了.
感觉用起来不是很方便.
于是写了一个通用(hoho,算是比较通用的吧)的加密/解密的类.
现在只完成了对称加密类的封装.
代码:

AppEncrypts helper.提供加密解密的一个通用类:)using System;
AppEncrypts helper.提供加密解密的一个通用类:)
using System.IO;
AppEncrypts helper.提供加密解密的一个通用类:)
using System.Text;
AppEncrypts helper.提供加密解密的一个通用类:)
using System.Security.Cryptography;
AppEncrypts helper.提供加密解密的一个通用类:)
AppEncrypts helper.提供加密解密的一个通用类:)
namespace CnBlogs.Helper.hBifTs


使用只要直接调用基类的Encrypt和Dencrypt函数即可..
测试用例如下:
AppEncrypts helper.提供加密解密的一个通用类:)using System;
AppEncrypts helper.提供加密解密的一个通用类:)
using System.IO;
AppEncrypts helper.提供加密解密的一个通用类:)
using System.Text;
AppEncrypts helper.提供加密解密的一个通用类:)
using CnBlogs.Helper.hBifTs;
AppEncrypts helper.提供加密解密的一个通用类:)
using NUnit.Framework;
AppEncrypts helper.提供加密解密的一个通用类:)
AppEncrypts helper.提供加密解密的一个通用类:)
AppEncrypts helper.提供加密解密的一个通用类:)
namespace CnBlogs.Helper.hBifTs.TestCases

灵感之源的要求,提供代码下载: AppEncrypts.zip

相关文章:

  • 2021-06-07
  • 2022-12-23
  • 2022-02-10
  • 2021-10-22
  • 2022-01-15
  • 2021-10-25
  • 2021-11-17
  • 2021-08-19
猜你喜欢
  • 2021-11-13
  • 2021-06-11
  • 2021-06-06
  • 2021-10-04
  • 2022-01-26
相关资源
相似解决方案