Hrithik.Security.Pro 1.0.1

There is a newer version of this package available.
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
                    
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="Hrithik.Security.Pro" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hrithik.Security.Pro" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Hrithik.Security.Pro" />
                    
Project file
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 Hrithik.Security.Pro --version 1.0.1
                    
#r "nuget: Hrithik.Security.Pro, 1.0.1"
                    
#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 Hrithik.Security.Pro@1.0.1
                    
#: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=Hrithik.Security.Pro&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Hrithik.Security.Pro&version=1.0.1
                    
Install as a Cake Tool

๐Ÿ” 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.Pro and 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.Pro is 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 body
  • TIMESTAMP โ†’ 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 calculating BODY_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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.2.0 138 2/13/2026
1.1.0 122 2/13/2026
1.0.1 121 2/9/2026
1.0.0 112 2/9/2026

Updated README with Pro license details and client signing documentation.