<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu" -->

---
title: HMAC-signed URLs on Cloudflare Workers | daily.dev
description: A practical guide to implementing HMAC-signed URLs on Cloudflare Workers using the Web Crypto API instead of Node's crypto module. Covers the full flow:...
canonical: https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: HMAC-signed URLs on Cloudflare Workers | daily.dev
og:description: A practical guide to implementing HMAC-signed URLs on Cloudflare Workers using the Web Crypto API instead of Node's crypto module. Covers the full flow:...
og:url: https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu
og:image: https://api.daily.dev/og/posts/CVLBJpGGu.png
og:image:alt: HMAC-signed URLs on Cloudflare Workers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HMAC-signed URLs on Cloudflare Workers

**[Flavio Copes](https://daily.dev/sources/flaviocopes)** · 4 min read · 0 upvotes · 0 comments

## Summary

A practical guide to implementing HMAC-signed URLs on Cloudflare Workers using the Web Crypto API instead of Node's crypto module. Covers the full flow: constructing a versioned payload with resource ID and expiry timestamp, importing a secret key into crypto.subtle, signing and base64url-encoding the signature, and verifying incoming tokens with constant-time comparison to prevent timing attacks. Includes code snippets for all helper functions and a checklist of best practices like minting tokens server-side only and rejecting expired tokens before doing crypto work.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://flaviocopes.com/hmac-signed-urls-cloudflare-workers>

## Similar posts on daily.dev

- [How JWT signing actually works \(HS256 with Web Crypto\)](https://daily.dev/posts/how-jwt-signing-actually-works-hs256-with-web-crypto--2rxjonzr8) · Flavio Copes · 1 upvotes · 0 comments
- [HMAC Secrets Explained: Authentication You Can Actually Implement](https://daily.dev/posts/hmac-secrets-explained-authentication-you-can-actually-implement-sgzf0qnkp) · GitGuardian · 0 upvotes · 0 comments
- [Pre‑Signed URL Upload Architecture \(Cloudflare R2 \+ Hono Workers\)](https://daily.dev/posts/pre-signed-url-upload-architecture-cloudflare-r2-hono-workers--58kd2mkem) · Liran Tal · 1 upvotes · 0 comments
- [How to implement HMAC authentication in ASP.NET Core](https://daily.dev/posts/how-to-implement-hmac-authentication-in-asp-net-core-awauatewf) · InfoWorld · 1 upvotes · 0 comments
- [A Practical Guide to Secure Authentication for Developers](https://daily.dev/posts/a-practical-guide-to-secure-authentication-for-developers-p5rufwxgq) · SitePoint · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security), [#cloudflare](https://daily.dev/tags/cloudflare)

[View this post on daily.dev](https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"HMAC-signed URLs on Cloudflare Workers","url":"https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu"},"datePublished":"2026-07-11T07:24:45.952Z","dateModified":"2026-07-11T07:25:05.172Z","description":"A practical guide to implementing HMAC-signed URLs on Cloudflare Workers using the Web Crypto API instead of Node's crypto module. Covers the full flow:...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/907c6c028f107fad7d0379f1571dde35?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/907c6c028f107fad7d0379f1571dde35?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Flavio Copes","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Flavio Copes","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/1f2dbd275797411bbd37bfdaaf0951a9","url":"https://daily.dev/sources/flaviocopes"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/hmac-signed-urls-on-cloudflare-workers-cvlbjpggu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,cloudflare","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Flavio Copes","item":"https://daily.dev/sources/flaviocopes"},{"@type":"ListItem","position":3,"name":"HMAC-signed URLs on Cloudflare Workers"}]}
```

