webtoken
Rust-backed JWT
Size
The .so size on linux is ~4.4Mb, no external dependencies.
Simple RAM usage benchmark -
RAM Footprint on Import (Native Linux /proc/self/status):
jwt: 17.54 MB
webtoken: 5.14 MB
Speed
Simple benchmark comparison to PyJWT
HS256
Enc: 2.1x | Dec: 1.5x
RS256
Enc: 54.4x | Dec: 1.3x
ES256
Enc: 1.9x | Dec: 1.4x
EdDSA
Enc: 2.9x | Dec: 2.5x
ES512
Enc: 1.9x | Dec: 1.5x
More under benchmarks.
Installation
pip install webtoken
- Developed on Linux / Python 3.14
- Tests are run on and wheels are available for Linux (+ Alpine) / Windows / MacOS / FreeBSD
Usage
PyJWT Style (Drop-in Replacement)
import webtoken as jwt
key = "secret"
payload = {"sub": "1234567890", "name": "John Doe", "iat": 1516239022}
token = jwt.encode(payload, key, algorithm="HS256")
decoded = jwt.decode(token, key, algorithms=["HS256"])
print(decoded)
# {'sub': '1234567890', 'name': 'John Doe', 'iat': 1516239022}
Asyncio variants
-
The rust based encode/decode release the GIL
-
Send them away on asyncio.to_thread(), or use the provided wrappers
import webtoken as wt
payload = {"name": "Bob"}
token = await wt.encode_async(payload, "secret", algorithm="HS256")
decoded = await wt.decode_async(token, "secret", algorithms=["HS256"])
print(decoded)
# {'name': 'Bob'}
Crypto / base64 complementary utils
-
Since webtoken already has
aws-lc-rsin its standalone module, it exposes several auxiliary utilities -
This, for example, allows running tests, such as the PyJWT ported test suites, without importing cryptography
import webtoken as wt
wt.base64url_encode('bob') # utf8 strings or bytes
# b'Ym9i'
wt.base64url_decode(b'Ym9i').decode()
# 'bob'
rand_7 = wt.random_bytes(7) # Get your cryptographically secure random bytes here
priv, pub = wt.generate_key_pair('rs256')
verifier, challenge = wt.generate_pkce_pair()
Compatibility
Effort is made to make toke as compatible as possible with PyJWT. For compatibility details, See the readme under tests.
Crypto
The crypto backend is mostly based on aws-lc-rs.
XChaCha20 support, for PASETO v4 and JWE, comes via Graviola.
Metadata
Release files for webtoken 0.6.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| webtoken-0.6.5.tar.gz | 141.9 kB | With provenance | Details for webtoken-0.6.5.tar.gz |
Built distributions (wheels)
Total release size: 15.3 MB
Release files / webtoken-0.6.5.tar.gz
| Download URL | webtoken-0.6.5.tar.gz |
|---|---|
| Size | 141.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
27485e43a5a4e8b0c17abcbda9f9999cde6113ea332024f87ec97232c4af90be
|
|
BLAKE2b-256 checksum How to use checksums |
72ae718572e7d00d998ea96d01f69a33d80555186a46496ae86600b99317251b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | webtoken-0.6.5-cp315-abi3.abi3t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.15 Linux glibc 2.17+ x86-64 abi3 abi3t |
|
SHA-256 checksum How to use checksums |
d9da793dcbf02dffc00e53abd0828e9cc5957be380247351ae4e39c89484a26d
|
|
BLAKE2b-256 checksum How to use checksums |
9bb294220e9b1f9803d43965979977201a642d639aff5309cd2d37497284a328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | webtoken-0.6.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
532a7887568425bf5a182fe5afe5da11609a706ff010fe484b76549666bcabee
|
|
BLAKE2b-256 checksum How to use checksums |
5eb732c61f313ab54e6bd7d7ebd17f97b9c4e3117d07eb4db96d4dcc578da03b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | webtoken-0.6.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
b6ae7766d61aed50bfbc660cf7dd0055bbea9e5a12d449651996c5a13e93056c
|
|
BLAKE2b-256 checksum How to use checksums |
8da68107731d49b2ca7d41ca21c846f7e56de61ee29713a7a24ed30a7128e0a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | webtoken-0.6.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
e53cf30d9865747cfe8c7ebaacd239ff0e5ef731d6274fef75a2bfc95baa3193
|
|
BLAKE2b-256 checksum How to use checksums |
ccf1a81a3a06344ca8cdf2b27afff7de4ea06982f4cf3014ebe982c39f6c4384
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp312-abi3-win_amd64.whl
| Download URL | webtoken-0.6.5-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e964d1d46ea3ee4a2fb83bfbab49c5bdb58230d5397bc8a1daa059df754579dc
|
|
BLAKE2b-256 checksum How to use checksums |
18deedaee03e2ffe7d1d404c63d9d7d807465f61f3ebc012e92365e8e7000d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp312-abi3-musllinux_1_2_x86_64.whl
| Download URL | webtoken-0.6.5-cp312-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 2.2 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
593b67a5172f23dc512a4d76ec4fd9c37957634b42d8036947a4bb39a385234d
|
|
BLAKE2b-256 checksum How to use checksums |
f5f7289c0b31ca349603ed43a293b6a9cc63f43c476a1ebebd636c80ce300a93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp312-abi3-manylinux_2_28_aarch64.whl
| Download URL | webtoken-0.6.5-cp312-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
c465fa1e0c04bc7a8748396b3cb8cabca870b53c4a45f68bbaf3e58e5e056319
|
|
BLAKE2b-256 checksum How to use checksums |
161e7032cc4fd04d5da3cf331664b9097246313583cc4ebab90d42f8c09fad17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / webtoken-0.6.5-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | webtoken-0.6.5-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
a87d740d615f839ae9b34dfc59d42959b602777986fe2a8c2afde9338bdd7ea6
|
|
BLAKE2b-256 checksum How to use checksums |
227f6ed897f0b6dbe2b7b7f8df1a346a64a4d79f4ee3bfb4a1418690c9c520db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logSecurity for webtoken 0.6.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 9 files in this release have been uploaded with provenance metadata.
Attestation for webtoken-0.6.5.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.