JSPM

captcha-jwt-image

1.1.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 3
    • Score
      100M100P100Q54429F
    • License ISC

    AI-resistant captcha with JWT verification using canvas

    Package Exports

    • captcha-jwt-image

    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.md

    How 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.