Secure your .NET microservices with RSA-OAEP-SHA256 encryption and Argon2id hashing — built for performance, reliability, and middleware integration.
https://www.nuget.org/packages/JHashEncryption.Security
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.
dotnet add package JHashEncryption.Securitybuilder.Services.AddJHashEncryption(publicKeyPem, privateKeyPem);app.UseJHashEncryption();You can use the middleware and/or inject services directly into your controllers or services.
private readonly RsaOaepSha256Crypto _crypto;
private readonly Argon2Hasher _hasher;
public Class_Name(RsaOaepSha256Crypto crypto, Argon2Hasher hasher)
{
_crypto = crypto;
_hasher = hasher;
}
var encrypted = _crypto.Encrypt("sensitive data");
var decrypted = _crypto.Decrypt(encrypted);
var hash = _hasher.HashPassword("myPassword");
var isValid = _hasher.VerifyPassword("myPassword", hash);var crypto = new RsaOaepSha256Crypto(publicKeyPem, privateKeyPem);
var encrypted = crypto.Encrypt("sensitive data");
var decrypted = crypto.Decrypt(encrypted);var hasher = new Argon2Hasher();
var hash = hasher.HashPassword("myPassword");| 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 |
- 🔒 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
MIT — free to use, modify, and distribute.