Skip to content
All writing Part 01 of 07 · Seven Blind Spots Behind a JWT Audit
Engineering · 2 min read

What Is a JWT: Three Parts and a Signature

JWT has three parts: header, payload, signature. Anyone can read the first two. The signature is the only part that needs a key.

JWT (JSON Web Token) is a signed JSON object. It has three parts separated by dots.

eyJhbGci... Header . eyJzdWIi... Payload . SflKxwRJ... Signature header: { "alg": "HS256", "typ": "JWT" } payload: { "sub": "user-42", "aud": "my-app" } signature: HMAC(secret, header + "." + payload)

Each part is base64url-encoded. Anyone can decode the header and payload. JWT is not encryption. The signature is the only part that needs a key.

PartContainsAnyone can read it?
HeaderAlgorithm, token typeYes, base64 decode
PayloadClaims (sub, aud, exp, iss)Yes, base64 decode
SignatureIntegrity proofNo, needs the key to verify

The signature answers one question: “Did someone with the key create this exact header + payload?” If an attacker changes one byte in the payload, the signature breaks.

Warning: JWT does not hide data. Do not put passwords or API keys in the payload.

From the audit: My friend’s side project stored email and displayName in the payload. That was fine. Those are not secrets. But if someone also put a password in there, it becomes public.

“The signature answers ‘was it tampered with?’ It does not answer: who signed it, who it’s for, or whether it’s still valid.”


References:

Related: back to the Seven Blind Spots Behind a JWT Audit overview · Symmetric vs Asymmetric Signing · Six Standard Claims

Tags #jwt #security #authentication
// connect

Be brave | Be wise | Be grateful

21 BreakinCode

// elsewhere
LinkedInMedium (lang: en)Life RecordYoutube
wh:~$William Hung· © 2026 Taipei · GMT+8 · Available for collaboration