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

Symmetric vs Asymmetric Signing

HS256 shares one secret for signing and verification. RS256 uses two keys. The choice depends on one question: can the verifier be trusted with signing power?

Signing proves who created the token. It does not hide the token. Two signing families exist, each with a different trust model.

SYMMETRIC (HS256) one shared secret secret "abc123" signs AND verifies ASYMMETRIC (RS256) private key + public key private (secret) public (shared) signs only verifies only

Symmetric (HS256): HMAC + SHA-256. One key. The signer and the verifier share it. If the key leaks, anyone can forge tokens.

Asymmetric (RS256): RSA + SHA-256. Two keys. The private key signs. The public key verifies. The public key is safe to share because it cannot sign.

HS256 (symmetric)RS256 (asymmetric)
Keys1 shared secret2 (private + public)
Who can signAnyone with the secretOnly the private key holder
Who can verifyAnyone with the secretAnyone with the public key
Use whenAll services trust each otherVerifiers must not have signing power

From the audit: The side project uses HS256. auth-service, lobby-service, and game-server share one JWT_SECRET. This works. Lobby and game-server only verify, never sign. But if an external service ever needs to verify tokens, the project must switch to RS256.

“Symmetric or asymmetric? Answer one question: can the verifier be trusted with signing power?”


References:

Related: back to the Seven Blind Spots Behind a JWT Audit overview · What Is a JWT · Algorithm Confusion and the none Attack

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