Hrithik.Security.Pro 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Hrithik.Security.Pro --version 1.1.0
                    
NuGet\Install-Package Hrithik.Security.Pro -Version 1.1.0
                    
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.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hrithik.Security.Pro" Version="1.1.0" />
                    
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.1.0
                    
#r "nuget: Hrithik.Security.Pro, 1.1.0"
                    
#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.1.0
                    
#: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.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Hrithik.Security.Pro&version=1.1.0
                    
Install as a Cake Tool

Hrithik.Security.Pro

Enterprise-ready request signing and distributed replay protection middleware for ASP.NET Core.

Prevent replay attacks and forged API requests before they reach your business logic.

Hrithik.Security.Pro provides cryptographic request integrity, replay attack prevention, and tamper-resistant commercial licensing for high-trust API environments.

Designed to integrate seamlessly into the ASP.NET Core middleware pipeline without requiring an external API gateway.


Executive Summary

Modern distributed APIs require stronger guarantees than authentication alone.

Hrithik.Security.Pro enables:

  • Deterministic HMAC request validation\
  • Distributed replay attack prevention\
  • Secret rotation without downtime\
  • Constant-time signature comparison\
  • RSA-signed commercial license enforcement

Built for internal APIs, B2B integrations, financial systems, and service-to-service architectures.


Security Capabilities

Request Integrity

  • HMAC-SHA256 request signing
  • Full body hash validation
  • HTTP method + path binding
  • Constant-time signature comparison (timing-attack safe)

Replay Protection

  • Unique request ID enforcement
  • Configurable timestamp skew validation
  • In-memory or Redis-backed replay store
  • TTL-based replay window control

Secret Management

  • Multiple active secrets
  • Versioned secret header (X-Secret-Version)
  • Zero-downtime key rotation

Licensing Security

  • RSA-signed license payload
  • Application-bound enforcement
  • Time-limited validation
  • Tamper-resistant verification

🏗 Validation Pipeline

┌──────────────┐
│   Client     │
│ HMAC Sign    │
└──────┬───────┘
       │
       ▼
┌──────────────────────────────────┐
│ ReplayProtectionMiddleware       │
│                                  │
│ 1. License Validation            │
│ 2. Timestamp Validation          │
│ 3. Signature Verification        │
│ 4. Replay Store Check            │
└──────────────┬───────────────────┘
               │
               ▼
        ┌──────────────┐
        │  Controller  │
        └──────────────┘

Replay validation occurs before business logic, preventing tampered or replayed requests from reaching application code.


⚡ Performance Characteristics

Benchmarked on:

  • .NET 8
  • 4-core development machine
  • 1KB JSON payload
  • In-memory replay store

Observed:

  • ~0.4--0.8ms average overhead per request\
  • ~15,000--20,000 requests/sec (in-memory mode)\
  • Redis-backed mode adds only network latency

Replay lookup is O(1).
Signature comparison uses fixed-time equality to prevent timing attacks.

Benchmarks are illustrative and may vary by environment.


Installation

dotnet add package Hrithik.Security.Pro

Minimal Configuration

builder.Services.AddHrithikSecurityPro(
    license =>
    {
        license.LicenseKey = "YOUR_LICENSE_KEY";
        license.AppName = "MyApi";
    },
    replay =>
    {
        replay.ValidSecrets.Add("PRIMARY_SECRET");
        replay.AllowedClockSkew = TimeSpan.FromMinutes(2);
        replay.ReplayEntryTtl = TimeSpan.FromMinutes(5);
        replay.MaxBodySizeBytes = 1_000_000;
    });

app.UseMiddleware<ReplayProtectionMiddleware>();

Distributed Deployment

builder.Services.AddRedisReplayStore("localhost:6379");

Recommended for multi-instance production deployments.


Observability & Operations

Health Checks

builder.Services.AddReplayStoreHealthCheck();
app.MapHealthChecks("/health");

Metrics

OpenTelemetry-compatible counters:

  • replay_rejected_total
  • invalid_signature_total
  • expired_timestamp_total

When To Use This

Ideal for:

  • Service-to-service authentication
  • Fintech and payment APIs
  • B2B integrations
  • Webhook verification
  • Internal distributed systems

When Not To Use This

Not recommended if:

  • You rely exclusively on OAuth2/JWT and do not control the client
  • HMAC validation is already enforced at an API Gateway
  • Client-side signing cannot be implemented

Commercial Licensing

Hrithik.Security.Pro is distributed under a commercial license.

Pro Plan --- $99/year (per application)

Includes:

  • Full middleware functionality
  • Distributed Redis replay support
  • Secret rotation features
  • RSA-signed license enforcement
  • Ongoing updates

Licenses are application-bound, non-transferable, and valid for 12 months.


Security Model

Refer to SECURITY_MODEL.md for:

  • Threat model
  • Attack vectors mitigated
  • Replay window design
  • License validation strategy

👤 Maintained By

Built and maintained by Hrithik Kalra
Senior Backend & Azure Engineer
Focused on distributed API security and production-grade .NET systems.


Support

For licensing, configuration, or security inquiries:

📧 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

Hrithik.Security.Pro v1.1.0 – Licensing and Distributed Security Upgrade
- Added RSA-based license validation
- Added secret rotation support (versioned secrets)
- Added Redis distributed replay store
- Added body size guardrails
- Added structured logging and metrics hooks
- Added health check support
- Improved middleware path scoping
- Added SECURITY_MODEL.md