micrypt 0.0.0.7

dotnet add package micrypt --version 0.0.0.7
                    
NuGet\Install-Package micrypt -Version 0.0.0.7
                    
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="micrypt" Version="0.0.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="micrypt" Version="0.0.0.7" />
                    
Directory.Packages.props
<PackageReference Include="micrypt" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add micrypt --version 0.0.0.7
                    
#r "nuget: micrypt, 0.0.0.7"
                    
#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.
#:package micrypt@0.0.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=micrypt&version=0.0.0.7
                    
Install as a Cake Addin
#tool nuget:?package=micrypt&version=0.0.0.7
                    
Install as a Cake Tool

micrypt

专注于数据加密,让数据加密变得更灵活、便捷。

密码 正确使用方式: 存储密码 = 加密方法(核心密码 + 随机内容)。

示例

var scipher = new ChaCha20();
scipher.Init("test");
Console.Write(scipher.NowHexText);

1. 流加密

实现 ZUC、RC4 、ChaCha20算法。
加密方式: 流 ⊕ 密钥流

using (var fs = File.Open("test", FileMode.Open, FileAccess.ReadWrite))
    FastStream.Ciphering<RC4>(fs, "123" +random);

! 推荐先压缩在加密

2. 非对称加密

2.1 大素数分解难题(RSA)
var rsa = new RSA(768) .Generate();
var public_rsa = new RSA(768).LoadPublic(rsa.GetPublicKey());
var private_rsa = new RSA(768).LoadPrivate(rsa.GetPrivateKey());

var x = public_rsa.Encrypt(SuInt.New("123321"));
var y = private_rsa.Decrypt(x);
2.2 椭圆曲线离散对数难题(ECC)
var ecc = ECC.Use_brainpoolp192r1().Generate();
var sk = ecc.GetPrivateKey();
var pk = ecc.GetPublicKey();
Console.WriteLine("ECC 私钥: " + sk);
Console.WriteLine("ECC 公钥: " + pk);

ecc.LoadPublic(pk.ToString());
var a = ecc.Encrypt(TEXT.Hello);
Console.WriteLine("ECC 密文: " + a.ToString());
ecc.LoadPrivate(sk.ToString());
Console.WriteLine("ECC 明文: " + ecc.Decrypt(a));
2.2.1 SM2
var sm2 = new SM2().Generate();
var m = sm2.Encrypt(TEXT.Hello);
if (TEXT.Hello == sm2.Decrypt(m)) Console.WriteLine("Test[SM2]:  PASS");
2.3 整数有限域上的离散对数难题(DSA)
var dsa = new DSA(1024, 160);
dsa.Generate();
var pk = dsa.GetPublicKey().ToString();
var sk = dsa.GetPrivateKey().ToString();
var hash = FastHash.GetMD5Bytes(TEXT.Hello);
var sign = new DSA(1024, 160).LoadPrivate(sk).Sign(hash);
var verity_state = new DSA(1024, 160).LoadPublic(pk).VeritySign(sign, hash);

附加

1. 通用接口
1.1 流加密 IStreamCipher
1.2 非对称密码 IAsymmetricCipher
1.3 数字加密 IDigitalCipher
1.4 数字签名 IDigitalSignature
2. 消息验证 webhook sign for gitee
Console.WriteLine(FastMsgAuth.WebHookSign_Gitee("1764051189585", "123456") == "dhVvK7SAXrPi3HejRvwfFP/XzdN5DVBRz7bPA4WziWM=" ? "PASS": "FAIL");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net20 is compatible.  net35 was computed.  net40 was computed.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  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 2.0

  • .NETStandard 2.0

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.0.7 107 1/28/2026
0.0.0.6 105 1/27/2026
0.0.0.5 104 1/20/2026
0.0.0.4 113 1/7/2026
0.0.0.3 195 12/5/2025
0.0.0.2 674 12/3/2025