[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6AF7EHRPJM0ER1H8RAQ4KQ1":3,"skill-same:01M6AF7EHRPJM0ER1H8RAQ4KQ1":112},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":53,"commitSha":54,"skillDirectory":55,"forksCount":56,"repositoryHtmlUrl":57,"repositoryHomepageUrl":58,"ownerHtmlUrl":59,"ownerBlogUrl":60,"ownerDescription":61,"updatedAt":62,"install":63,"resources":76},"01M6AF7EHRPJM0ER1H8RAQ4KQ1","implementing-jwt-signing-and-verification",null,"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\u002Fauthorization, or when auditing token verification code for common JWT vulnerabilities.","mukul975\u002FAnthropic-Cybersecurity-Skills","mukul975","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F42860185?v=4","01M6ADEQR8T5M4EEG6C67BQCWF","Mahipal","01M6ADJPMYWG1E5GM1FWBE3128",36078,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"implementing jwt signing and verification","jwt","verification","hardening","token-security","digital-signatures","algorithm-confusion","injection","authorization","cryptography","security","validation","authentication","code","pr","secure","vulnerabilities","cybersecurity","2026-11-10 10:12:30",false,"---\nname: implementing-jwt-signing-and-verification\ndescription: >-\n  Implements secure JWT (RFC 7519) signing and verification using HMAC-SHA256,\n  RSA-PSS, ES256, and EdDSA, including token expiration, claims validation, and\n  defenses against algorithm-confusion, none-algorithm, and key-injection\n  attacks. Use when adding or hardening JWT-based authentication\u002Fauthorization,\n  or when auditing token verification code for common JWT vulnerabilities.\ndomain: cybersecurity\nsubdomain: cryptography\ntags:\n- cryptography\n- jwt\n- authentication\n- token-security\n- digital-signatures\nversion: '1.0'\nauthor: mahipal\nlicense: Apache-2.0\nnist_csf:\n- PR.DS-01\n- PR.DS-02\n- PR.DS-10\nmitre_attack:\n- T1600\n- T1573\n- T1553\n---\n# Implementing JWT Signing and Verification\n\n## Overview\n\nJSON 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).\n\n\n## When to Use\n\n- When deploying or configuring implementing jwt signing and verification capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Familiarity with cryptography concepts and tools\n- Access to a test or lab environment for safe execution\n- Python 3.8+ with required dependencies installed\n- Appropriate authorization for any testing activities\n\n## Objectives\n\n- Implement JWT signing with HS256, RS256, ES256, and EdDSA\n- Verify JWT signatures and validate standard claims\n- Implement token expiration, not-before, and audience validation\n- Defend against algorithm confusion and none algorithm attacks\n- Implement JWT key rotation with JWK Sets\n- Build a complete authentication middleware\n\n## Key Concepts\n\n### JWT Algorithms\n\n| Algorithm | Type | Key | Security Level |\n|-----------|------|-----|---------------|\n| HS256 | Symmetric (HMAC) | Shared secret | 128-bit |\n| RS256 | Asymmetric (RSA) | RSA key pair | 112-bit |\n| ES256 | Asymmetric (ECDSA) | P-256 key pair | 128-bit |\n| EdDSA | Asymmetric (Ed25519) | Ed25519 pair | 128-bit |\n\n### Common JWT Attacks\n\n- **Algorithm confusion**: Switching from RS256 to HS256, using public key as HMAC secret\n- **None algorithm**: Setting alg=none to bypass signature verification\n- **Key injection**: Embedding key in JWK header\n- **Weak secrets**: Brute-forcing short HMAC secrets\n- **Token replay**: Reusing valid tokens without expiration\n\n## Security Considerations\n\n- Always validate the algorithm header against an allowlist\n- Never accept alg=none in production\n- Use asymmetric algorithms (RS256, ES256) for distributed systems\n- Set short expiration times (15 min for access tokens)\n- Implement token refresh mechanism\n- Store secrets securely (not in source code)\n\n## Validation Criteria\n\n- [ ] JWT signing produces valid tokens for all algorithms\n- [ ] Signature verification rejects tampered tokens\n- [ ] Expired tokens are rejected\n- [ ] Algorithm confusion attack is prevented\n- [ ] None algorithm is rejected\n- [ ] JWK key rotation works correctly\n- [ ] Claims validation enforces all required claims\n","# Implementing JWT Signing and Verification\n\n## Overview\n\nJSON 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).\n\n\n## When to Use\n\n- When deploying or configuring implementing jwt signing and verification capabilities in your environment\n- When establishing security controls aligned to compliance requirements\n- When building or improving security architecture for this domain\n- When conducting security assessments that require this implementation\n\n## Prerequisites\n\n- Familiarity with cryptography concepts and tools\n- Access to a test or lab environment for safe execution\n- Python 3.8+ with required dependencies installed\n- Appropriate authorization for any testing activities\n\n## Objectives\n\n- Implement JWT signing with HS256, RS256, ES256, and EdDSA\n- Verify JWT signatures and validate standard claims\n- Implement token expiration, not-before, and audience validation\n- Defend against algorithm confusion and none algorithm attacks\n- Implement JWT key rotation with JWK Sets\n- Build a complete authentication middleware\n\n## Key Concepts\n\n### JWT Algorithms\n\n| Algorithm | Type | Key | Security Level |\n|-----------|------|-----|---------------|\n| HS256 | Symmetric (HMAC) | Shared secret | 128-bit |\n| RS256 | Asymmetric (RSA) | RSA key pair | 112-bit |\n| ES256 | Asymmetric (ECDSA) | P-256 key pair | 128-bit |\n| EdDSA | Asymmetric (Ed25519) | Ed25519 pair | 128-bit |\n\n### Common JWT Attacks\n\n- **Algorithm confusion**: Switching from RS256 to HS256, using public key as HMAC secret\n- **None algorithm**: Setting alg=none to bypass signature verification\n- **Key injection**: Embedding key in JWK header\n- **Weak secrets**: Brute-forcing short HMAC secrets\n- **Token replay**: Reusing valid tokens without expiration\n\n## Security Considerations\n\n- Always validate the algorithm header against an allowlist\n- Never accept alg=none in production\n- Use asymmetric algorithms (RS256, ES256) for distributed systems\n- Set short expiration times (15 min for access tokens)\n- Implement token refresh mechanism\n- Store secrets securely (not in source code)\n\n## Validation Criteria\n\n- [ ] JWT signing produces valid tokens for all algorithms\n- [ ] Signature verification rejects tampered tokens\n- [ ] Expired tokens are rejected\n- [ ] Algorithm confusion attack is prevented\n- [ ] None algorithm is rejected\n- [ ] JWK key rotation works correctly\n- [ ] Claims validation enforces all required claims\n",{"name":5,"tags":42,"author":43,"domain":36,"license":15,"version":44,"nist_csf":45,"subdomain":28,"description":7,"mitre_attack":49},[28,20,31,23,24],"mahipal","1.0",[46,47,48],"PR.DS-01","PR.DS-02","PR.DS-10",[50,51,52],"T1600","T1573","T1553","main","54a798831d2266a3ca61ce68a7acb80b81160d57","skills\u002Fimplementing-jwt-signing-and-verification",4414,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills","https:\u002F\u002Fmahipal.engineer\u002FAnthropic-Cybersecurity-Skills\u002F","https:\u002F\u002Fgithub.com\u002Fmukul975","Mahipal.engineer","🔐 Cybersecurity | 💻 Dev | 📷 Street Photographer\r\n🎓 MSc | 📚 Research & AI Security","2026-08-31 12:32:44",{"source":8,"skillName":5,"commands":64,"prompt":74,"zipAvailable":75},[65,68,71],{"tool":66,"command":67},"npx","npx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill implementing-jwt-signing-and-verification",{"tool":69,"command":70},"bunx","bunx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill implementing-jwt-signing-and-verification",{"tool":72,"command":73},"pnpm","pnpm dlx skills add mukul975\u002FAnthropic-Cybersecurity-Skills --skill implementing-jwt-signing-and-verification","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002FSKILL.md",true,[77,83,88,94,98,102,108],{"path":78,"resourceType":79,"resourceTypeDesc":80,"sizeBytes":81,"sourceHtmlUrl":82},"assets\u002Ftemplate.md","ASSET","资产文件",1217,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002Fassets\u002Ftemplate.md",{"path":84,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"LICENSE","许可证",11255,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002FLICENSE",{"path":89,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":92,"sourceHtmlUrl":93},"references\u002Fapi-reference.md","REFERENCE","参考文档",1685,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002Freferences\u002Fapi-reference.md",{"path":95,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":96,"sourceHtmlUrl":97},"references\u002Fstandards.md",1183,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002Freferences\u002Fstandards.md",{"path":99,"resourceType":90,"resourceTypeDesc":91,"sizeBytes":100,"sourceHtmlUrl":101},"references\u002Fworkflows.md",1163,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002Freferences\u002Fworkflows.md",{"path":103,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":106,"sourceHtmlUrl":107},"scripts\u002Fagent.py","SCRIPT","脚本",7492,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002Fscripts\u002Fagent.py",{"path":109,"resourceType":104,"resourceTypeDesc":105,"sizeBytes":110,"sourceHtmlUrl":111},"scripts\u002Fprocess.py",10936,"https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fimplementing-jwt-signing-and-verification\u002Fscripts\u002Fprocess.py",[113,141,164,191,217,243],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":124,"publishedAt":37},"01M6AGDM3HJXTKXX15ZZ0ZVCJ3","verifying-build-provenance-with-slsa-sigstore","Verifies artifact signatures and SLSA provenance using Sigstore's cosign (verify, verify-attestation, verify-blob-attestation) and slsa-verifier (verify-artifact), enforcing keyless OIDC builder identity and source repo against SLSA Build levels. Use in CI\u002FCD before deploying artifacts, when consuming third-party attestations, establishing a SLSA Build L3 pipeline, or confirming provenance during incident response or admission control.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fverifying-build-provenance-with-slsa-sigstore\u002FSKILL.md",[119],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",[125,126,127,128,29,36,129,130,33,32,131,132,133,134,135,136,137,138,139,140],"sigstore","provenance","slsa","verifying build provenance with slsa sigstore","incident response","identity","artifacts","ci","supply-chain","pipeline","supply-chain-security","t1195","attestation","code-signing","cosign","keyless",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":148,"publishedAt":37},"01M6AGDGBPWYVZ2F11GFKJ4HZ9","validating-tpm-measured-boot-attestation","Verifies TPM 2.0 measured-boot integrity and remote attestation with tpm2-tools -- reading PCRs (tpm2_pcrread), replaying the boot event log, generating and checking signed quotes (tpm2_quote\u002Ftpm2_checkquote), and sealing secrets to a PCR policy. Use to confirm a system booted trusted firmware\u002Fkernel for Zero Trust device posture, detect boot-chain tampering via PCR drift, or build a golden-value baseline for fleet attestation.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-tpm-measured-boot-attestation\u002FSKILL.md",[147],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},[149,137,150,151,29,152,36,33,21,153,154,155,156,157,158,159,160,161,162,163],"boot","TPM","validating tpm measured boot attestation","policy","ZeRO","firmware","Tools","measured-boot","PCR","integrity","secrets","remote-attestation","tpm2-tools","integrity-verification","trusted-computing",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":174,"publishedAt":37},"01M6AGDCW0Y4FXZ3362GT1941M","validating-backup-integrity-for-recovery","Validates backup integrity through cryptographic hash verification, automated restore testing, corruption detection, and recoverability checks to confirm backups are reliable for disaster recovery and ransomware response. Use before relying on backups for recovery, when building post-backup validation pipelines, auditing backup infrastructure for compliance, or checking immutable\u002Fair-gapped backups for silent corruption or tampering.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Fvalidating-backup-integrity-for-recovery\u002FSKILL.md",[170,173],{"categoryNo":171,"categoryName":172,"taxonomyType":122,"taxonomyTypeDesc":123},"01JBSEEDCAT000000000000008","测试与质量",{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},[158,175,176,177,178,36,179,30,21,180,181,182,183,184,185,186,187,188,189,190],"backup","recovery","validating backup integrity for recovery","testing","infrastructure","compliance","hash-verification","incident-response","ransomware","cryptocurrency","detection","t1078","t1490","immutable","disaster-recovery","restore-testing",{"skillNo":192,"name":193,"nameZh":6,"description":194,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":195,"categories":196,"keywords":198,"publishedAt":37},"01M6AGD9GBG2KZ336AE763J3WH","triaging-windows-with-kape","Runs KAPE (Kroll Artifact Parser and Extractor) to collect targeted forensic artifacts (registry hives, $MFT, event logs, prefetch, browser data) via Targets and parse them with Modules wrapping Eric Zimmerman's EZ Tools (PECmd, MFTECmd, RECmd). Use during early incident containment\u002Ftriage when full disk imaging is impractical but a defensible, parseable Windows artifact set is needed quickly, including at-scale remote collection.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-windows-with-kape\u002FSKILL.md",[197],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},[199,200,201,36,202,203,204,205,206,207,208,209,210,211,212,213,155,214,215,216],"windows","kape","triaging windows with kape","registry","browser","logs","windows-forensics","dfir","mft","mftecmd","data","prefetch","eric-zimmerman","digital-forensics","SET","collection","pecmd","artifact-collection",{"skillNo":218,"name":219,"nameZh":6,"description":220,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":221,"categories":222,"keywords":224,"publishedAt":37},"01M6AGD5PW5J4EVZM958WD74ZQ","triaging-vulnerabilities-with-ssvc-framework","Triages and prioritizes vulnerabilities with CISA's Stakeholder-Specific Vulnerability Categorization (SSVC) decision tree, weighing exploitation status (via the CISA KEV catalog and FIRST EPSS API), technical impact, automatability, and mission prevalence to output Track\u002FTrack*\u002FAttend\u002FAct decisions. Use when prioritizing vulnerability scan results (OpenVAS, Nessus, Qualys) for remediation planning beyond raw CVSS scores.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-vulnerabilities-with-ssvc-framework\u002FSKILL.md",[223],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},[35,225,226,36,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242],"framework","triaging vulnerabilities with ssvc framework","status","planning","CISA","vulnerability-management","risk-management","nessus","qualys","openvas","cvss","remediation","risk","vulnerability","api","prioritization","ssvc","decision-tree",{"skillNo":244,"name":245,"nameZh":6,"description":246,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":247,"categories":248,"keywords":250,"publishedAt":37},"01M6AGD24TTQQM4CXG69E3B9TJ","triaging-security-incident","Performs initial triage of security incidents using the NIST SP 800-61r3 and SANS PICERL frameworks, classifying incident type, assigning priority by business impact, and routing to the appropriate response team. Use when a SIEM\u002FEDR alert needs human classification, concurrent alerts must be prioritized, or a user report or threat-intel IOC match requires initial incident categorization.","https:\u002F\u002Fgithub.com\u002Fmukul975\u002FAnthropic-Cybersecurity-Skills\u002Fblob\u002Fmain\u002Fskills\u002Ftriaging-security-incident\u002FSKILL.md",[249],{"categoryNo":120,"categoryName":121,"taxonomyType":122,"taxonomyTypeDesc":123},[29,251,36,252,253,254,255,256,257,258,259,186,260,187,261,262,263,264,265,266],"triaging security incident","siem","file","ioc","soc","NIST-800-61","NIST","severity","edr","execution","analysis","classification","severity-classification","incident-triage","SANS-PICERL","SOC-operations"]