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. css3的calc()属性

    1.calc()是css3的一个新增的功能,用来指定元素的长度,你可以使用calc()给元素的border.margin.pading.font-size和width等属性动态的设置值. 2.calc ...

  2. SQLite 数据库增删改查

    布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android= ...

  3. UWP开发细节记录:IStream 和 IRandomAccessStream^ 以及 IMFByteStream 互转

    IStream 和 IRandomAccessStream^ 互转 IRandomAccessStream^ --> IStream:  CreateStreamOverRandomAccess ...

  4. react单页面应用的Nginx配置问题

    项目中多数使用react单页面开发,路由使用react-router的browser-router,这样页面访问路径看起来像是真实的,如http://xx.xxx.xxx/a/b.但当项目访问路径为多 ...

  5. 【three.js练习程序】旋转物体自身

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...

  6. python基础学习18----面向对象简述

    这里就不再讲面向对象的相关概念知识或者与面向过程的比较了,直接进入类的学习 1.类的创建 class people: def __init__(self):#构造函数 pass sfencs=peop ...

  7. English Phonetic Spelling Alphabet

    https://www.englishclub.com/vocabulary/english-phonetic-spelling.htm When speaking on the telephone ...

  8. Java 基本数据类型 && 位运算

    1. Java基本数据类型 1.1 数据类型示意图 类型 字节数 范围 byte 1 -128~127 short 2 -32768~32767 int 4 -231~231-1 long 8 -26 ...

  9. Windows API串口编程详解

    (一)Windows API串口通信编程概述 Windows环境下的串口编程与DOS环境下的串口编程有很大不同.Windows环境下的编程的最大特征之一就是设备无关性,它通过设备驱动程序将Window ...

  10. from urllib.request import urlopen

    from urllib.request impor urlopen      (负责打开浏览url内的html 文本) re.compile(r'alex(?P<name>\d+)and' ...