Prompt Buddy logoPrompt Buddy

cloudflare · Cloudflare Workers Docs

Workers Using timingSafeEqual

Implements constant-time value comparison using crypto.subtle.timingSafeEqual to prevent side-channel timing attacks during sensitive operations like secret verification.

Import to Prompt Buddy

Derived skill

Files assembled from official documentation

Viewing SKILL.md

Workers Using timingSafeEqual

Implements constant-time value comparison using crypto.subtle.timingSafeEqual to prevent side-channel timing attacks during sensitive operations like secret verification.

When To Use

Use when you need to compare sensitive strings or buffers, such as API keys or tokens, without leaking their length or content through execution time differences.

Reference Files

FileContainsUse For
SKILL.mdEntry point: scope, routing table, and workflow.Start here.
docs/workers-examples-protect-against-timing-attacks-using-timingsafeequal-workflow-guide.mdA markdown guide demonstrating how to use the timingSafeEqual method in Cloudflare Workers to prevent timing attacks during value comparisons.Questions about a markdown guide demonstrating how to use the timingSafeEqual method in Cloudflare Workers to prevent timing attacks...
examples/workers-examples-protect-against-timing-attacks-using-timingsafeequal-cl.textA JavaScript example demonstrating how to use the timingSafeEqual method within a Cloudflare Worker to prevent timing attacks during secret comparison.Exact payloads, commands, or snippets shown in A JavaScript example demonstrating how to use the timingSafeEqual method within a Cloudflare Worker to prevent timing...
examples/workers-examples-protect-against-timing-attacks-using-timingsafeequal-cl-2.textA Python implementation for Cloudflare Workers demonstrating how to use timingSafeEqual to prevent timing attacks during secret comparison.Exact payloads, commands, or snippets shown in A Python implementation for Cloudflare Workers demonstrating how to use timingSafeEqual to prevent timing attacks dur...
examples/workers-examples-protect-against-timing-attacks-using-timingsafeequal-cl-3.textA Hono middleware implementation for Cloudflare Workers demonstrating how to use timingSafeEqual to prevent timing attacks during authentication.Exact payloads, commands, or snippets shown in A Hono middleware implementation for Cloudflare Workers demonstrating how to use timingSafeEqual to prevent timing at...

What This Skill Covers

  • Protect against timing attacks by safely comparing values using timingSafeEqual.
  • Main sections: Tags.

Workflow

  1. Open the most relevant file under docs/ for the exact documented workflow and wording.
  2. Open schemas/ files for exact structured contracts.
  3. Open examples/ files for concrete requests, commands, snippets, and manifests.
  4. Do not add behavior or configuration that is not present in the attached source files.

Canonical source: https://developers.cloudflare.com/workers/examples/protect-against-timing-attacks