Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Today I would still use alternatives like PASETO [0] or Branca [1] tokens which the latter is a fernet-like secure alternative to JWTs.

The problem with JWTs is that they are discouraged by many cryptographers due to their "cryptographic agility" and provide a mixture of protocols which includes weak ciphers and configurations to shoot the programmer in the foot. Why include insecure ciphers in the first place? The mentioned alternatives stick to a single cipher for its intended purpose.

JWTs are inefficient for performance and are bloated in their data structure and have a performance hit when you parse the token to extract its properties compared with the same operation in other alternatives (simple session cookie require zero parsing and thus is faster).

And using them for sessions poses it own pitfalls [2] which you are better off with the alternatives or plain old session cookies.

They say that JWTs are "good when used right" but with those above footguns, that's like saying C++ is safe when used right, rather than having safe defaults.

[0] https://paseto.io/

[1] https://branca.io/

[2] http://cryto.net/~joepie91/blog/2016/06/19/stop-using-jwt-fo...



> JWTs are inefficient for performance and are bloated in their data structure and have a performance hit when you parse the token to extract its properties compared with the same operation in other alternatives (simple session cookie require zero parsing and thus is faster)

While a session ID doesn't require parsing, it is useless on it's own; a fairer comparison would be: time to validate and parse/deserialize a JWT vs time to retrieve session data from the backing store (e.g. database, redis).


Another interesting one is Macaroons [1], although the implementations have not had much activity since 2014.

[1] https://ai.google/research/pubs/pub41892



This is very interesting! Although it is very much a draft in progress.

It also references a new one I haven’t seen before, https://vanadium.github.io/concepts/security.html


I've come across PASETO before, but never heard of Branca before.

I certainly like the lack of footguns in PASETO, but I'm curious about how much real-world adoption it (or indeed other JWT alternatives) really have?


Popularity is never evidence of rigor or soundness. Lots of people do dumb things like lemmings.


While I like the sentiment, it's a little naive; I want to use something that's got real community traction, and is going to be around long-term.


Oh! I love fernet (not the library, but the alcoholic beverage)




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: