JHashEncryption.Security
1.1.1.1
dotnet add package JHashEncryption.Security --version 1.1.1.1
NuGet\Install-Package JHashEncryption.Security -Version 1.1.1.1
<PackageReference Include="JHashEncryption.Security" Version="1.1.1.1" />
<PackageVersion Include="JHashEncryption.Security" Version="1.1.1.1" />
<PackageReference Include="JHashEncryption.Security" />
paket add JHashEncryption.Security --version 1.1.1.1
#r "nuget: JHashEncryption.Security, 1.1.1.1"
#:package JHashEncryption.Security@1.1.1.1
#addin nuget:?package=JHashEncryption.Security&version=1.1.1.1
#tool nuget:?package=JHashEncryption.Security&version=1.1.1.1
๐ฆ JHashEncryption.Security
Secure your .NET microservices with RSA-OAEP-SHA256 encryption and Argon2id hashing โ built for performance, reliability, and middleware integration.
๐ Overview
JHashEncryption.Security is a lightweight, production-ready NuGet package that provides:
- โ RSA-OAEP-SHA256 encryption/decryption for secure payload handling
- โ Argon2id password hashing for modern authentication flows
- โ Plug-and-play middleware for automatic request/response encryption
- โ Direct service injection for manual control in business logic
Built for .NET 10+, this package is ideal for developers building secure APIs, microservices, and cloud-native apps.
๐ Installation
dotnet add package JHashEncryption.Security
โ๏ธ Setup
1. Register Services
builder.Services.AddJHashEncryption(publicKeyPem, privateKeyPem);
2. Enable Middleware
app.UseJHashEncryption();
You can use the middleware and/or inject services directly into your controllers or services.
๐งช Usage Examples
1. Dependency Injection (Ideal for microservices)
private readonly RsaOaepSha256Crypto _crypto;
private readonly Argon2Hasher _hasher;
public Class_Name(RsaOaepSha256Crypto crypto, Argon2Hasher hasher)
{
_crypto = crypto;
_hasher = hasher;
}
๐น Encrypt/Decrypt Payloads
var encrypted = _crypto.Encrypt("sensitive data");
var decrypted = _crypto.Decrypt(encrypted);
๐น Hash and Verify Passwords
var hash = _hasher.HashPassword("myPassword");
var isValid = _hasher.VerifyPassword("myPassword", hash);
2. Manual Usage (No DI)
๐น Encrypt/Decrypt Payloads
var crypto = new RsaOaepSha256Crypto(publicKeyPem, privateKeyPem);
var encrypted = crypto.Encrypt("sensitive data");
var decrypted = crypto.Decrypt(encrypted);
๐น Hash and Verify Passwords
var hasher = new Argon2Hasher();
var hash = hasher.HashPassword("myPassword");
๐งฐ API Surface
| Service | Description |
|---|---|
RsaOaepSha256Crypto |
Encrypts and decrypts strings using RSA-OAEP padding with SHA-256 |
Argon2Hasher |
Hashes and verifies passwords using Argon2id |
JHashEncryptionMiddleware |
ASP.NET Core middleware for automatic request/response encryption |
๐ก๏ธ Why JHashEncryption?
- ๐ Modern cryptography: RSA-OAEP-SHA256 + Argon2id = secure by default
- โก Minimal overhead: optimized for performance in microservices
- ๐งฉ Flexible architecture: use as middleware or inject directly
- ๐ง Built by a systems thinker: designed for reliability, clarity, and maintainability
๐ License
MIT โ free to use, modify, and distribute.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Konscious.Security.Cryptography.Argon2 (>= 1.3.1)
- Microsoft.AspNetCore.Http (>= 2.3.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.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 |
|---|---|---|
| 1.1.1.1 | 142 | 11/15/2025 |