• 大小: 0.06M
    文件类型: .zip
    金币: 2
    下载: 1 次
    发布日期: 2020-12-14
  • 语言: C#
  • 标签: .NET  Core  NET  RSA  

资源简介

C# RSA 公钥加密,私钥解密,与大家分享,开发工具是VS2017

请先输入要加密的内容,然后回车即可看到如下效果

资源截图

代码片段和文件信息

using System;
using System.IO;
using System.Security.Cryptography;
using System.Text;

namespace ConsoleApp2
{
    class Program
    { 
        static void Main(string[] args)
        {
            while (true)
            {
                var input = Console.ReadLine();
                #region MyRegion

                #endregion
                ///公钥
                string sql = @“MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwNqreCMpgET1BEA/kPZA
                            eaj+xfG2UWTHOkTyV+28AC0BYxQDfKq7HV1RDaLHR5GBIKC1OK+m5thEBVJg27O8
                            uUp95O88McR17mFw9UVQ5w3Zn9ChK93GzmB1ltob3Sm847YW18KyoxDbqbh6MlRy
                            6yt5v/MDpbbs5lEcwME9YmgGVvayfWDMquFqHnX05pEoE05uvAyDj1UtT7ZlMn6T
                            mOzTLpfoGnkADoyB3Lr

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-04-20 11:17  ConsoleApp2\
     目录           0  2018-04-19 11:47  ConsoleApp2\bin\
     目录           0  2018-04-19 11:47  ConsoleApp2\bin\Debug\
     目录           0  2018-04-20 11:17  ConsoleApp2\bin\Debug\netcoreapp2.0\
     文件        1280  2018-04-19 17:34  ConsoleApp2\bin\Debug\netcoreapp2.0\1.txt
     文件         465  2018-04-20 10:57  ConsoleApp2\bin\Debug\netcoreapp2.0\ConsoleApp2.deps.json
     文件       14336  2018-04-20 10:57  ConsoleApp2\bin\Debug\netcoreapp2.0\ConsoleApp2.dll
     文件        3040  2018-04-20 10:57  ConsoleApp2\bin\Debug\netcoreapp2.0\ConsoleApp2.pdb
     文件         325  2018-04-20 10:57  ConsoleApp2\bin\Debug\netcoreapp2.0\ConsoleApp2.runtimeconfig.dev.json
     文件         154  2018-04-20 10:57  ConsoleApp2\bin\Debug\netcoreapp2.0\ConsoleApp2.runtimeconfig.json
     文件         477  2018-04-20 11:17  ConsoleApp2\bin\Debug\netcoreapp2.0\RSA加密解密.deps.json
     文件       11776  2018-04-20 11:17  ConsoleApp2\bin\Debug\netcoreapp2.0\RSA加密解密.dll
     文件        1884  2018-04-20 11:17  ConsoleApp2\bin\Debug\netcoreapp2.0\RSA加密解密.pdb
     文件         325  2018-04-20 11:17  ConsoleApp2\bin\Debug\netcoreapp2.0\RSA加密解密.runtimeconfig.dev.json
     文件         154  2018-04-20 11:17  ConsoleApp2\bin\Debug\netcoreapp2.0\RSA加密解密.runtimeconfig.json
     目录           0  2018-04-20 11:17  ConsoleApp2\obj\
     文件         149  2018-04-20 10:56  ConsoleApp2\obj\ConsoleApp2.csproj.nuget.cache
     文件        1665  2018-04-19 11:47  ConsoleApp2\obj\ConsoleApp2.csproj.nuget.g.props
     文件         923  2018-04-19 11:47  ConsoleApp2\obj\ConsoleApp2.csproj.nuget.g.targets
     目录           0  2018-04-19 11:47  ConsoleApp2\obj\Debug\
     目录           0  2018-04-20 11:17  ConsoleApp2\obj\Debug\netcoreapp2.0\
     文件        1016  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\ConsoleApp2.AssemblyInfo.cs
     文件          42  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\ConsoleApp2.AssemblyInfoInputs.cache
     文件          42  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\ConsoleApp2.csproj.CoreCompileInputs.cache
     文件        1150  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\ConsoleApp2.csproj.FileListAbsolute.txt
     文件       14336  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\ConsoleApp2.dll
     文件        3040  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\ConsoleApp2.pdb
     文件        1028  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\RSA加密解密.AssemblyInfo.cs
     文件          42  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\RSA加密解密.AssemblyInfoInputs.cache
     文件          42  2018-04-20 10:57  ConsoleApp2\obj\Debug\netcoreapp2.0\RSA加密解密.csproj.CoreCompileInputs.cache
     文件        1332  2018-04-20 11:17  ConsoleApp2\obj\Debug\netcoreapp2.0\RSA加密解密.csproj.FileListAbsolute.txt
............此处省略10个文件信息

评论

共有 条评论