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:
"You can write a short program to count how many bits are the same between H1 and H2"
Currently the output form is a hex dump and whenever I try to add the -binary to the openssl command such as:
openssl dgst -sha256 -binary largefile.txt > hashInBinary.txt
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?