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.
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
| File | Contains | Use For |
|---|---|---|
SKILL.md | Entry point: scope, routing table, and workflow. | Start here. |
docs/workers-examples-protect-against-timing-attacks-using-timingsafeequal-workflow-guide.md | A 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.text | A 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.text | A 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.text | A 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
- Open the most relevant file under
docs/for the exact documented workflow and wording. - Open
schemas/files for exact structured contracts. - Open
examples/files for concrete requests, commands, snippets, and manifests. - 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
