惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
A
About on SuperTechFans
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
H
Help Net Security
I
InfoQ
月光博客
月光博客
量子位
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
Engineering at Meta
Engineering at Meta
G
Google Developers Blog
D
DataBreaches.Net
宝玉的分享
宝玉的分享
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How License Keys Work for Desktop Apps
Nico · 2026-06-27 · via DEV Community

Nico

Originally published on the Keylight blog.

The "XXXXX-XXXXX-XXXXX" string you paste into a registration window looks simple, and the idea behind it is simple. But what makes a license key actually secure has changed completely over the last two decades. This post explains how license keys work for desktop apps today, and why the old way no longer holds up.

The old way: checksum keys

For a long time, a license key was a string that was valid if its characters satisfied some arithmetic rule. The app contained the rule. When a customer typed in a key, the app ran the check locally: do these digits sum to the right value, do these segments relate in the expected way? If yes, unlock.

This was cheap and worked offline, but it had a fatal flaw. The validity lived in a pattern, and patterns can be reverse-engineered. Once one person worked out the rule — or simply found one key that passed — that key, or a generator for it, ended up on the internet. The app had no way to tell a paying customer's key from a pirate's, because both satisfied the same rule.

Checksum keys are not a security mechanism anymore. They are a speed bump.

The modern way: signed keys

A modern license key does not encode validity in a pattern. It carries a cryptographic signature — proof that a server you control minted this specific key for this specific entitlement.

It works with a key pair. The server holds a secret private key and uses it to sign. The app ships with the matching public key and uses it to verify. The mathematics of the algorithm — Ed25519 is the standard choice — guarantees two things: only the holder of the private key can produce a signature the public key accepts, and the public key reveals nothing that helps forge one.

So you can embed the public key in every copy of your app, ship it to the whole world, and an attacker still cannot mint a working key. The validity no longer lives in a guessable pattern; it lives in a signature only your server can produce.

What is actually inside the key

A signed key is not just a random-looking string — it is a small structured document, an entitlement, with a signature attached. It typically carries who the license belongs to, which product and plan it covers, when it was issued, when it expires (if ever), and how many devices it may activate:

{
  "id": "lk_01hx9z4bqncktjvx6a2r3p8wy",
  "productId": "prod_myapp_pro",
  "plan": "pro",
  "activationLimit": 3,
  "issuedAt": "2026-05-15T09:12:00Z",
  "expiresAt": null,
  "revoked": false,
  "sig": "base64url(ed25519_signature)"
}

The signature covers every field above it. If anyone edits a single character — bumping activationLimit from 3 to 99, or flipping revoked to false after a refund — the signature no longer matches, and the app rejects the key. The customer holds the document, but they cannot change what it says.

How the app checks it

When your app has a key, validation is a local computation: parse the document, run the signature check with the embedded public key, then read the plain fields — is it expired, is it revoked, is it within its device limit. No server call. The app can do this on a plane.

That is the headline benefit of signed keys for desktop apps specifically. A web app can validate against its server on every request for free, because it is always online. A desktop app is not always online, and a license check that needs the network will fail for legitimate customers. Signed keys remove that dependency. For the full treatment of local verification, see software license keys explained.

Revocation is the one thing local verification cannot do alone — a key the app has never been told about cannot know it was refunded. So signed-key systems add a periodic online re-check: every few days, when the app has a connection, it reconfirms the key server-side and picks up any revocation. Everyday validation stays offline; only the occasional re-check needs the network.

What this means if you are building it

If you are adding licensing to a desktop app, the takeaway is: do not ship checksum keys. They will not protect your revenue. You want signed keys — which means a private key to manage, a signing service, an entitlement format, verification code in your app, and the periodic re-check logic.

That is a real amount of infrastructure, which is why licensing layers exist to provide it. However you build it, the model is the same: a signed document the customer cannot forge or edit, verified locally by your app. If there is an angle on license keys you would like covered in more depth, send us your feedback.

FAQ

What is a software license key?

A license key is a unique value a customer receives after paying, which the app checks to unlock paid functionality. Modern keys are cryptographically signed so the app can verify them without contacting a server.

Are old-style checksum license keys still secure?

No. A checksum key is valid if its characters satisfy a pattern, so one leaked working key can be shared endlessly. Signed keys solve this — only the server holding the private key can mint a valid one.

Can a license key work without an internet connection?

Yes, if it is signed. The app ships with a public key and verifies the signature locally, so no network call is needed to confirm the license is genuine.