# Difference between SHA1 and SHA1HMAC? [duplicate]

Can anyone let me know the difference between SHA1 and SHA1HMAC algo?

• HMAC takes a key, plain SHA-1 does not. – CodesInChaos Nov 7 '15 at 19:26
• @CodesInChaos you mean SHA1(Data) and SHA1(Data + Key)? Can you please explain? – user960567 Nov 8 '15 at 5:43
• SHA1 only has one parameter, the data. HMAC-SHA-1 has two parameters, key and data. Simply concatenating key and data and passing them to SHA-1 is not a good idea. SHA1(Data + Key) is much weaker than HMAC-SHA-1, since it relies on collision resistance. SHA1(Key + Data) is totally broken, due to length extensions. – CodesInChaos Nov 8 '15 at 8:05