News for hackers. Stuff that matters.
Re:Ask HN: What's the current sentiment on JWT for stateless... by vbezhenar on Friday December 13, 2019 @07:05PM (#21786819)
I'm doing everything by hand. Like byte array with timestamp (4 bytes), IP-address (4 or 16 bytes), user id (4 bytes) and so on, then this array is signed and converted to string using base64. I looked into JWT and it was absurdly long. I don't like to waste bytes.
Re:Ask HN: What's the current sentiment on JWT for stateless... by peburrows on Friday December 13, 2019 @07:26PM (#21786924)
“I don’t like to waste bytes” isn’t exactly a great reason to write off a widely accepted and deployed spec for transmitting data in a trustworthy manner and instead write your own implementation, which most likely hasn’t considered all the attack vectors the JWT (and broader JOSE) spec has considered and accounted for.

I get the motivation — and I hesitate a little bit to say this — but it’s 2019, and a few “wasted” bytes on your auth token are less than inconsequential in a world where your front-end codebase mostly like “wastes” thousands (if not millions) of bytes.

When it comes to securely transmitting data, it most often pays to lean on the work and research of others.

Re:Ask HN: What's the current sentiment on JWT for stateless... by vbezhenar on Friday December 13, 2019 @08:02PM (#21787077)
I prefer to keep it simple. JWT does not look like a simple thing.
Re:Ask HN: What's the current sentiment on JWT for stateless... by deathanatos on Friday December 13, 2019 @08:52PM (#21787270)
HTTP/2 HPACK compresses headers in such a way that the difference will be largely irrelevant.

Most connections nowadays are such that latency is overwhelmingly more important than that many bytes.

Also, IP address? You invalidate me every time I switch networks?

Re:Ask HN: What's the current sentiment on JWT for stateless... by vbezhenar on Saturday December 14, 2019 @11:47AM (#21790388)
Absolutely, if hacker steals token, he'll likely using another IP address, so token is bound to IP address, it's a very important security measure. It's easy to issue new token anyway and address does not change often.
Re:Ask HN: What's the current sentiment on JWT for stateless... by klysm on Friday December 13, 2019 @07:09PM (#21786831)
Signed how?
Re:Ask HN: What's the current sentiment on JWT for stateless... by vbezhenar on Friday December 13, 2019 @08:01PM (#21787074)
Using HMAC.