PASETO Encoder, Decoder & Key Generator
Create v4.local (encrypted) and v4.public (signed) tokens, generate Ed25519 keypairs and 32-byte symmetric keys, and decode v2/v4 tokens — entirely in your browser.
What is PASETO?
PASETO (Platform-Agnostic Security Tokens) is a modern token format designed as a safer alternative to JWT. Each version pins a fixed, opinionated set of cryptographic primitives per purpose, so there is no algorithm negotiation to attack.
Create, sign, encrypt, decode, and verify PASETO tokens — entirely in your browser.
Zero-Server Tool Data Guarantee
All PASETO encoding, decoding, encryption, signing, and key generation happens entirely in your browser with the Web Crypto random number generator. Tokens and keys are never sent to any server.
How to Use
Choose version & purpose
Pick v4 (recommended). Use v4.public for signed tokens anyone can read, or v4.local for encrypted tokens that hide the payload.
Enter payload & footer
Paste a JSON payload (it's minified automatically) and optionally add a footer with a kid for key identification.
Provide or generate keys
Paste an existing key or generate one with the Random key / Keypair buttons — the matching public key is derived for you.
Encode & verify
Copy the token, then switch to the Decode tab with the same key to confirm it round-trips correctly.
Paste an existing token
Drop in a v2 or v4 token — the version and purpose are auto-detected, and v1/v3 tokens explain why they're unsupported.
Provide the key to verify or decrypt
For public tokens, add the Ed25519 public key to verify the signature. For local tokens, add the 32-byte symmetric key to decrypt the payload.
Common Use Cases
API Authentication
Replace JWTs with signed PASETO tokens for stateless API auth. The Ed25519 signature provides strong authenticity without algorithm negotiation risks.
Encrypted Session Data
Encrypt session claims into v4.local tokens so the payload stays confidential while the kid footer tells the server which key to use.
Secure Communication
Exchange encrypted PASETO tokens between services as a lightweight, self-contained encrypted message format.
Key Provisioning
Generate Ed25519 keypairs and 32-byte symmetric keys for local development, then move them into your real key management system.
Audit & Debugging
Decode a token from production to check the payload, footer, and kid, and confirm the signature or encryption is still valid.
Audit Trail Logging
Sign log entries with v4.public to create tamper-evident audit trails that can be verified long after creation.
Implementation Examples
// Install: npm install pasetoconst paseto = require('paseto');const { Signer, Verifier } = paseto.V4;async function example() {// Generate an Ed25519 keypairconst secretKey = await Signer.generate();const publicKey = await Verifier.generate();// Sign a v4.public token, carrying the key ID in the footerconst token = await Signer.sign({ sub: 'user123', role: 'admin' },secretKey,{ footer: '{"kid":"signing-key-1"}', expiresIn: '1h' });console.log('v4.public:', token);// Verify (footer must match)const payload = await Verifier.verify(token, publicKey, { footer: '{"kid":"signing-key-1"}' });console.log('Verified:', payload);}
PASETO versions
| Version | Signed (public) | Encrypted (local) | Status |
|---|---|---|---|
| v1 | RSA (RSASSA-PSS) | AES-128-CTR + HMAC-SHA384 | Legacy — avoid |
| v2 | Ed25519 | XChaCha20-Poly1305 | Deprecated — avoid |
| v3 | Ed448 | AES-256-CTR + HMAC-SHA384 | NIST-compatible |
| v4 | Ed25519 | XChaCha20-Poly1305 | Recommended |
PASETO vs JWT
| Feature | PASETO v4 | JWT (JWS/JWE) |
|---|---|---|
| Algorithm choice | Fixed per purpose (safe) | Flexible (risky) |
| Encryption | XChaCha20-Poly1305 | Depends on header (often AES-CBC) |
| Signing | Ed25519 (EdDSA) | RS256, ES256, HS256, etc. |
| Algorithm confusion attacks | Impossible by design | Common vulnerability |
| Token size | Compact (binary payload) | Larger (Base64 JSON) |
| Ecosystem maturity | Growing (smaller community) | Massive (industry standard) |
| Header/kid support | Footer field | kid header parameter |
| Library availability | Good (JS, Python, Go, Rust) | Excellent (every language) |
| alg:none / unverified header | Not possible — purpose is fixed | Historic vulnerability |
Production Best Practices & Security
Frequently Asked Questions
PASETO (Platform-Agnostic Security Tokens) is a token format designed as a secure alternative to JWT and JOSE.
Unlike JWT, which lets you choose from many algorithms (including insecure options like none or alg:none), PASETO uses versioned protocols with fixed, modern cryptographic primitives per version. This eliminates algorithm confusion attacks, weak algorithm selection, and other common JWT vulnerabilities.
PASETO tokens have a simple structure: version (like v4), purpose (local for encryption or public for signatures), and the encoded payload.