<div dir="ltr">Thanks all, this has been really helpful. </div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 26, 2017 at 5:44 AM, Kurt Roeckx <span dir="ltr"><<a href="mailto:kurt@roeckx.be" target="_blank">kurt@roeckx.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, Dec 25, 2017 at 07:44:58PM -0800, Swapnil Deshpande wrote:<br>
> Hi all,<br>
><br>
> Noob here. I recently discovered that the "-sha1" and "-sha" flags in the<br>
> "openssl dgst" command produce different outputs. I thought those were the<br>
> same algorithms but turns out they are not:<br>
><br>
> $ echo -n "password" | openssl dgst -sha<br>
><br>
> 80072568beb3b2102325eb203f6d0f<wbr>f92f5cef8e<br>
><br>
><br>
> $ echo -n "password" | openssl dgst -sha1<br>
><br>
> 5baa61e4c9b93f3f0682250b6cf833<wbr>1b7ee68fd8<br>
><br>
><br>
> I am aware of SHA1 and the SHA-128 algorithm.<br>
><br>
><br>
> 1. What algorithm is used to generate hash when I use the "-sha" option?<br>
<br>
</span>It's the original SHA algorithm, which people will now refer to as<br>
SHA-0. It has some minor but important changes compared to SHA-1.<br>
<span class=""><br>
> 2. What could I have done to get this answer to #1 in a better way? I am<br>
> asking this because I tried to find what algorithm is being used through<br>
> the "help" option as well as trying to search via "man openssl" but<br>
> couldn't find anything. I also did a basic search for "openssl sha vs sha1"<br>
> and couldn't find any relevant results. If there was a better way to know<br>
> more about this option (say by reading some documentation), I'd be glad to<br>
> know about it.<br>
<br>
</span>I started a pull request:<br>
<a href="https://github.com/openssl/openssl/pull/4979" rel="noreferrer" target="_blank">https://github.com/openssl/<wbr>openssl/pull/4979</a><br>
<br>
There are probably other changes that should happen.<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
Kurt<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
</div></div></blockquote></div><br></div>