Skip to main content
Challenges JWT: weak HS256 key
Cryptography Medium JWT Solves: 4

JWT: weak HS256 key

Author: CyberSamSU
Points
40

The security of a JWT signed with HS256 completely depends on the private key. If the key is a weak password (present in a dictionary), an attacker can try every password, recalculate the HMAC-SHA256 signature, and compare it with the token's signature — the matching one is the real key. This is an offline dictionary attack.

The attached jwt.txt file contains an HS256 token and the encrypted flag (hex). parollar.txt — a dictionary of candidate passwords. Find the key, then decrypt the flag:

flag = shifrlangan_flag XOR SHA-256(topilgan_kalit)

The SHA-256 key is 32 bytes, and the flag is longer than that — therefore, the key is used repeatedly (cyclically): ct[i] ^ kalit[i % 32].

Signature part: base64url(HMAC_SHA256(kalit, header_b64 + '.' + payload_b64)).

Attached files
jwt.txt Log in to download
parollar.txt Log in to download
SHA-256 checksums
jwt.txt: 2ed28356923cdea24d25a9c12d0171b7a360fb31c4b1b892ea63f5a786aa8db7
parollar.txt: 4ed34f67f53b5a2c6c60c66019dc982d0299bce797c2e86d70a46e1ae1881486
Theory: learn the topic
Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −4 pts Log in
Hint 2 −8 pts Log in
Hint 3 −12 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 27.10.2026
3. Odam 05.11.2026
4. arcanum 11.11.2026