• 大小: 200KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-10
  • 语言: 其他
  • 标签: rsa  

资源简介

RSA公钥加密私钥解密,私钥加密公钥解密。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Security.Cryptography;
using ClassLibrary1;

namespace WindowsFormsApplication1
{
    //应用程序注册模块
    public partial class Form1 : Form
    {
       
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            string cpu = RSAHelper.GetCpuID();
            string _申请码C = RSAHelper.Encodebase64(“utf-8“ cpu);
            textEdit申请码.Text = _申请码C;
        }

        private void simpleButton注册_Click(object sender EventArgs e)
        {
            string publicKeyPath = @“C://PublicKey.xml“;
            RSAParameters pm = RSAHelper.ReadKey(false publicKeyPath);

            string _PublicKey = RSAHelper.ComponentKey(pm.Exponent pm.Modulus);

            string cpu = RSAHelper.DecryptString(textEdit激活码.Text _PublicKey);
            if (cpu == textEdit申请码.Text)
            {
                MessageBox.Show(“注册成功“);
            }
            else
            {
                MessageBox.Show(“注册失败“);
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     70144  2013-07-27 20:22  WindowsFormsApplication1.suo

     文件      38912  2013-07-27 20:06  bin\Debug\ClassLibrary1.dll

     文件     103936  2013-07-27 20:06  bin\Debug\ClassLibrary1.pdb

     文件      15360  2013-07-27 20:06  bin\Debug\WindowsFormsApplication1.exe

     文件      38400  2013-07-27 20:06  bin\Debug\WindowsFormsApplication1.pdb

     文件      11600  2013-07-27 20:20  bin\Debug\WindowsFormsApplication1.vshost.exe

     文件     110499  2013-07-27 17:56  ClassLibrary1\BigInteger.cs

     文件      38912  2013-07-27 20:06  ClassLibrary1\bin\Debug\ClassLibrary1.dll

     文件     103936  2013-07-27 20:06  ClassLibrary1\bin\Debug\ClassLibrary1.pdb

     文件       2452  2013-07-27 20:09  ClassLibrary1\ClassLibrary1.csproj

     文件        758  2013-07-27 17:56  ClassLibrary1\obj\Debug\ClassLibrary1.csproj.FileListAbsolute.txt

     文件      38912  2013-07-27 20:06  ClassLibrary1\obj\Debug\ClassLibrary1.dll

     文件     103936  2013-07-27 20:06  ClassLibrary1\obj\Debug\ClassLibrary1.pdb

     文件       5877  2013-07-27 20:08  ClassLibrary1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       1382  2013-07-27 16:47  ClassLibrary1\Properties\AssemblyInfo.cs

     文件      13809  2013-07-27 20:09  ClassLibrary1\RSAEncryptHelper.cs

     文件      14568  2013-07-27 20:06  ClassLibrary1\RSAHelper.cs

     文件       2152  2013-07-24 21:58  obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache

     文件       7107  2013-07-27 20:08  obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件        508  2013-07-27 19:56  obj\x86\Debug\GenerateResource.read.1.tlog

     文件       1804  2013-07-27 19:56  obj\x86\Debug\GenerateResource.write.1.tlog

     文件       1654  2013-07-27 20:20  obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt

     文件      15360  2013-07-27 20:06  obj\x86\Debug\WindowsFormsApplication1.exe

     文件        180  2013-07-27 19:56  obj\x86\Debug\WindowsFormsApplication1.Form1.resources

     文件      38400  2013-07-27 20:06  obj\x86\Debug\WindowsFormsApplication1.pdb

     文件        180  2013-07-27 17:57  obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources

     文件       1404  2013-07-24 21:57  Properties\AssemblyInfo.cs

     文件       2896  2013-07-24 21:57  Properties\Resources.Designer.cs

     文件       5612  2013-07-24 21:57  Properties\Resources.resx

     文件       1107  2013-07-24 21:57  Properties\Settings.Designer.cs

............此处省略26个文件信息

评论

共有 条评论