Asymmetric algorithms like RS256 sign tokens with a private key and verify them with a public key, whereas symmetric algorithms like HS256 use a single shared secret for both signing and verification.
If an application exposes its RSA public key and fails to enforce the expected algorithm, an attacker can switch alg to HS256 and sign a forged token using the server's public key as the HMAC secret.
In real-world targets, servers rarely hand you a ready-made PEM file—instead, they expose the raw modulus (n) and exponent (e) via /.well-known/jwks.json.
For extra practice, try reconstructing this PKIX PEM file from the JWKS endpoint and verify that your output matches the reference key below byte-for-byte (including the trailing newline).
Available directly or via /Alg_Confusion/public.pem:
Lab created by Robin Wood - DigiNinja