SHA1-MAC: Length-Extension Attack
Description
ΠΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡ ΡΡΠ½ΠΊΡΠΈΡ SHA1 ΠΊΠ°ΠΊ MAC Π½Π΅Π±Π΅Π·ΠΎΠΏΠ°ΡΠ½ΠΎ:
ΠΡΠ°ΠΊΡΡΡΠΈΠΉ ΠΌΠΎΠΆΠ΅Ρ ΠΏΠΎΠ΄Π΄Π΅Π»Π°ΡΡ ΠΏΠΎΠ΄ΠΏΠΈΡΡ Π΄Π»Ρ ΡΠ²ΠΎΠ΅Π³ΠΎ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΡ, Π½Π΅ Π·Π½Π°Ρ ΠΊΠ»ΡΡΠ°.
Length-Extension Attack: https://dzone.com/articles/forging-a-sha-1-mac-using-a-length-extension-attac https://cryptopals.com/sets/4/challenges/29
Short
Bad:
hash(KEY || MESSAGE || PADDING)
Usable:
hash(MESSAGE || KEY || PADDING)
Good:
hmac(MESSAGE || KEY || PADDING)
Tools
Last updated