Neither SHA-1 nor SHA-2 are patented or protected by any such intellectual property. You can use them freely for any purpose. NIST (which is the US federal agency that standardized SHA-1 and SHA-2) actually holds an open competition to select the next standard hash function (tentatively called β SHA-3 β), and the explicit requirement for candidates is that in in the event of their final choice, they should be stripped of any patent or copyright or anything else. SHA-3 will be used as freely as SHA-1 and SHA-2.
source share