Skip to main content
skill CX Codex

implementing-jwt-signing-and-verification — Claude Code skill: install

implementing-jwt-signing-and-verification is a Claude Code skill for building JWT signing and verification. It activates for authentication work or audits of token checks.

Apache-2.0 294 installs ★ 36,511 updated 2026-08-31

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-jwt-signing-and-verification -a claude-code
Open on GitHub

What implementing-jwt-signing-and-verification does

The skill guides JWT signing and verification, claim checks, and token expiry handling. It covers HS256, RS256, ES256, and EdDSA, with defenses against algorithm swaps, alg=none, and keys supplied through a JWK header.

It also addresses audience and activation-time checks, key rotation with JWK Sets, and authentication middleware. Running the covered work requires Python 3.8+ with dependencies installed, cryptography knowledge, and a test or lab environment; testing also requires proper authorization.

What it helps with

  • sign JWTs with multiple algorithms
  • validate signatures, claims, and token expiry
  • block algorithm swaps and alg=none bypasses
  • rotate signing keys through JWK Sets

Example prompts for the agent

  • Add JWT signing and verification with HS256 and an expiry check to this project.
  • Audit the token verifier for alg=none bypasses and algorithm swaps.
  • Add claim validation and key rotation through JWK Sets.

How to install implementing-jwt-signing-and-verification

1Skills CLI (Vercel)

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-jwt-signing-and-verification -a claude-code

2Manually: put the files in place

~/.claude/skills/implementing-jwt-signing-and-verification/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/implementing-jwt-signing-and-verification/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about implementing-jwt-signing-and-verification

How do I install implementing-jwt-signing-and-verification in Claude Code?

Run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-jwt-signing-and-verification -a claude-code. The skill file is at ~/.claude/skills/implementing-jwt-signing-and-verification/SKILL.md.

What does implementing-jwt-signing-and-verification do?

It guides JWT signing and verification, claim and expiry checks, and defenses against common ways to bypass signature verification.

What does implementing-jwt-signing-and-verification require?

It requires Python 3.8+ with dependencies installed, familiarity with cryptography, and a test or lab environment. Testing activities need proper authorization.

Source text

SKILL.md · Apache-2.0
---
name: implementing-jwt-signing-and-verification
description: >-
  Implements secure JWT (RFC 7519) signing and verification using HMAC-SHA256,
  RSA-PSS, ES256, and EdDSA, including token expiration, claims validation, and
  defenses against algorithm-confusion, none-algorithm, and key-injection
  attacks. Use when adding or hardening JWT-based authentication/authorization,
  or when auditing token verification code for common JWT vulnerabilities.
domain: cybersecurity
subdomain: cryptography
tags:
- cryptography
- jwt
- authentication
- token-security
- digital-signatures
version: '1.0'
author: mahipal
license: Apache-2.0
nist_csf:
- PR.DS-01
- PR.DS-02
- PR.DS-10
mitre_attack:
- T1600
- T1573
- T1553
---
# Implementing JWT Signing and Verification

## Overview

JSON Web Tokens (JWT) defined in RFC 7519 are compact, URL-safe tokens used for authentication and authorization in web applications. This skill covers implementing secure JWT signing with HMAC-SHA256, RSA-PSS, and EdDSA algorithms, along with verification, token expiration, claims validation, and defense against common JWT attacks (algorithm confusion, none algorithm, key injection).


## When to Use

- When deploying or configuring implementing jwt signing and verification capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation

## Prerequisites

- Familiarity with cryptography concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities

## Objectives

- Implement JWT signing with HS256, RS256, ES256, and EdDSA
- Verify JWT signatures and validate standard claims
- Implement token expiration, not-before, and audience validation
- Defend against algorithm confusion and none algorithm attacks
- Implement JWT key rotation with JWK Sets
- Build a complete authentication middleware

## Key Concepts

### JWT Algorithms

| Algorithm | Type | Key | Security Level |
|-----------|------|-----|---------------|
| HS256 | Symmetric (HMAC) | Shared secret | 128-bit |
| RS256 | Asymmetric (RSA) | RSA key pair | 112-bit |
| ES256 | Asymmetric (ECDSA) | P-256 key pair | 128-bit |
| EdDSA | Asymmetric (Ed25519) | Ed25519 pair | 128-bit |

### Common JWT Attacks

- **Algorithm confusion**: Switching from RS256 to HS256, using public key as HMAC secret
- **None algorithm**: Setting alg=none to bypass signature verification
- **Key injection**: Embedding key in JWK header
- **Weak secrets**: Brute-forcing short HMAC secrets
- **Token replay**: Reusing valid tokens without expiration

## Security Considerations

- Always validate the algorithm header against an allowlist
- Never accept alg=none in production
- Use asymmetric algorithms (RS256, ES256) for distributed systems
- Set short expiration times (15 min for access tokens)
- Implement token refresh mechanism
- Store secrets securely (not in source code)

## Validation Criteria

- [ ] JWT signing produces valid tokens for all algorithms
- [ ] Signature verification rejects tampered tokens
- [ ] Expired tokens are rejected
- [ ] Algorithm confusion attack is prevented
- [ ] None algorithm is rejected
- [ ] JWK key rotation works correctly
- [ ] Claims validation enforces all required claims

© mahipal · Apache-2.0 · mukul975/Anthropic-Cybersecurity-Skills

Similar skills

All skills for Security →

From the same set152

The whole set →
configuring-oauth2-authorization-flow The configuring-oauth2-authorization-flow skill guides OAuth 2.0 setup for web, mobile, SPA, and machine clients. Use it when adding authorization or reviewing an existing flow. CX Codex +1 301installs exploiting-broken-function-level-authorization The exploiting-broken-function-level-authorization skill for Claude Code tests APIs for OWASP API5:2023: whether low-privilege users can invoke admin functions by manipulating HTTP methods, paths, and parameters. CX Codex +1 299installs performing-web-application-scanning-with-nikto performing-web-application-scanning-with-nikto teaches coding agents to run Nikto for web server vulnerability scanning, configuration audits, and SSL checks. Useful during planned audits or incident response. CX Codex +1 299installs exploiting-server-side-request-forgery exploiting-server-side-request-forgery — a skill for discovering and exploiting SSRF vulnerabilities in web applications: access cloud metadata, internal services, and restricted network resources during authorized penetration tests. CX Codex +1 296installs analyzing-supply-chain-malware-artifacts The analyzing-supply-chain-malware-artifacts skill investigates supply-chain malware artifacts, from altered software updates to tainted builds and sideloaded dependencies. CX Codex +1 293installs scanning-network-with-nmap-advanced scanning-network-with-nmap-advanced — a skill for advanced network reconnaissance with Nmap: host discovery, service version detection, firewall evasion, NSE vulnerability checks, and structured output parsing into XML or CSV. CX Codex +1 286installs achieving-cmmc-level-2-compliance achieving-cmmc-level-2-compliance guides defense contractors through CMMC Level 2 compliance, CUI scoping, NIST SP 800-171 Rev 2 requirements, and SPRS scoring. CX Codex +1 284installs auditing-cloud-with-cis-benchmarks auditing-cloud-with-cis-benchmarks audits AWS, Azure, and GCP environments against CIS Benchmarks using Prowler and ScoutSuite. Useful for baseline checks, finding misconfigurations, and audit prep. CX Codex +1 282installs

Project sponsors

Companies that keep this analytics open