title: Trying to output Openssl Hash in binary form in order to compare bits
body: <p>A small part of a lab I am working on for school has asked me to take a file, hash the value using openssl sha256 and then change 1 bit, rehash it and compare the values. Specifically they want me:</p>
  
  <p>"You can write a short program to count how many bits are the same between H1 and H2"</p>
  
  <p>Currently the output form is a hex dump and whenever I try to add the -binary to the openssl command such as:</p>
  
  <pre><code>openssl dgst -sha256 -binary largefile.txt &gt; hashInBinary.txt
  </code></pre>
  
  <p>I keep receiving symbols that I cannot read instead of 1s and 0s. I am really not sure how to approach this in any other way at this point. I dont understand why I am not receiving the binary format (1010101011) of the hash value when I add -binary. Any thoughts?</p>