public MainWindow()
{ InitializeComponent();
Title = getUUID();
string s= httpGet("http://220.181.57.216/");
//MessageBox.Show(s);
MessageBox.Show( CheckSum("2019-9-10"));
string sEncode=encode("0;2018-12-30");
string sDecode=decode(sEncode );
Title = sEncode +"-------"+ sDecode ; } int tabIndex = 0; string getUUID()
{
string code = null;
SelectQuery query = new SelectQuery("select * from Win32_ComputerSystemProduct");
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(query))
{ // MessageBox.Show(searcher.Get().Count.ToString());
foreach (var item in searcher.Get() )
{
using (item) code = item["UUID"].ToString(); }
}
return code; } public static string encode(string str)
{
string htext = ""; for (int i = 0; i < str.Length; i++)
{
htext = htext + (char)(str[i] + 22 );
}
return htext;
} public static string decode(string str)
{
string dtext = ""; for (int i = 0; i < str.Length; i++)
{
dtext = dtext + (char)(str[i] - 22 );
}
return dtext;
} private static string CheckSum(string message)
{
char[] chars = message.ToCharArray();
int checksum = 0;
for (int i = 0; i < chars.Length; i++)
{
checksum += (int)chars[i];
}
// checksum = (~checksum & 0xFFFF) + 0x0001;
//return Convert.ToString(checksum, 16).ToUpper();
return Convert.ToString(checksum, 10).ToUpper().PadLeft(5,'0');
}

  

C# Test Encryption and Decryption的更多相关文章

  1. Expanded encryption and decryption signature algorithm SM2 & SM3

    Expanded encryption and decryption signature algorithm supports multiple signature digest algorithms ...

  2. JAVA常用加密解密算法Encryption and decryption

    加密,是以某种特殊的算法改变原有的信息数据,使得未授权的用户即使获得了已加密的信息,但因不知解密的方法,仍然无法了解信息的内容.大体上分为双向加密和单向加密,而双向加密又分为对称加密和非对称加密(有些 ...

  3. Encryption and decryption、Steganography、Decryption Tools

    catalogue . 隐写术 . Substitution cipher . Transposition cipher . Bacon's cipher . LSB-Steganography 1. ...

  4. TDE: Transparent Data Encryption brief introduction

    1. What is TDE? Briefly speaking, TDE is used to encrypted data. 2. The benifits: Belows are come fr ...

  5. javascript 实现des解密加密

    //Paul Tero, July 2001 //http://www.tero.co.uk/des/ // //Optimised for performance with large blocks ...

  6. aes加密C语言

    /** * \file aes.h * * \brief AES block cipher * * Copyright (C) 2006-2010, Brainspark B.V. * * This ...

  7. [Java 实现AES加密解密]

    今天同学请教我这个问题,被坑了次…… 实现的功能是2个Java类:一个读取源文件生成加密文件,另一个类读取加密文件来解密. 整个过程其实很简单,java有AES的工具包,设好秘钥,设好输入内容,就得到 ...

  8. .net Framework Class Library(FCL)

    from:http://msdn.microsoft.com/en-us/library/ms229335.aspx 我们平时在VS.net里引用的那些类库就是从这里来的 The .NET Frame ...

  9. AESwithJCE http://www.coderanch.com/how-to/content/AES_v1.html

    Using AES with Java Technology By Rags SrinivasJune 2003 In September 2000, the National Institute o ...

随机推荐

  1. Microsoft MVP MSDN Magazine 最新期分享

    下载地址:http://1105insight.com/portal/wts/uemcmQeeDyaq%5Ev2gAe6c3b0Djd 可在线或下载查看

  2. 为何SQL SERVER使用sa账号登录还原数据库BAK文件失败,但是使用windows登录就可以

    今天发现一个问题,就是公司开发服务器上的sql server使用sa账号登录后,还原一个数据库bak文件老是报错,错误如下: TITLE: Microsoft SQL Server Managemen ...

  3. "添加"模态框中某些数据不被清空

    描述:一般情况下,“添加”的模态框弹出够,其中的输入框等为空,若是此中有某些数据是取自其他页面,不应被清空的,我们应当在html中添加以下内容.   解决方案:在form标签中添加“ preserve ...

  4. 插入算法---java实现

    插入排序java代码实现 package algorithms.插入排序; import java.io.BufferedReader; import java.io.InputStreamReade ...

  5. 【转】Linxu学习---top实践

    [原文]https://www.toutiao.com/i6591053058258502147/ 在实际开发中,有时候会收到一些服务的监控报警,比如CPU飙高,内存飙高等,这个时候,我们会登录到服务 ...

  6. ArcMap 导入Excel坐标数据

    1  准备Excel坐标数据集合 2  ArcMap加入Excel数据 将excel文件放入arcmap工作区的物理路径下 在工作区的根图层上点键,选择添加数据,找到excel文件并选择相应的工作薄 ...

  7. 洛谷 P4707 【重返现世】

    题目分析 题目就是求第K种原料的出现期望时间. 考虑广义min-max容斥. \(\text{kthmax}(S)=\sum\limits_{T\subseteq S}(-1)^{|T|-k}\bin ...

  8. Android Studio中新建和引用assets文件

    从eclipse转过的朋友们应该不太习惯AS中新建assets文件和对文件内容的引用.我也查找了网上很多资料发现很少有这样的解决答案,于是便把自己解决的方法总结在这里. 1.一般新建project后这 ...

  9. 有意思的flex 色子布局

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  10. C++的技术探究

    C++深究 函数指针 double pam(int, double); // prototype double (*pf)(int, double); // declare function poin ...