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. Java 接口和抽象类区别(写的很好,转了)

    原文:http://blog.csdn.net/sunboard/article/details/3831823 1.概述 一个软件设计的好坏,我想很大程度上取决于它的整体架构,而这个整体架构其实就是 ...

  2. css设计并排布局

    css code form#reset_password ul { list-style: none; margin: 0 0 20px 200px; padding:; } form#reset_p ...

  3. matlab练习程序(单层感知器)

    clear all; close all; clc; %生成两组已标记数据 randn(); mu1=[ ]; S1=[ ; ; 0.4]; P1=mvnrnd(mu1,S1,); mu2=[ ]; ...

  4. python新生类和经典类简单说明

    经典类: #!/usr/bin/env python #*-* coding:utf-8 *-* class A(): def __init__(self): print 'my name is GF ...

  5. 【Git】从服务器搭建到提交分支使用——初学者轻松上手篇

    GitHub就是一个免费托管开源代码的远程仓库,个人可以把代码寄存处上面,不过会被公开.对于商业公司来说在Linux上搭建一台Git服务器作为私有仓库使用.开发人员在本地下载仓库代码,协同开发.本篇介 ...

  6. 转:asp.net mvc下的多语言方案 包含Html,Javascript和图片

    可以不使用微软的Resource文件,而是将所有的词汇放入在一个txt的词典之中,便于维护. 步骤如下: 1)在整个程序的入口处global.asax.cs加入函数 private void Read ...

  7. Unity By Reflection Update Scripts

    App热更新需求 我正在使用Unity 3D开发一个Android的应用,它会下载AssetBundles并加载它们的内容,但由于AssetBundles不能包含脚本,我将使用预编译的C#脚本,并使用 ...

  8. 微信小程序审核 出现85085 提交审核数量过多问题

    前段时间发布了一个新版本小程序(错误代码:85085,说明:submit audit reach limit, please try later hint: [OKYBha04570729]),由于我 ...

  9. Sr Software Engineer - Big Data Team

    Sr Software Engineer - Big Data Team   About UberWe’re changing the way people think about transport ...

  10. python图像处理:pytesseract和PIL

    大概介绍下相关模块的概念: Python-tesseract 是光学字符识别Tesseract OCR引擎的Python封装类.能够读取任何常规的图片文件(JPG, GIF ,PNG , TIFF等) ...