All Projects → stulzq → Rsautil

stulzq / Rsautil

Licence: mit
.NET Core RSA algorithm using the help tool.It supports data encryption, decryption, signature and verification signature.It supports three key formats, namely: xml, pkcs1, pkcs8.It also supports key conversion for these three formats.Last also support pem formatting.

Projects that are alternatives of or similar to Rsautil

Dotnet Env
A .NET library to load environment variables from .env files
Stars: ✭ 195 (-10.55%)
Mutual labels:  dotnet-core
Westwind.utilities
A general purpose utility and helper library for .NET development
Stars: ✭ 202 (-7.34%)
Mutual labels:  dotnet-core
Json Flatfile Datastore
Simple JSON flat file data store with support for typed and dynamic data.
Stars: ✭ 212 (-2.75%)
Mutual labels:  dotnet-core
Sharprompt
Interactive command line interface toolkit for C#
Stars: ✭ 197 (-9.63%)
Mutual labels:  dotnet-core
Encrypt
🔒 A set of high-level APIs over PointyCastle for two-way cryptography.
Stars: ✭ 199 (-8.72%)
Mutual labels:  rsa
Auth Jwt
A demo to learn JWT by reverse engineering
Stars: ✭ 208 (-4.59%)
Mutual labels:  rsa
Fsh
F# Shell with integrated F# scripting. Like Bash or Powershell, but better 'cause F#.
Stars: ✭ 195 (-10.55%)
Mutual labels:  dotnet-core
Sharpyaml
SharpYaml is a .NET library for YAML compatible with CoreCLR
Stars: ✭ 217 (-0.46%)
Mutual labels:  dotnet-core
Blazorrepl
Write, compile, execute and share Blazor components entirely in the browser
Stars: ✭ 196 (-10.09%)
Mutual labels:  dotnet-core
Pixieditor
PixiEditor is a lightweight pixel art editor made with .NET 5
Stars: ✭ 210 (-3.67%)
Mutual labels:  dotnet-core
Awesome Wpf
A collection of awesome WPF resources, libraries and UI controls.
Stars: ✭ 196 (-10.09%)
Mutual labels:  dotnet-core
Covenant
Covenant is a collaborative .NET C2 framework for red teamers.
Stars: ✭ 2,747 (+1160.09%)
Mutual labels:  dotnet-core
Easy.messagehub
No need for .NET Events! A thread-safe, high performance & easy to use cross platform implementation of the Event Aggregator Pattern.
Stars: ✭ 208 (-4.59%)
Mutual labels:  dotnet-core
Bridge
♠️ C# to JavaScript compiler. Write modern mobile and web apps in C#. Run anywhere with Bridge.NET.
Stars: ✭ 2,216 (+916.51%)
Mutual labels:  dotnet-core
Hagar
Fast, flexible, and version-tolerant serializer for .NET
Stars: ✭ 216 (-0.92%)
Mutual labels:  dotnet-core
Miniscaffold
F# Template for creating and publishing libraries targeting .NET 5.0 `net5.0` or console apps .NET 5.0 `net5.0`.
Stars: ✭ 193 (-11.47%)
Mutual labels:  dotnet-core
Libgit2sharp
Git + .NET/Mono = ❤
Stars: ✭ 2,469 (+1032.57%)
Mutual labels:  dotnet-core
Nsec
A modern and easy-to-use cryptographic library for .NET Core based on libsodium
Stars: ✭ 217 (-0.46%)
Mutual labels:  dotnet-core
Entityframework Extensions
Entity Framework Bulk Operations | Improve Entity Framework performance with Bulk SaveChanges, Insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL and SQLite.
Stars: ✭ 215 (-1.38%)
Mutual labels:  dotnet-core
Dntframeworkcore
Lightweight and Extensible Infrastructure for Building Web Applications - Web Application Framework
Stars: ✭ 208 (-4.59%)
Mutual labels:  dotnet-core

RSAUtil 中文文档

Build Status

.NET Core RSA algorithm using the help tool.It supports data encryption, decryption, signature and verification signature.It supports three key formats, namely: xml, pkcs1, pkcs8.It also supports key conversion for these three formats.Last also support pem formatting.

Thanks for onovotny's bc-csharp

Latest version

Install

Install-Package XC.RSAUtil

The old package name is XC.Framework.Security.RSAUtil. Now renamed XC.RSAUtil and will continue to use.

Doc

Generate the key

Use class RsaKeyGenerator.The result returned is a list of two-element strings,Element 1 is the private key and element 2 is the public key.

Format: XML

var keyList = RsaKeyGenerator.XmlKey(2048);
var privateKey = keyList[0];
var publicKey = keyList[1];

Format: Pkcs1

var keyList = RsaKeyGenerator.Pkcs1Key(2048);
var privateKey = keyList[0];
var publicKey = keyList[1];

Format: Pkcs8

var keyList = RsaKeyGenerator.Pkcs8Key(2048);
var privateKey = keyList[0];
var publicKey = keyList[1];

RSA key conversion

Use class RsaKeyConvert.It supports key conversion for these three formats,namely: xml, pkcs1, pkcs8.

XML->Pkcs1:
  • Private Key : RsaKeyConvert.PrivateKeyXmlToPkcs1()
  • Public Key : RsaKeyConvert.PublicKeyXmlToPem()
XML->Pkcs8:
  • Private Key : RsaKeyConvert.PrivateKeyXmlToPkcs8()
  • Public Key : RsaKeyConvert.PublicKeyXmlToPem()
Pkcs1->XML:
  • Private Key : RsaKeyConvert.PrivateKeyPkcs1ToXml()
  • Public Key : RsaKeyConvert.PublicKeyPemToXml()
Pkcs1->Pkcs8:
  • Private Key : RsaKeyConvert.PrivateKeyPkcs1ToPkcs8()
  • Public Key : No conversion required
Pkcs8->XML:
  • Private Key : RsaKeyConvert.PrivateKeyPkcs8ToXml()
  • Public Key : RsaKeyConvert.PublicKeyPemToXml()
Pkcs8->Pkcs1:
  • Private Key : RsaKeyConvert.PrivateKeyPkcs8ToPkcs1()
  • Public Key : No conversion required

Encrypt, decrypt, sign, and verify signatures

XML, Pkcs1, Pkcs8 respectively corresponding categories: RsaXmlUtil, RsaPkcs1Util, RsaPkcs8Util.They inherit from the abstract class RSAUtilBase

  • Encrypt: RSAUtilBase.Encrypt()
  • Decrypt: RSAUtilBase.Decrypt()
  • Sign: RSAUtilBase.SignData()
  • Verify: RSAUtilBase.VerifyData()

PEM formatting

Use class RsaPemFormatHelper.

  • Format Pkcs1 format private key: RsaPemFormatHelper.Pkcs1PrivateKeyFormat()

  • Remove the Pkcs1 format private key format: RsaPemFormatHelper.Pkcs1PrivateKeyFormatRemove()

  • Format Pkcs8 format private key: RsaPemFormatHelper.Pkcs8PrivateKeyFormat()

  • Remove the Pkcs8 format private key format: RsaPemFormatHelper.Pkcs8PrivateKeyFormatRemove()

Reference component

bc-csharp - onovotny

Cases

dotnetrsa - DotnetRSA is a .NET Core Global Tool.Dotnet RSA Tool can help you generate xml pkcs1, pkcs8 three kinds of format keys, and supports three types of mutual conversion.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].