LibChaCha20 1.1.0
dotnet add package LibChaCha20 --version 1.1.0
NuGet\Install-Package LibChaCha20 -Version 1.1.0
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="LibChaCha20" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LibChaCha20 --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: LibChaCha20, 1.1.0"
#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 LibChaCha20 as a Cake Addin #addin nuget:?package=LibChaCha20&version=1.1.0 // Install LibChaCha20 as a Cake Tool #tool nuget:?package=LibChaCha20&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
CSharp-ChaCha20-NetStandard
Managed .Net (.NET 8) compatible ChaCha20 cipher written in C#
Documentation
How do I use this?
using CSChaCha20;
byte[] mySimpleTextAsBytes = Encoding.ASCII.GetBytes("Plain text I want to encrypt");
// Do NOT use these key and nonce values in your own code!
byte[] key = new byte[32] { 142, 26, 14, 68, 43, 188, 234, 12, 73, 246, 252, 111, 8, 227, 57, 22, 168, 140, 41, 18, 91, 76, 181, 239, 95, 182, 248, 44, 165, 98, 34, 12 };
byte[] nonce = new byte[12] { 139, 164, 65, 213, 125, 108, 159, 118, 252, 180, 33, 88 };
uint counter = 1;
// Encrypt
ChaCha20 forEncrypting = new ChaCha20(key, nonce, counter);
byte[] encryptedContent = new byte[mySimpleTextAsBytes.Length];
forEncrypting.EncryptBytes(encryptedContent, mySimpleTextAsBytes);
// Decrypt
ChaCha20 forDecrypting = new ChaCha20(key, nonce, counter);
byte[] decryptedContent = new byte[encryptedContent.Length];
forDecrypting.DecryptBytes(decryptedContent, encryptedContent);
You can try out the code in .NET Fiddle
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on LibChaCha20:
Package | Downloads |
---|---|
NNostr.Client
A client for Nostr |
|
LibCommonSecrets
.Net Standard 2.0 compatible managed CommonSecrets library implementation in C# |
|
NostraLib
Nostr library for F# |
GitHub repositories (1)
Showing the top 1 popular GitHub repositories that depend on LibChaCha20:
Repository | Stars |
---|---|
Kukks/NNostr
A Nostr Relay and Client written in C#
|