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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
The Blog of Author Tim Ferriss
V
V2EX
博客园 - 聂微东
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
U
Unit 42
Vercel News
Vercel News
L
LangChain Blog
博客园 - 司徒正美
H
Help Net Security
Recent Announcements
Recent Announcements
Recorded Future
Recorded Future
V
Visual Studio Blog
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
Y
Y Combinator Blog
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
F
Fortinet All Blogs
B
Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
罗磊的独立博客
博客园_首页
MyScale Blog
MyScale Blog
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
量子位
I
InfoQ
小众软件
小众软件
P
Proofpoint News Feed

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 Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
JWT Is Not Quantum-Safe — So I Built a Library That Is
sachin ruhil · 2026-05-17 · via DEV Community

I built @pq-jwt/core — a post-quantum JWT library using NIST FIPS 204 (ML-DSA) and FIPS 205 (SLH-DSA). Drop-in successor to RS256/ES256. Here's why it matters and how to use it.

https://www.npmjs.com/package/@pq-jwt/core

Every Node.js app using jsonwebtoken with RS256 or ES256 has the same problem.
A sufficiently powerful quantum computer running Shor's algorithm can derive your private key from your public key — in polynomial time. That means every token your server has ever signed becomes forgeable. Not "hard to forge." Forgeable.
I spent the last few weeks building a fix: @pq-jwt/core — a post-quantum JWT library built on NIST-standardized algorithms.
bashnpm install @pq-jwt/core

The Problem With RS256 and ES256
Standard JWTs use one of these signing algorithms:
**
RS256 — RSA + SHA-256*. Security basis: integer factorization.
**ES256 — ECDSA + SHA-256
*. Security basis: elliptic curve discrete logarithm.

Both of these problems are efficiently solvable by a quantum computer running Shor's algorithm (1994). The math has been known for 30 years. The hardware is catching up.
In August 2024, NIST published three post-quantum cryptography standards:

FIPS 203 — ML-KEM (key encapsulation)
FIPS 204 — ML-DSA (digital signatures) ← what we need for JWTs
FIPS 205 — SLH-DSA (hash-based signatures)

These algorithms are designed to be secure against both classical and quantum computers. They are now official US federal standards. The NSA's CNSA 2.0 suite mandates them for all national security systems by 2030.
Nobody had built a developer-friendly JWT library around them. So I did.

What @pq-jwt/core Does
It replaces the signing algorithm in your JWT workflow. Everything else stays the same — same three-part token structure (header.payload.signature), same claims (iss, sub, aud, exp), same API shape.
javascriptimport { generateKeyPair, sign, verify } from '@pq-jwt/core';

// Generate once, store securely
const { publicKey, secretKey } = generateKeyPair('ML-DSA-65');

// Sign (at login)
const token = sign(
{ sub: 'user_42', role: 'admin' },
secretKey,
{
algorithm: 'ML-DSA-65',
expiresIn: '1h',
issuer: 'auth.myapp.com',
audience: 'api.myapp.com',
}
);

// Verify (in middleware)
const { header, payload } = verify(token, publicKey, {
issuer: 'auth.myapp.com',
audience: 'api.myapp.com',
});

console.log(header.alg); // 'ML-DSA-65'
console.log(payload.sub); // 'user_42'
That's it. If you've used jsonwebtoken before, you already know how to use this.

Supported Algorithms
All four are NIST-standardized:
AlgorithmStandardQuantum SecurityBest ForML-DSA-44FIPS 20464-bit QIoT / constrainedML-DSA-65FIPS 20496-bit QGeneral use (recommended)ML-DSA-87FIPS 204128-bit QHigh security / governmentSLH-DSA-SHA2-128sFIPS 20564-bit QConservative / hash-based
ML-DSA is CRYSTALS-Dilithium under its standardized name. SLH-DSA is SPHINCS+.

TypeScript Support
Full TypeScript types are included — no @types/ package needed:
typescriptimport {
generateKeyPair,
sign,
verify,
type Algorithm,
type KeyPair,
type SignOptions,
TokenExpiredError,
SignatureError,
} from '@pq-jwt/core';

const alg: Algorithm = 'ML-DSA-65';
const kp: KeyPair = generateKeyPair(alg);

const opts: SignOptions = {
algorithm: 'ML-DSA-65',
expiresIn: '8h',
issuer: 'auth.myapp.com',
};

const token: string = sign({ userId: 'u1' }, kp.secretKey, opts);

