Skip to content

Decode JWT token and verify signature - #2454

Closed
hl6226 wants to merge 32 commits into
gchq:masterfrom
hl6226:jwt-decode-verify
Closed

hl6226 wants to merge 32 commits into
gchq:masterfrom
hl6226:jwt-decode-verify

Conversation

@hl6226

@hl6226 hl6226 commented May 25, 2026

Copy link
Copy Markdown

Decode JWT token and verify signature

Description

  1. Decode JWT token and show both header and payload
  2. Verify signature supporting three formats of public key
  3. Show header, payload and signature sections in different colors
  4. Show formatted date string of iat, nbf and exp claims, e.g., iat: Sun, 24 May 2026 16:32:20 GMT
  5. Validate whether the token has expired

Existing Issue

  1. Existing JWT Decode operation only shows payload but does not show header section
  2. Existing JWT Verify operation does not support JSON format public key
  3. Existing JWT Decode or JWT Verify operation does not show different colors in either Input or Output fields
  4. Existing JWT Verify operation shows error "Right hand side of instanceof is not an object", as reported at: Bug report: JWT sign broken again #2434
  5. Existing JWT Decode operation only shows number of iat, nbf and exp claim, e.g., iat: 1779640340

Screenshots
If the pull request changes any visual aspects of CyberChef, please include screenshots.
CyberChef - JWT Decode and Verify.pdf

AI disclosure
If you have used any AI tools while creating this code, you must declare your usage along with the name of the tools that you used.
Regardless of AI tool usage, you are responsible for any code that you submit, and we expect you to have checked the code and have enough of an understanding of it to answer any questions we might have.
I used Amazon Q. I read through every line of changed/new code and tested it in http://localhost:8080.

Test Coverage
Please ensure you have added test coverage for your changes.

…ture supporting three formats of public key; 3. Show header, payload and signature sections in different colors
@CLAassistant

CLAassistant commented May 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@hl6226

hl6226 commented Aug 2, 2026

Copy link
Copy Markdown
Author

Hi @GCHQDeveloper581, do you mind reviewing this pull request! Thanks in advance!

@GCHQDeveloper581 GCHQDeveloper581 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe that we can justify making changes to core parts of the system (src/web/waiters) in order to enhance presentation for a single operation.

@hl6226

hl6226 commented Aug 9, 2026

Copy link
Copy Markdown
Author

I don't believe that we can justify making changes to core parts of the system (src/web/waiters) in order to enhance presentation for a single operation.

Hi @GCHQDeveloper581 , the existing functions cannot show text in different colors.

  • In https://www.jwt.io/, 3 different colors are used to display JWT header/payload/signature separately
  • As shown in my screenshots, both input and output sections can display 3 colors
  • With this enhancement, in future, other operations may also customize color when necessary

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution - unfortunately this repository only accepts pull requests from organisation members or approved outside collaborators. Due to that, this pull request has been closed automatically.

@github-actions github-actions Bot closed this Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants