Skip to main content

A command-line toolkit for inspecting, verifying, cracking, and securing JSON Web Tokens. built to expose how JWT signing works and where it breaks.

Project description

JWT Toolkit

A command-line toolkit for inspecting, verifying, cracking, and securing JSON Web Tokens — built to expose how JWT signing works and where it breaks.

Use it to audit tokens for misconfigurations, verify signatures and standard claims (including JWKS), brute-force weak HMAC secrets against a wordlist, forge defensive attack-shaped variants for self-audit, and generate cryptographically strong secrets.

Installation

jwt-toolkit is a command-line tool, so the recommended way to install it is with pipx, which installs CLI tools into isolated environments:

pipx install jwt-toolkit

Or with pip / uv:

pip install jwt-toolkit
# or
uv tool install jwt-toolkit

Requires Python 3.13+.

Quick start

# Decode and pretty-print a token
jwt-toolkit decode <token>

# Static security audit (no key needed) — flags alg=none, weak HMAC, jwk-in-header, etc.
jwt-toolkit audit <token>
jwt-toolkit audit <token> --strict --json

# Verify signature + standard claims (exp, nbf, iat, iss, aud)
jwt-toolkit verify <token> --secret <secret> --issuer auth.example.com
jwt-toolkit verify <token> --jwks-url https://auth.example.com/.well-known/jwks.json

# Mint a JWT (HMAC or asymmetric)
jwt-toolkit sign --payload '{"sub":"1"}' --secret mysecret

# Generate defensive attack-shaped variants of a token (alg=none, alg confusion, etc.)
jwt-toolkit forge <token> --public-key key.pub.pem

# Brute-force a weak HMAC secret against a wordlist
jwt-toolkit crack <token> wordlists/common-secrets.txt --threads 8

# Generate a strong random secret
jwt-toolkit generate-secret --bits 256 --encoding base64

# Fetch the bundled common-secrets wordlist
jwt-toolkit download-wordlists --output-dir wordlists

Run jwt-toolkit COMMAND --help for command-specific options.

Commands

Command Purpose
decode Decode a JWT and pretty-print its header and payload.
sign Mint a new JWT signed with an HMAC secret or an asymmetric key.
audit Static security analysis of a JWT — no key required. CVE-referenced findings.
verify Verify the signature and standard claims of a JWT (supports JWKS).
forge Emit defensive attack-shaped variants of a JWT for self-audit.
crack Brute-force a weak HMAC secret using a wordlist.
generate-secret Emit a cryptographically strong random secret.
download-wordlists Fetch the latest common-secrets wordlist.

Scripting

Suppress the banner and color output for clean machine-readable runs:

jwt-toolkit --quiet audit <token> --json
JWT_TOOLKIT_QUIET=1 NO_COLOR=1 jwt-toolkit audit <token> --json

Use responsibly

jwt-toolkit is built for defensive work — auditing your own tokens, hardening your own systems, and learning how JWTs break. Only use it against tokens and systems you are authorized to test.

License

MIT © Khaled Saeed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jwt_toolkit-0.1.0.tar.gz (110.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jwt_toolkit-0.1.0-py3-none-any.whl (47.7 kB view details)

Uploaded Python 3

File details

Details for the file jwt_toolkit-0.1.0.tar.gz.

File metadata

  • Download URL: jwt_toolkit-0.1.0.tar.gz
  • Upload date:
  • Size: 110.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jwt_toolkit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0a7fede6e2e87804d087b4c0953e74f249b45d9ebc4df84e6c6c118ff527aaa1
MD5 2624f5dde03a1964505a40ec796d111f
BLAKE2b-256 9a8cadc6fa8d5724ea815867d9d699d80ab3f978b615b6385ee522f79c2f52b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for jwt_toolkit-0.1.0.tar.gz:

Publisher: publish.yml on KhaledSaeed18/jwt-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jwt_toolkit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jwt_toolkit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jwt_toolkit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a0a41c4e61b79747cece4bac957dd7c6b0fd65905435ec97ee550ac06a46a4a
MD5 046865a9b2ebc78deb8659f58ab76394
BLAKE2b-256 432a50f174e9a78d108174583593a94bc2c8983e62cd614c67e7db3eec20a998

See more details on using hashes here.

Provenance

The following attestation bundles were made for jwt_toolkit-0.1.0-py3-none-any.whl:

Publisher: publish.yml on KhaledSaeed18/jwt-toolkit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page