Difference between MD5,SHA1,SHA2 and MD4 algorithms


  • Hello every one,

    Can any one help me out in understanding what really is the difference between SHA1,SHA2,MD4 and MD5 algorithms in terms of data of  a table.

    Which is the precise situation to opt which algorithm. ?

    How HASH_BYTES() treats each Algorithm?

    Please Help


    Thanks n Regards


    Wednesday, July 27, 2011 1:48 PM


  • Hi Pavan-SqlServer,

    As to the difference between these algorithms, please view the article: Comparison of cryptographic hash functions. You can choose an appropriate algorithm based on the comparison.

    For using HASHBYTES with MD2, MD4, MD5, SHA, or SHA1, please take a look at: HASHBYTES (Transact-SQL).
    Best Regards,
    Stephanie Lv

    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    Friday, July 29, 2011 6:05 AM