CaptchaKit.Core 0.1.0-preview.3

This is a prerelease version of CaptchaKit.Core.
dotnet add package CaptchaKit.Core --version 0.1.0-preview.3
                    
NuGet\Install-Package CaptchaKit.Core -Version 0.1.0-preview.3
                    
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="CaptchaKit.Core" Version="0.1.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CaptchaKit.Core" Version="0.1.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="CaptchaKit.Core" />
                    
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 CaptchaKit.Core --version 0.1.0-preview.3
                    
#r "nuget: CaptchaKit.Core, 0.1.0-preview.3"
                    
#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 CaptchaKit.Core@0.1.0-preview.3
                    
#: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=CaptchaKit.Core&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CaptchaKit.Core&version=0.1.0-preview.3&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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