Re:JWT (JSON Web Token) debugger
by rvz on Tuesday May 26, 2020 @02:52PM
(#23315026)
So which one is a JWT hackers?
If you know which one it is straightaway, then it is the worst choice out of all of them, (because it is not encrypted by default). I would chose the least obvious one here.
[ Parent
| on HN ]
Re:JWT (JSON Web Token) debugger
by guessmyname on Tuesday May 26, 2020 @03:49PM
(#23315653)
You can recognize JWTs without decoding by checking the string format:
JSON Web Tokens follow this format → ALGO+TokenType.Payload.Signature
So obviously the only valid JWT in your question is “B”.
B) eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9
.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6
IkhpIEhhY2tlciBOZXdzIiwiaWF0IjoxNTE2
MjM5MDIyfQ
.
IlIR9_imqGCgEVG_QUb4LhDwSeNhYc50t3Ij
5x126scVNJFQqCveblmHx__tqjaI
But this does not matter because you are not supposed to decode random strings expecting them to be JSON Web Tokens. That would be as stupid as assuming that any 32-bytes string is MD5 or any 40-bytes string is SHA1, etc. You either know what your input’s format is or you do not in which case you should not even attempt to decode it because it clearly is not a valid input.
Re:JWT (JSON Web Token) debugger
by RagingCactus on Tuesday May 26, 2020 @04:42PM
(#23316153)
And another party trick: Base64-encoded JSON objects always start with "ey".
Re:JWT (JSON Web Token) debugger
by capableweb on Tuesday May 26, 2020 @02:54PM
(#23315057)
I'm not sure what you're trying to say here? Only one of these is a valid JWT.
Re:JWT (JSON Web Token) debugger
by Sohcahtoa82 on Wednesday May 27, 2020 @03:18PM
(#23328461)
JWTs don't concern themselves with privacy, only authenticity. The fact you can read the JWT is irrelevant.
Re:JWT (JSON Web Token) debugger
by ravenstine on Tuesday May 26, 2020 @03:43PM
(#23315583)
B?