Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By samirdjelalv1.1.0MITIn 1 marketplace
Adds self-hosted CAPTCHA protection to Rust web endpoints using the captcha-rs crate. Verification is stateless with replay protection, and its Proof-of-Work mode runs invisibly to users.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
captcha, bot-protection, proof-of-work, svg-captcha, audio-captcha, replay-protection, axum, captcha-rs ·
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Fast, modular, zero-unsafe CAPTCHA engine for Rust.
Visual text & math CAPTCHAs, lazy zero-raster SVG, WAV audio, pure-Rust replay-protected tokens, next-gen KDF Proof-of-Work v2, and interactive puzzles — unified under one clean API and 9 ergonomic macros.
# Default: Text/Math + JPEG + zero-raster SVG + pure-Rust HMAC tokens & macros (zero C/`ring`)
cargo add captcha-rs
# Everything enabled (PNG, WebP, Audio WAV, JWT, PoW v2 + Argon2id/Scrypt, Slider/Rotate, Serde):
cargo add captcha-rs --features full
# Invisible KDF Proof-of-Work v2 only (zero graphics crates compiled):
cargo add captcha-rs --no-default-features --features pow
Or in Cargo.toml:
[dependencies]
captcha-rs = "1"
# captcha-rs = { version = "1", features = ["full"] }
# captcha-rs = { version = "1", default-features = false, features = ["pow"] }
captcha_service!)use captcha_rs::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Share across Axum State / Actix Data / Rocket managed state (Clone + Send + Sync)
let service = captcha_service! {
engine: text_engine!(Medium, dark_mode: true),
secret: "replace-with-env-secret",
ttl_secs: 300,
replay_capacity: 100_000,
};
// Issue: generates challenge + signed token with zero pixel rasterization
let issued = service.issue()?;
let svg = issued.challenge.to_svg(); // ~90 µs end-to-end
let jpeg_uri = issued.challenge.to_jpeg_data_uri(80)?; // lazily rasterized & cached
println!("svg={}B | jpeg={}... | token={}", svg.len(), &jpeg_uri[..32], issued.token());
// Verify once (subsequent attempts automatically return Err(VerifyError::Replayed))
let answer = issued.challenge.answer().to_owned();
service.verify(issued.token(), &answer)?;
assert_eq!(service.verify(issued.token(), &answer), Err(VerifyError::Replayed));
Ok(())
}
No deep builder nesting required — configure visual text, math, KDF PoW v2, or interactive puzzles declaratively:
use captcha_rs::prelude::*;
// Visual & Math CAPTCHAs
let quick = captcha!(Medium, dark_mode: true);
let math = text_engine!(Hard, mode: Math, theme: Dark).generate();
println!("prompt={} | answer={}", math.prompt(), math.answer());
// Invisible KDF Proof-of-Work v2 (feature: pow) — 0-KDF constant-time server verification
let pow_svc = captcha_service! {
engine: pow_engine!(), // PBKDF2/SHA-256 deterministic mode (or Argon2id / Scrypt / Probabilistic)
secret: "replace-with-env-secret",
ttl_secs: 120,
replay_capacity: 50_000,
};
// Interactive Slider Jigsaw Puzzle (feature: puzzle) — encrypted target + decoys + attempt lock
let slider_svc = captcha_service! {
engine: slider_engine!(size: (300, 150), tolerance: 6, decoys: 1, dark_mode: true),
secret: "replace-with-env-secret",
consume_on_attempt: true,
replay_capacity: 50_000,
};
// Interactive Rotate-to-Upright Puzzle (feature: puzzle)
let rotate_svc = captcha_service! {
engine: rotate_engine!(size: 180, tolerance_deg: 12, dark_mode: true),
secret: "replace-with-env-secret",
consume_on_attempt: true,
replay_capacity: 50_000,
};
All declarative macros expand to regular builders at compile time (zero proc-macros, zero extra compile overhead). See Declarative Macros for all keys and shorthands.
Theme::Light & Theme::Dark)Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub samirdjelal/captcha-rs --plugin captcha-rsPlugins from other owners that cover similar ground