JCoder.Data.Cryptograph
2.1.1
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package JCoder.Data.Cryptograph --version 2.1.1
NuGet\Install-Package JCoder.Data.Cryptograph -Version 2.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="JCoder.Data.Cryptograph" Version="2.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add JCoder.Data.Cryptograph --version 2.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: JCoder.Data.Cryptograph, 2.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install JCoder.Data.Cryptograph as a Cake Addin
#addin nuget:?package=JCoder.Data.Cryptograph&version=2.1.1
// Install JCoder.Data.Cryptograph as a Cake Tool
#tool nuget:?package=JCoder.Data.Cryptograph&version=2.1.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
JCoder.Data.Cryptograph
| 属性 | | | --------------- | -------------------------------------------- | | 作者(Authors) | Jackie Law | | 版权(Copyright) | Copyright © Jackie Law. All rights reserved. | | 协议 | MIT | | 联系(QQ) | 1378071853 | | 联系(Wechat) | JackieLaw1024 | | 联系(Email) | JackieLaw-dev@outlook.com |
目录
[TOC]
一.架构说明
JCoder.Data.Cryptograph | |
---|---|
语言 | C# |
协议 | MIT |
.Net框架 | .Net Standard2.1; .Net Framework 4.7.2; .Net 7; .Net 6; |
简述 | A simple library for cryptograph.(一款简易的用于密文的扩展库。) |
1.1 引用类库
引用类库 | 版本 |
---|---|
- | - |
1.2 相关类库
| 相关类库 | 说明 | | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | | JCoder.Db4Net | 一款为方便使用数据库的操作类库。 | | JCoder.Db4Net.ORM | 一个基于JCoder.Db4Net的ORM库。 | | JCoder.Db4Net.Sqlite | 一个基于JCoder.Db4Net且支持Sqlite的库。 | | JCoder.Db4Net.MySql | 一个基于JCoder.Db4Net且支持Mysql的库。 | | JCoder.Db4Net.SqlServer | 一个基于JCoder.Db4Net且支持SqlServer的库 。 | | JCoder.Mock4Net | 一款简易版的用于模拟数据的功能库。 | | JCoder.Log4Net | 一款用于日志记录的类库。 | | JCoder.Log4Net.Sqlite | 一款使用Sqlite进行日志记录的类库。 | | JCoder.Ioc4Net | 一款简易款的Ioc操作类库。 | | JCoder.Extension | A simple library for C# extension.(一款简易的用于c#的扩展库。) |
获取方式
- 版本要求:>=2.0.1
- 以版本2.0.1为例
| 获取方式 | 描述 |
| ------------------ | -------------------------------------------- |
| Package Manager | Install-Package JCoder.Data.Cryptograph -Version 2.0.1
|
| .Net CLI | dotnet add package JCoder.Data.Cryptograph --version 2.0.1
|
| PackageReference | <PackageReference Include="JCoder.Data.Cryptograph" Version="2.0.1" />
|
| Paket CLI | paket add JCoder.Data.Cryptograph --version 2.0.1
|
| Script&Interactive | #r "nuget: JCoder.Data.Cryptograph, 2.0.1"
|
| Cake | // Install JCoder.Data.Cryptograph as a Cake Addin<br/>#addin nuget:?package=JCoder.Data.Cryptograph&version=2.0.1<br/><br/>// Install JCoder.Data.Cryptograph as a Cake Tool<br/>#tool nuget:?package=JCoder.Data.Cryptograph&version=2.0.1 |
三.使用说明
3.1 主要类与接口
名称 | 类型 | 描述 |
---|---|---|
RSACryptor | 类 | 用于文本进行非对称算法(RSA方式)的加解密。 |
MD5Cryptor | 类 | 用于文本进行哈希算法(MD5方式)的加密。 |
SHA1Cryptor | 类 | 用于文本进行哈希算法(SHA1方式)的加密。 |
SHA256Cryptor | 类 | 用于文本进行哈希算法(SHA256方式)的加密。 |
SHA384Cryptor | 类 | 用于文本进行哈希算法(SHA384方式)的加密。 |
SHA512Cryptor | 类 | 用于文本进行哈希算法(SHA512方式)的加密。 |
3.2 Hash哈希算法
Hash哈希算法-文本加密
// 操作类
new MD5Cryptor().Encrypt("Test data.");
new SHA1Cryptor().Encrypt("Test data.");
new SHA256Cryptor().Encrypt("Test data.");
new SHA384Cryptor().Encrypt("Test data.");
new SHA512Cryptor().Encrypt("Test data.");
//工具类
Cryption.EncryptByHash(HashCryptoType.MD5, "Test data.");
Cryption.EncryptByHash(HashCryptoType.SHA1, "Test data.");
Cryption.EncryptByHash(HashCryptoType.SHA256, "Test data.");
Cryption.EncryptByHash(HashCryptoType.SHA384, "Test data.");
Cryption.EncryptByHash(HashCryptoType.SHA512, "Test data.");
Hash哈希算法-byte[]加密
byte[] _bytes = Encoding.UTF8.GetBytes("Test data.");
// 操作类
new MD5Cryptor().Encrypt(_bytes);
new SHA1Cryptor().Encrypt(_bytes);
new SHA256Cryptor().Encrypt(_bytes);
new SHA384Cryptor().Encrypt(_bytes);
new SHA512Cryptor().Encrypt(_bytes);
//工具类
Cryption.EncryptByHash(HashCryptoType.MD5, _bytes);
Cryption.EncryptByHash(HashCryptoType.SHA1, _bytes);
Cryption.EncryptByHash(HashCryptoType.SHA256, _bytes);
Cryption.EncryptByHash(HashCryptoType.SHA384, _bytes);
Cryption.EncryptByHash(HashCryptoType.SHA512, _bytes);
3.3 非对称算法
非对称算法-文本加解密
// 操作类-加密
new RSACryptor().Encrypt("Test data.");
// 操作类-解密
new RSACryptor().Decrypt("Encrypt data.");
//工具类-加密
Cryption.CryptoByRSA(CryptoAction.ENCRYPT, "Public Key", "Test data.");
//工具类-解密
Cryption.CryptoByRSA(CryptoAction.DECRYPT, "Private Key", "Encrypt data.");
非对称算法-byte[]加解密
byte[] _bytes1 = Encoding.UTF8.GetBytes("Test data.");
byte[] _bytes2 = Convert.FromBase64String("Encrypt data.");
// 操作类-加密
new RSACryptor().Encrypt(_bytes1);
// 操作类-解密
new RSACryptor().Decrypt(_bytes2);
//工具类-加密
Cryption.CryptoBytesByRSA(CryptoAction.ENCRYPT, "Public Key", _bytes1);
//工具类-解密
Cryption.CryptoBytesByRSA(CryptoAction.DECRYPT, "Private Key", _bytes2);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
.NET Framework | net472 is compatible. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.7.2
- No dependencies.
-
.NETStandard 2.1
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Please contact Jackie by QQ 1378071853 or E-mail JackieLaw-dev@outlook.com;