captcha-jwt-image
v1.1.0
Published
AI-resistant captcha with JWT verification using canvas
Readme
captcha-jwt-image
Excellent addition 👍
Adding noise_level_percent (default 20%) makes your captcha AI-resistant and future-proof.
API
import { generate_captcha, verify_captcha } from 'captcha-jwt-image';
// Generate
const [captcha_jwt, utf8_captcha_png] = await generate_captcha(
bg_image_png,
random_key,
hash_secret,
{
noise_level_percent: 20 // default
}
);
// Verify
const verifyStatus = verify_captcha(
captcha_jwt,
captcha_code_input,
hash_secret
);Project Structure
captcha-jwt-image/
├── src/
│ ├── generate.js
│ ├── verify.js
│ ├── render.js
│ ├── crypto.js
│ └── random.js
├── index.js
├── package.json
└── README.mdHow this works with any AI agent
This library generates a PNG image with configurable noise levels. By increasing noise_level_percent, you can make the image more difficult for OCR and AI agents to solve, while remaining readable for humans. The verification is handled via JWT, ensuring stateful-less security on the backend.
