OWASP / Go-SCP

Golang Secure Coding Practices guide

Home Page:https://owasp.org/www-project-go-secure-coding-practices-guide/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

suggestion: be more precise in hashing language

kardianos opened this issue · comments

On page
https://github.com/Checkmarx/Go-SCP/blob/b6faece923bfdccfcc04de1b3994752721ef1ce3/docs/cryptographic-practices/README.md

both MD5 and SHA256 are discussed. SHA256 is stated to be "stronger".

It may be more precise to say that "MD5 and SHA1 may be susceptible to hash collision attacks (making the same hash from different content), while SHA256 is not known to be susceptible to such collisions."

The only discussion of MD5 should be, "MD5 was used in the past but is no longer safe. Do not design new systems that use it. Work actively to replace it in existing systems." See https://security.stackexchange.com/questions/52461/how-weak-is-md5-as-a-password-hashing-function for example.

Well, I hope you are using neither MD5 or SHA256 for hashing a password. If this is what is intended, then the page needs a rewrite.

Hi @kardianos,
I see your point and I agree to make "stronger", more precise.

@jeffallen Being "too fast" makes MD5 not a proper choice for password hashing, but there are still use cases where MD5 is a viable choice exactly because it is fast.

MD5 is the most well known hashing algorithm so I think it worth to be here so that readers feel themselves comfortable with the subject. Nevertheless your concern is valid when talking about password hashing.

I will work on detailing hash collisions and Rainbow Tables attacks.

@kardianos @jeffallen @PauloASilva I'd appreciate your comments to my change suggestions on #31