LibChaCha20 1.1.2
dotnet add package LibChaCha20 --version 1.1.2
NuGet\Install-Package LibChaCha20 -Version 1.1.2
<PackageReference Include="LibChaCha20" Version="1.1.2" />
<PackageVersion Include="LibChaCha20" Version="1.1.2" />
<PackageReference Include="LibChaCha20" />
paket add LibChaCha20 --version 1.1.2
#r "nuget: LibChaCha20, 1.1.2"
#:package LibChaCha20@1.1.2
#addin nuget:?package=LibChaCha20&version=1.1.2
#tool nuget:?package=LibChaCha20&version=1.1.2
CSharp-ChaCha20-NetStandard
Managed .Net (.NET 8 and .NET 10) 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. net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
-
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 10 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#
|
## Version 1.1.2 (released 2026-06-30)
- Enable `Nullable` (**FEATURE**/**BREAKING**)
## Version 1.1.1 (released 2025-11-13)
- Support net10.0
## Version 1.1.0 (released 2024-12-06)
- Drop support for .NET Standard and .NET 6 (**BREAKING**)
- SIMD support for XOR operation (**PERFORMANCE**)
## Version 1.0.1 (released 2023-11-16)
- Include nuget-readme
- Support net8.0
- Trimmable library
## Version 1.0.0 (released 2022-05-21)
- Support net6.0
- Deterministic build
## Version 0.9.5 (released 2021-01-09)
- WorkStreams optimization, thanks to **Akintos** (**PERFORMANCE**)
## Version 0.9.4 (released 2020-05-16)
- Add wanted bytes at time parameter for stream encryption/decryption (**FEATURE**)
- Add async versions of stream processing (**FEATURE**)
## Version 0.9.3 (released 2020-05-09)
- Support stream encryption/decryption (**FEATURE**)
## Version 0.9.2 (released 2020-01-12)
- Generate documentation (**FEATURE**)
## Version 0.9.1 (released 2018-11-18)
- More overloads for encrypt/decrypt (no need to pass lengths of arrays anymore)
- One method to handle strings (as UTF-8 byte array)
## Version 0.9.0 (released 2018-11-14)
- Initial Nuget release
- Just one encrypt and decrypt method