javascript - Problem with JSON Web Token
阿神
阿神 2017-05-24 11:38:28
0
2
644

JWT consists of three parts: header, payload, and signature. In the header, we define the encryption algorithm HMAC sha256.

Finally generated token = header_base64 . payload_base64 . signature_encryption .
The hmac here is an irreversible algorithm. How is it possible to parse the original information (such as the expiration time in the payload) from the token for judgment.

I don’t know where I misunderstood JWT.

阿神
阿神

闭关修行中......

reply all(2)
刘奇

You misunderstood. In fact, the encryption process is signature.
If the signature calculation is inconsistent, it is considered that the token has been tampered with. In fact, the first two fields are not encrypted, just base64

刘奇

JWT uses . to connect all values. . . The signature is determined by the backend to determine whether it has been tampered with, and the information is in the header and payload

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template