Hrithik.Security.Pro
1.0.1
See the version list below for details.
dotnet add package Hrithik.Security.Pro --version 1.0.1
NuGet\Install-Package Hrithik.Security.Pro -Version 1.0.1
<PackageReference Include="Hrithik.Security.Pro" Version="1.0.1" />
<PackageVersion Include="Hrithik.Security.Pro" Version="1.0.1" />
<PackageReference Include="Hrithik.Security.Pro" />
paket add Hrithik.Security.Pro --version 1.0.1
#r "nuget: Hrithik.Security.Pro, 1.0.1"
#:package Hrithik.Security.Pro@1.0.1
#addin nuget:?package=Hrithik.Security.Pro&version=1.0.1
#tool nuget:?package=Hrithik.Security.Pro&version=1.0.1
๐ Commercial License
Hrithik.Security.Pro requires a paid commercial license.
๐ณ Purchase
๐ International Customers
Pay securely via PayPal (USD $99 โ yearly license):
๐ https://paypal.me/hrithikkalra/99
๐ฎ๐ณ Indian Customers
Please email hrithikkalra11@gmail.com to receive UPI / bank transfer payment options.
๐ฉ License Activation
After payment, please email the following details to hrithikkalra11@gmail.com:
- Payment confirmation (PayPal transaction ID or payment reference)
- Company name
- Domain / Application name
You will receive your license key and shared secret within 24 hours.
Licenses are issued per company / per application, are non-transferable, and are valid for 12 months from the date of issue.
๐ Commercial Feature (Pro)
Client-side request signing is available only in
Hrithik.Security.Proand requires a valid commercial license.
Client-Side Request Signing (Pro)
Hrithik.Security.Pro uses cryptographically signed requests to protect APIs
from replay attacks, forged requests, and delayed replays.
This document explains how client applications must generate the required headers when calling a Pro-protected API.
๐ Why Pro?
Hrithik.Security.Prois designed for production APIs where tamper-proof requests, replay protection, and client authentication are business-critical (payments, fintech, internal services).
๐ Required Headers (Pro)
Each HTTP request MUST include the following headers:
| Header | Description |
|---|---|
X-Request-Id |
Unique request identifier (GUID recommended) |
X-Request-Timestamp |
Unix timestamp in UTC (seconds) |
X-Request-Signature |
HMAC-SHA256 signature (hex-encoded, uppercase) |
Requests missing any of these headers will be rejected.
โฑ Timestamp Rules
- Timestamp must be UTC
- Default allowed clock skew: ยฑ2 minutes (configurable server-side)
- Requests outside the allowed window are rejected
Ensure client machines are time-synced (NTP recommended).
๐ Signature Algorithm
The request signature is calculated as:
HMACSHA256( METHOD + PATH + BODY_HASH + TIMESTAMP, SHARED_SECRET )
Where:
METHODโ HTTP method (GET,POST, etc.)PATHโ Request path (example:/api/orders)BODY_HASHโ SHA256 hash of the request bodyTIMESTAMPโ Unix timestamp (UTC seconds)SHARED_SECRETโ Secret issued with your Pro license
Important Notes
- The signature must be hex-encoded (uppercase)
- For requests without a body (e.g.
GET), use an empty string ("") when calculatingBODY_HASH
๐งช Example (C# Client)
using System.Net.Http;
using System.Security.Cryptography;
using System.Text;
static string ComputeSha256(string input)
{
using var sha = SHA256.Create();
return Convert.ToHexString(
sha.ComputeHash(Encoding.UTF8.GetBytes(input)));
}
static string ComputeSignature(
string method,
string path,
string body,
string timestamp,
string secret)
{
var bodyHash = ComputeSha256(body ?? string.Empty);
var payload = method + path + bodyHash + timestamp;
using var hmac = new HMACSHA256(Encoding.UTF8.GetBytes(secret));
return Convert.ToHexString(
hmac.ComputeHash(Encoding.UTF8.GetBytes(payload)));
}
// --------------------
// Usage
// --------------------
var secret = "YOUR_SHARED_SECRET";
var body = "{ \"amount\": 100 }";
var timestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds().ToString();
var signature = ComputeSignature(
"POST",
"/api/payments",
body,
timestamp,
secret);
var request = new HttpRequestMessage(
HttpMethod.Post,
"https://api.example.com/api/payments");
request.Content = new StringContent(body, Encoding.UTF8, "application/json");
request.Headers.Add("X-Request-Id", Guid.NewGuid().ToString());
request.Headers.Add("X-Request-Timestamp", timestamp);
request.Headers.Add("X-Request-Signature", signature);
## โ Common Errors
| Error | Cause |
|------|------|
| Invalid signature | Wrong secret or payload mismatch |
| Expired timestamp | Client clock not in sync |
| Replay detected | Same `X-Request-Id` reused |
| Missing headers | Pro signing not applied |
## ๐ง Security Notes
Never hardcode the shared secret in frontend applications
Store secrets securely (environment variables, Azure Key Vault, etc.)
Rotate secrets periodically
Each application should use a unique secret
## ๐ณ Getting a Pro License
See **Commercial License** section above for purchase and activation details.
## ๐ Support
For questions related to:
Request signing
License activation
Configuration
Contact:
๐ง hrithikkalra11@gmail.com
| 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. |
-
net8.0
- Microsoft.AspNetCore.Http.Abstractions (>= 2.3.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Updated README with Pro license details and client signing documentation.