Implementing jwt signing and verification

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Implementing jwt signing and verification is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. 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/authorizat

How to use this skill

Skill file

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

Prerequisites

Objectives

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

Security Considerations

Validation Criteria

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.