try {
const { payload } = verify(token, kp.publicKey, { issuer: 'auth.myapp.com' });
console.log(payload.userId); // 'u1'
} catch (e) {
if (e instanceof TokenExpiredError) { /* 401 / }
if (e instanceof SignatureError) { /
403 */ }
}

Express.js Middleware Example
javascriptimport { verify, importKey, TokenExpiredError, SignatureError } from '@pq-jwt/core';

const PUBLIC_KEY = importKey(process.env.PQ_PUBLIC_KEY);

function pqAuth(req, res, next) {
const auth = req.headers.authorization;
if (!auth?.startsWith('Bearer '))
return res.status(401).json({ error: 'Missing token' });

try {
const { payload } = verify(auth.slice(7), PUBLIC_KEY, {
issuer: 'auth.myapp.com',
audience: 'api.myapp.com',
});
req.user = payload;
next();
} catch (e) {
if (e instanceof TokenExpiredError) return res.status(401).json({ error: 'Token expired' });
if (e instanceof SignatureError) return res.status(403).json({ error: 'Invalid signature' });
res.status(400).json({ error: 'Bad token' });
}
}

app.get('/profile', pqAuth, (req, res) => res.json(req.user));

Why Shor's Algorithm Doesn't Break This
This is the key technical point.
Shor's algorithm exploits the periodic structure of cyclic group problems — integer rings (RSA) and elliptic curve groups (ECDSA). It finds the period of a function defined over those groups, which lets it factor numbers or solve discrete logs efficiently.
ML-DSA is based on Module-LWE (Learning With Errors) — a lattice problem. Lattice problems have no group-periodic structure. Shor's algorithm provides zero speedup against them. This was acknowledged in Shor's original 1994 paper.
Grover's algorithm does apply — it gives a square-root speedup against signature verification. That's why ML-DSA-65 is parameterized for 192-bit classical security: under Grover it reduces to 96-bit quantum security, which is still computationally infeasible.

Performance Numbers
Benchmarked on Node.js v22, single thread:

The trade-off is real. Tokens are larger (~4.5 KB vs ~0.5 KB), and signing is slower (~11 ms vs < 1 ms). For login flows and session tokens, this is imperceptible to users. For high-frequency per-request signing, you'd want to benchmark your specific workload.
SLH-DSA signing at 5+ seconds is only suitable for low-frequency operations like initial authentication — not per-request refresh.

What It's Built On
The cryptographic implementation is @noble/post-quantum by Paul Miller — zero native dependencies, independently audited, TypeScript-native. I built the JWT layer on top of it.
The cryptographic primitives themselves are not mine to invent. My job was to make them as easy to use as jsonwebtoken. That's the whole value of the library.

Security Properties (Tested)
From the test suite:

✓ 50/50 single-bit signature flips detected
✓ 20/20 payload substitution attempts caught
✓ Algorithm confusion (alg: none) rejected
✓ Cross-key attacks rejected
✓ 10,000 random forgery attempts — 0 succeeded
✓ 61/61 tests passing (TypeScript strict + runtime)

The Honest Limitations
I want to be direct about what this is and isn't.
What it is: A production-usable library for post-quantum JWT signing, built on NIST-standardized algorithms, with full TypeScript support, typed errors, and a clean **API.
**What it isn't
: A mathematically proven unbreakable system. No such thing exists in practical cryptography. The security of ML-DSA reduces to the hardness of Module-LWE, which has survived 15+ years of public cryptanalysis. The same category of hardness assumption underpins every cryptographic system deployed in production today.
What to never put in the payload: Passwords, private keys, sensitive data. The JWT payload is base64url-encoded, not encrypted. Anyone can decode it. Put user IDs, roles, and session metadata — not secrets. This is true of all JWTs, not just this library.

Getting Started
bashnpm install @pq-jwt/core
Full working demo (Express + MongoDB + TypeScript):
→ github.com/pq-jwt/PQ-JWT-Demo
Source code:
→ github.com/pq-jwt/PQ-JWT
npm:
→ npmjs.com/package/@pq-jwt/core

What's Next
The roadmap includes:

@pq-jwt/express — Express middleware as a standalone package
@pq-jwt/hybrid — Dual signing with ECDSA + ML-DSA (migration bridge)
@pq-jwt/wallet — Post-quantum wallet signatures for Web3

If you're working on authentication infrastructure and want to contribute, issues and PRs are open at github.com/pq-jwt/PQ-JWT.

Built by Sachin Ruhil. Published May 2025.