What it does
The PASETO tool creates and verifies PASETO v4 tokens, a safer alternative to JWT. v4.local tokens are encrypted with a shared 32-byte key (XChaCha20 with a BLAKE2b MAC), so the payload is private. v4.public tokens are signed with Ed25519, so anyone with the public key can check them but only you can create them.
How to use it
- Choose v4.local or v4.public.
- Create: enter the Payload (claims) as JSON, generate or paste a key, and optionally add a Footer (readable by anyone, often a key ID) and an Implicit assertion (checked but never stored in the token). Copy the token.
- Verify: paste a token, the key, and the implicit assertion if one was used. The payload appears when the token is genuine, along with its expiry status.
Example
A v4.public token looks like this, with the payload readable but signed:
v4.public.eyJzdWIiOiI0MiIsImV4cCI6IjIwMjYtMTAtMjFUMTU6MzA6MDBaIn0…
A v4.local token's body is encrypted, so nothing in it can be read without the key:
v4.local.Rk9vYmFy…
PASETO or JWT?
| JWT | PASETO v4 | |
|---|---|---|
| Algorithm | Chosen in the token header | Fixed by the version |
| Encrypted payload | Needs a separate standard (JWE) | Built in (local) |
Classic mistakes such as alg: none |
Possible | Not possible |
| Library support | Everywhere | Growing |
Good to know
- A v4.local key is 32 bytes, entered as 64 hex characters. Keep it secret: anyone with it can read and create tokens.
- For v4.public, share only the public key. The secret key may be a 32-byte seed or a 64-byte seed plus public key.
- Expiry (
exp) in PASETO is an ISO 8601 date string, not a Unix number as in JWT.
FAQ
Is PASETO compatible with JWT libraries? No. Use a PASETO library in your language; the format is different by design.
What is the implicit assertion for? It binds the token to something the server already knows, such as a user ID, without putting that value in the token. Verification fails if it does not match.