SecurityHelperLibrary 2.1.2
.NET 8.0
This package targets .NET 8.0. The package is compatible with this framework or higher.
.NET Framework 4.8.1
This package targets .NET Framework 4.8.1. The package is compatible with this framework or higher.
dotnet add package SecurityHelperLibrary --version 2.1.2
NuGet\Install-Package SecurityHelperLibrary -Version 2.1.2
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="SecurityHelperLibrary" Version="2.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SecurityHelperLibrary" Version="2.1.2" />
<PackageReference Include="SecurityHelperLibrary" />
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 SecurityHelperLibrary --version 2.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: SecurityHelperLibrary, 2.1.2"
#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 SecurityHelperLibrary@2.1.2
#: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=SecurityHelperLibrary&version=2.1.2
#tool nuget:?package=SecurityHelperLibrary&version=2.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
SecurityHelperLibrary v2.1.2
SecurityHelperLibrary is a production-grade cryptographic helper library for password hashing, message authentication, and authenticated encryption.
Targets:
net481net8.0
Highlights
- PBKDF2 with strong defaults and formatted storage payload support.
- Argon2id support with security guardrails (minimums + bounded parallelism).
- AES-GCM encrypt/decrypt APIs on modern targets.
- Fixed-time hash verification behavior to reduce timing leakage.
- Sensitive-buffer cleanup helpers for
byte[]andSpan<char>. - Generic external cryptographic error model with optional internal incident-code logging.
Install
dotnet add package SecurityHelperLibrary --version 2.1.2
Quick Start
PBKDF2 hash + verify
using SecurityHelperLibrary;
using System.Security.Cryptography;
ISecurityHelper helper = new SecurityHelper();
string stored = helper.HashPasswordWithPBKDF2(
"MyPassword123!",
out string salt,
HashAlgorithmName.SHA256,
iterations: 210000,
hashLength: 32);
bool valid = helper.VerifyPasswordWithPBKDF2("MyPassword123!", stored);
Argon2id hash
using SecurityHelperLibrary;
ISecurityHelper helper = new SecurityHelper();
string salt = helper.GenerateSalt();
string argon2Hash = helper.HashPasswordWithArgon2(
"MyPassword123!",
salt,
iterations: 4,
memoryKb: 131072,
degreeOfParallelism: 4,
hashLength: 32);
AES-GCM (supported target)
using SecurityHelperLibrary;
ISecurityHelper helper = new SecurityHelper();
byte[] key = helper.GenerateSymmetricKey(32);
string encrypted = helper.EncryptStringGCM("sensitive-value", key);
string decrypted = helper.DecryptStringGCM(encrypted, key);
helper.ClearSensitiveData(key);
Optional incident telemetry
You can provide an internal incident callback while keeping external error messages generic:
using SecurityHelperLibrary;
var helper = new SecurityHelper(code =>
{
// Send to logs/SIEM/internal monitoring
Console.WriteLine($"Security incident: {code}");
});
Security notes
- Use per-user random salt values.
- Keep Argon2/PBKDF2 cost settings high enough for your threat model.
- Store secrets and JWT signing keys in secure configuration providers.
- Clear sensitive buffers when possible.
License
See LICENSE.txt.
| 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 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 Framework | net481 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8.1
- Isopoh.Cryptography.Argon2 (>= 2.0.0)
-
net8.0
- Isopoh.Cryptography.Argon2 (>= 2.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.