title: generate a base-64 encoded sha-256 password hash with openssl on the Windows command line
body: <p>I'm trying to password encrypt a text string with SHA-256 HMAC and then encode in base64 using openssl in a Windows command line. Ideally I'd like to have that info output in a text file.</p>
  <p>As a first step, I tried using known text strings like &quot;Message&quot; and &quot;secret&quot; in the command line without output to file. When I run</p>
  <p><code>&quot;echo -n &quot;Message&quot; | openssl dgst -sha256 -hmac &quot;secret&quot; -binary | openssl base64&quot;</code></p>
  <p>in Windows command, the answer is &quot;vU1EEiVOomLI5ebeFWNdnBKNtmvaWxY0RP7r3tkBBeQ=&quot;. However, the correct output string should be &quot;qnR8UCqJggD55PohusaBNviGoOJ67HC6Btry4qXLVZc=&quot;.</p>
  <p>I tried many different combinations and I'm at loss what I'm doing wrong. After that, I'll have to figure out how to output to a file.</p>