NaCl.Core 2.0.4

.NET 5.0 .NET Core 3.1 .NET Standard 1.6 .NET Framework 4.5
This package has a SemVer 2.0.0 package version: 2.0.4+build.81.
dotnet add package NaCl.Core --version 2.0.4
NuGet\Install-Package NaCl.Core -Version 2.0.4
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="NaCl.Core" Version="2.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NaCl.Core --version 2.0.4
#r "nuget: NaCl.Core, 2.0.4"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install NaCl.Core as a Cake Addin
#addin nuget:?package=NaCl.Core&version=2.0.4

// Install NaCl.Core as a Cake Tool
#tool nuget:?package=NaCl.Core&version=2.0.4

NaCl.Core, a cryptography library for .NET

Build Status CI Build status Build Status contributions welcome


NaCl.Core is a managed-only cryptography library for .NET which provides modern cryptographic primitives.

Currently supported:
Crypto Description
ChaCha20 A high-speed stream cipher based on Salsa20
XChaCha20 Based on ChaCha20 IETF with extended nonce (192-bit instead of 96-bit)
Poly1305 A state-of-the-art secret-key message-authentication code (MAC) based on RFC8439
ChaCha20Poly1305 An Authenticated Encryption with Associated Data (AEAD) algorithm; IETF variant as defined in RFC8439 and in its predecessor RFC7539
XChaCha20Poly1305 A variant of ChaCha20-Poly1305 that utilizes the XChaCha20 construction in place of ChaCha20; as defined in the RFC Draft


NuGet CI NuGet

Install the NaCl.Core NuGet package from the .NET Core CLI using:

dotnet add package NaCl.Core

or from the NuGet package manager:

Install-Package NaCl.Core

Or alternatively, you can add the NaCl.Core package from within Visual Studio's NuGet package manager.

Daily NuGet builds of the project are also available in the Azure Artifacts feed:


Symmetric Key Encryption
// Create the primitive
var aead = new ChaCha20Poly1305(key);

// Use the primitive to encrypt a plaintext
aead.Encrypt(nonce, plaintext, ciphertext, tag, aad);

// ... or to decrypt a ciphertext
aead.Decrypt(nonce, ciphertext, tag, plaintext, aad);
MAC (Message Authentication Code)
// Use the primitive to compute a tag
Poly1305.ComputeMac(key, data, tag);

// ... or to verify a tag
Poly1305.VerifyMac(key, data, tag);

Test Coverage

Azure DevOps tests Azure DevOps coverage

  • Includes the mandatory RFC test vectors.
  • Project Wycheproof by members of Google Security Team, for testing against known attacks (when applicable).

Learn More


Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp1.0 netcoreapp1.1 netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard1.6 netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48 net481
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen30 tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on NaCl.Core:

Package Downloads

A Paseto (Platform-Agnostic Security Tokens) implementation for .NET


A .NET 6 library for generating and validating Branca tokens.


.NET support for Branca tokens using APIs from Microsoft.IdentityModel.Tokens.


Library implementation of the lightning protocol.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on NaCl.Core:

Repository Stars
An instruction trace visualisation tool for dynamic program analysis
Version Downloads Last updated
2.0.4 44,048 4/6/2022
2.0.3 71 4/6/2022
2.0.2 13,639 11/22/2020
2.0.1 244 11/1/2020
2.0.0 291 9/28/2020
1.2.0 122,777 2/5/2019
1.1.0 2,462 11/27/2018
1.0.3 643 11/26/2018
1.0.2 565 11/19/2018
1.0.1 3,047 6/1/2018