CaptchaKit.Core
0.1.0-preview.3
dotnet add package CaptchaKit.Core --version 0.1.0-preview.3
NuGet\Install-Package CaptchaKit.Core -Version 0.1.0-preview.3
<PackageReference Include="CaptchaKit.Core" Version="0.1.0-preview.3" />
<PackageVersion Include="CaptchaKit.Core" Version="0.1.0-preview.3" />
<PackageReference Include="CaptchaKit.Core" />
paket add CaptchaKit.Core --version 0.1.0-preview.3
#r "nuget: CaptchaKit.Core, 0.1.0-preview.3"
#:package CaptchaKit.Core@0.1.0-preview.3
#addin nuget:?package=CaptchaKit.Core&version=0.1.0-preview.3&prerelease
#tool nuget:?package=CaptchaKit.Core&version=0.1.0-preview.3&prerelease
CaptchaKit
CaptchaKit is an ASP.NET Core CAPTCHA foundation with server-side, one-time validation and pluggable generators and storage.
CaptchaKit.Core has provider-neutral contracts. CaptchaKit.AspNetCore supplies randomized distorted-text, image-math, and image-target-selection challenges with IDistributedCache storage.
The package does not claim that image CAPTCHA alone defeats determined automation. Deploy it with rate limits, account lockout, and appropriate risk controls.
Quick start
Install both packages at the same version:
dotnet add package CaptchaKit.AspNetCore --prerelease
Configure a distributed cache (Redis is recommended for more than one application instance), then add the service:
builder.Services.AddStackExchangeRedisCache(options =>
options.Configuration = builder.Configuration.GetConnectionString("Redis"));
builder.Services.AddCaptchaKit(options =>
{
options.CodeLength = 5;
options.Lifetime = TimeSpan.FromMinutes(2);
options.CacheKeyPrefix = "myapp:captcha:";
});
An endpoint can obtain a challenge and return its type, prompt, choices, and optional image in the format used by its UI:
var challenge = await captcha.CreateAsync(cancellationToken);
var imageData = $"data:{challenge.ContentType};base64,{Convert.ToBase64String(challenge.ImageBytes)}";
Before completing the protected action, validate it once:
if (!await captcha.VerifyAsync(request.CaptchaId, request.CaptchaCode, cancellationToken))
return Results.Unauthorized();
VerifyAsync consumes the challenge on every attempt. Applications can replace ICaptchaGenerator or ICaptchaChallengeStore to use another challenge type or persistence backend.
| 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
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on CaptchaKit.Core:
| Package | Downloads |
|---|---|
|
CaptchaKit.AspNetCore
ASP.NET Core and distributed-cache integration for CaptchaKit. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.3 | 72 | 9/12/2026 |
| 0.1.0-preview.2 | 65 | 9/12/2026 |
| 0.1.0-preview.1 | 65 | 9/12/2026 |