ADCaptcha 1.0.4

dotnet add package ADCaptcha --version 1.0.4
NuGet\Install-Package ADCaptcha -Version 1.0.4
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="ADCaptcha" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ADCaptcha --version 1.0.4
#r "nuget: ADCaptcha, 1.0.4"
#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.
// Install ADCaptcha as a Cake Addin
#addin nuget:?package=ADCaptcha&version=1.0.4

// Install ADCaptcha as a Cake Tool
#tool nuget:?package=ADCaptcha&version=1.0.4

README.md

ADCaptcha

ADCaptcha is a secure CAPTCHA generator library for ASP.NET web applications.

Description

ADCaptcha provides a simple and effective way to integrate CAPTCHA functionality in your ASP.NET projects. It generates CAPTCHA images with customizable distortion techniques to prevent automated bots and spam, ensuring that only humans can access sensitive areas of your website.

Features

  • Random CAPTCHA text generation
  • Customizable CAPTCHA image dimensions and distortion techniques
  • CAPTCHA verification for user input (Comparison should be case-sensitive or case-insensitive. Default case-insensitive)
  • Difficulty levels: Easy, Medium, and Hard
  • NoiseMode: Easy, Medium, and Hard
  • DistortionTechnique: Warp, NoiseLines, Swirl and Stitch

Installation

You can install ADCaptcha via NuGet Package Manager. Use the following command in the Package Manager Console:

Install-Package ADCaptcha

Usage

  1. Add the ADCaptcha library to your ASP.NET project.

  2. Generate a new CAPTCHA text and image with the desired difficulty level:

using ADCaptcha;

// ...

ICaptchaGenerator captchaGenerator = CaptchaFactory.CreateCaptchaGenerator();

// Generate a new CAPTCHA text and image with the selected difficulty level/mode
//string captchaText = captchaGenerator.GenerateRandomText();
string captchaText = captchaGenerator.GenerateRandomText(6, DifficultyMode.Medium);
// You can use anyone as required. Generate the CAPTCHA image and convert it to a base64 string.
//byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 150, 50);
 byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 150, 50, 24, System.Drawing.Color.White, System.Drawing.Color.DarkBlue, DistortionTechnique.NoiseLines, DistortionTechnique.Swirl);

  //byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 140, 40, null, 22, null, null,true, DistortionTechnique.Warp);
            // You can use anyone as required. Generate the CAPTCHA image and convert it to a base64 string.
            //byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 140, 40);
            //byte[] captchaImageBytes = captchaGenerator.GenerateGraphCaptcha(captchaText, 140, 40);

            //byte[] captchaImageBytes = captchaGenerator.GenerateCaptchaImage(captchaText, 140, 40,NoiseMode.Hard);

Choose from the following difficulty levels:

DifficultyMode.Easy: Generates a numeric CAPTCHA text.
DifficultyMode.Medium: The default difficulty level with a lowercase alphanumeric CAPTCHA text.
DifficultyMode.Hard: Generates a mixed upper and lower with numeric CAPTCHA text.


1. Display the CAPTCHA image to the user along with an input field for the user to enter the CAPTCHA text.

2. On form submission, verify the user's input:

string userCaptcha = CaptchaTextBox.Text.Trim();
bool isValidCaptcha = captchaGenerator.VerifyCaptcha(userCaptcha, captchaText, caseSensitive: true);

if (isValidCaptcha)
{
    // CAPTCHA is valid. Proceed with the form submission.
}
else
{
    // CAPTCHA is invalid. Show an error message to the user.
}


License
This library is distributed under the MIT License.

Contact
For any questions or feedback, feel free to reach out to the project maintainer.

Name: ASHOK DUDI
Email: adudi82@gmail.com
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

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.0.4 163 8/30/2023
1.0.3 132 8/18/2023
1.0.2 147 8/18/2023
1.0.1 183 7/29/2023
1.0.0 153 7/29/2023

Initial release.