What is a PASERK key?
PASETO is a token format that was designed as a safer alternative to JWT. It fixes the main problems of JWT by removing the choice of algorithm: each PASETO version has fixed, modern cryptography. PASERK is the companion standard that says how to write PASETO keys as text, so they can be stored, copied and shared. A PASERK is simple: the version (k4, k3 or k2), the type (local, public or secret), and the key bytes in URL-safe Base64, joined by dots. You can read the specification at github.com/paseto-standard/paserk.
This page makes new keys for three versions. v4 uses Ed25519 for public tokens and XChaCha20-Poly1305 for local tokens, and it is the one to choose for new systems. v3 uses only NIST algorithms (P-384, AES-256-CTR and HMAC-SHA-384), for systems that must follow them. v2 is the old version. Prefer v4 unless you must talk to a system that still uses v2.
You get two kinds of key. A local key is symmetric: one secret that both encrypts and reads local tokens, so it stays on the servers that issue and read them. A key pair has a secret key that signs public tokens and a public key that only verifies them, and the public key can be shared. For each key the page also gives a key id: lid for local keys, pid for public keys and sid for secret keys. The id is a hash of the PASERK, so it is safe to put in logs and in token footers to say which key was used, without exposing the key.
You can paste an existing PASERK to read it. The page shows its id, and for a secret key it shows the matching public key. The keys are made in your browser with the secure random generator and are never sent anywhere. The page is checked against the official PASERK test vectors. If you want a plain random secret for something else, use the token generator. To compare with the older format, see JWT, and for more on key pairs see public-key cryptography.
How to generate PASERK keys
- Choose PASETO version: v4, v3 or v2. The short help under it explains the choice.
- Click Generate new keys. Each click makes a fresh set.
- Under Local key (symmetric) copy Key: and, if you need it, Key id:. Keep the key on your servers.
- Under Public and secret key pair copy Secret key (keep it secret): and Public key:, and their ids. Put the secret key in your secret manager. Give the public key to those who verify tokens.
- To inspect a key you already have, paste it in Paste a PASERK (local, public or secret): under Read a PASERK.
- For a secret key, read Public key of this secret key:. For any key, read its id (Key id (lid):, Public key id (pid): or Secret key id (sid):).
Examples
A local key of all zero bytes
This is a test vector from the PASERK repository. It is for reading and testing only, never for real use. A v4 local key whose 32 bytes are all zero is written as:
k4.local.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIts key id, as listed in the official vectors, is:
k4.lid.bqltbNc4JLUAmc9Xtpok-fBuI0dQN5_m3CD9W_nbh559Paste the first line into Read a PASERK and the page shows that id.
A different test key
The 32 bytes 70 71 72 ... 8f (hex 707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f) are another official vector. As a v4 local key they give:
k4.local.cHFyc3R1dnd4eXp7fH1-f4CBgoOEhYaHiImKi4yNjo8Notice that the text after k4.local. is just those bytes in Base64 without padding, using - and _ instead of + and /.
What a new set looks like
After Generate new keys with v4, you get a local key, a secret key and a public key, plus three ids. They are random, so yours will differ, and they have this shape: k4.local.…, k4.secret.…, k4.public.…, k4.lid.…, k4.pid.…, k4.sid.…. A v4 secret key is 64 bytes (the seed and the public key), a v4 public key is 32 bytes, and a v3 public key is a 49-byte compressed point.
Common errors and how to fix them
- "The key has {length} bytes; this version and type need {expected}.": the key was cut, or you mixed versions. A v4 local key is 32 bytes, a v4 secret 64 and a v3 secret 48.
- "This is not a PASERK. It looks like k4.local.… , k4.public.… or k4.secret.… (also k3 and k2).": you pasted something else, such as a PASETO token (
v4.public.…) or a JWT. A token starts withv, a key starts withk. - "The public key can only be derived from a secret key.": you asked for the public key of a key that is already public or local. Paste the secret one.
- The other service rejects the key: check the version. A
k4key does not work withk3tokens. - Spaces or line breaks in the key: copy again without extra characters.
Frequently asked questions
Are PASERK keys the same as PASETO tokens?
No. A token carries a message and a signature or encryption. A PASERK is a key. The names look alike, but tokens begin with v4. and keys with k4..
Is it safe to share the key id?
Yes. The id is a hash of the key and does not reveal it. It is made for logs and for token footers, so a verifier can pick the right key. Never share the key itself, except a public key.
Should I use v4, v3 or v2?
Use v4 for new work. Use v3 only when you must stay within NIST algorithms. v2 is the old version and is kept for compatibility.
Can I use these keys in production?
The keys come from the browser's secure random generator, so they are strong. But a key shown on a web page can pass through extensions, history and clipboard managers. For production, make keys on a trusted machine or in your secret manager.