Skip to main content
Challenges HMAC and simple MAC
Cryptography Medium HMAC Solves: 10

HMAC and simple MAC

Author: CyberSamSU
Points
35

MAC (Message Authentication Code) is a code that verifies the authenticity of a message. It is correctly calculated only by a party who knows the private key. A naive method would be MAC = sha256(kalit + xabar) — but this is dangerous: due to the SHA-256 structure, an attacker can append an extension to the end of the message and generate a new valid MAC without knowing the key (length-extension attack).

That is why HMAC is used in practice. It mixes the key twice, in the inner and outer layers: HMAC(K, m) = H((K ^ opad) || H((K ^ ipad) || m)) — this completely prevents the length-extension attack.

Calculate the HMAC-SHA256 value for the given key and message:

kalit  = CYBERSAMSU_HMAC_KALIT_2026
xabar  = amount=100&to=alice&currency=usd

Answer: the hex representation of the hash value (lowercase, no spaces).

Hints 2
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −3 pts Log in
Hint 2 −7 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. Raumdeuter 08.10.2026
3. Mirjaxon Qaxxarov 27.10.2026
4. Alisher 29.10.2026
5. Odam 04.11.2026
6. arcanum 11.11.2026
7. Jasmin Xuseinova 15.11.2026
8. Odiljon Shokirov 24.11.2026
9. javohir 24.11.2026
10. Asmaa Mottery 25.11.2026