Skip to content

Logic CAPTCHAs

Sepehr0Day edited this page Jun 13, 2026 · 2 revisions

Logic CAPTCHAs

MathCaptcha

Creates a plain arithmetic expression.

Returns: (expression, integer_answer).

Use this when the UI should render the expression itself.

Example: Examples/CaptchaExamples/MathCaptcha/

MathImageCaptcha

Renders an arithmetic expression into an image.

Returns: ChallengeResult.

Key parameters: fonts, difficulty, style.

Example: Examples/CaptchaExamples/MathImageCaptcha/

SequenceCaptcha

Creates a valid arithmetic or geometric sequence and asks for the next number.

Returns: ChallengeResult.

Metadata:

  • sequence: displayed values
  • rule: arithmetic or geometric
  • rule_value: step or ratio

Never send rule metadata to an untrusted client.

Example: Examples/CaptchaExamples/SequenceCaptcha/

LogicChallengeCaptcha

Generates a compact logic question such as comparisons or numeric reasoning.

Returns: ChallengeResult.

Key parameters: fonts, difficulty.

Example: Examples/CaptchaExamples/LogicChallengeCaptcha/

CustomQuestionCaptcha

Renders application-defined questions.

Provide one of:

  • question and answer
  • questions=[(question, answer), ...]
  • provider=lambda: (question, answer)

Returns: ChallengeResult; metadata includes the question and answer type.

Example: Examples/CaptchaExamples/CustomQuestionCaptcha/

Clone this wiki locally