<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">Wikipedia has some information.</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">    </span><a href="https://en.wikipedia.org/wiki/Secure_Hash_Algorithms" class="">https://en.wikipedia.org/wiki/Secure_Hash_Algorithms</a></div><div class=""><br class=""></div><div class="">What is produced by "dgst -sha" is what the above link is calling SHA-0 (originally just called SHA).</div><div class=""><br class=""></div><div class="">All the best,</div><div class="">  -Dave</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 25, 2017, at 22:44, Swapnil Deshpande <<a href="mailto:swapnilddeshpande@gmail.com" class="">swapnilddeshpande@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<div class=""><br class=""></div><div class="">Noob here. I recently discovered that the "-sha1" and "-sha" flags in the "openssl dgst" command produce different outputs. I thought those were the same algorithms but turns out they are not:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">$ echo -n "password" | openssl dgst -sha</span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">80072568beb3b2102325eb203f6d0ff92f5cef8e</span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br class=""></span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">$ echo -n "password" | openssl dgst -sha1</span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures">5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8</span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br class=""></span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal" class="">I am aware of SHA1 and the SHA-128 algorithm. </span></span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal" class=""><br class=""></span></span></div><div style="margin: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: normal; font-weight: normal; font-size: 11px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-variant-ligatures:no-common-ligatures"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal" class="">1. What algorithm is used to generate hash when I use the "-sha" option?</span><br class=""></span></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><span class="gmail-s1" style="font-family: Menlo; font-size: 11px; font-style: normal; font-variant-ligatures: no-common-ligatures; font-variant-caps: normal; font-weight: normal;"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal" class="">2. What could I have done to get this answer to #1 in a better way? I am asking this because I tried to find what algorithm is being used through the "help" option as well as trying to search via "man openssl" but couldn't find anything. I also did a basic search for "</span></span>openssl sha vs sha1" and couldn't find any relevant results. If there was a better way to know more about this option (say by reading some documentation), I'd be glad to know about it. </div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">Merry Christmas. </div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; background-color: rgb(255, 255, 255);" class=""><br class=""></div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">Regards,</div><div style="margin: 0px; font-variant-numeric: normal; font-variant-east-asian: normal; line-height: normal; background-color: rgb(255, 255, 255);" class="">Swapnil</div></div></div>
-- <br class="">openssl-users mailing list<br class="">To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" class="">https://mta.openssl.org/mailman/listinfo/openssl-users</a><br class=""></div></blockquote></div><br class=""></div></body></html>