Menu

#47 On Windows, RHash should indicate the default binary mode for each input file

None
closed-wont-fix
nobody
None
5
2016-11-06
2014-12-21
No

The output of RHash when computing MD5 or SHA1 (probably others?) hash sums cannot be verified with using the GNU tools sha1sum and md5sum on Windows.

On DOS/Windows, those tools read any files in binary mode (by default), but the checksum files output by RHash leave out the asterisk on every input file thus indicating that they should be read in text mode.

Output example of RHash:

d1da3914eaf6593c8d9bd89dce744d343190914e  FILELIST.DOC
11da0d1596f7ee504260abd8a6cb05d193ea9140  README
c152829d31d14ab5abac53716d647de202001d59  README.COM
0208278da6ad3440284d46d5a69a5c9483599787  UNZIP.EXE

That is, it reads them in binary mode, but indicates in its output that the files were read in text mode (by sha1sum/md5sum tools; they won't ignore the missing asterisk).

C:\>sha1sum -c file.sha1
FILELIST.DOC: FAILED
README: FAILED
README.COM: FAILED
UNZIP.EXE: FAILED
sha1sum: WARNING: 4 of 4 computed checksums did NOT match

If the compatibility between RHash and the GNU tools was never meant by design then this message may be discarded..

Thank you.
Fabiano Freitas

Discussion

  • Fabiano Freitas

    Fabiano Freitas - 2015-04-26

    Update:

    Well, as an alternative, you could add an option specifically for this, like the one existing in the utility sha1deep:

    -k        - print asterisk before filename
    

    It's a suggestion.

    Thank you.

     
  • Aleksey

    Aleksey - 2015-09-28

    RHash is not compitible with Windows sha1sum/md5sum. For example, it read files only in bynary mode, even if it checks a 'file without asterisk' in a hash-file generated by the sha1sum.

    You can use a workaround: use the --printf option:
    rhash -p "%h* %p" <FILES>

     
  • Aleksey

    Aleksey - 2016-11-06
    • status: open --> closed-wont-fix
     

Log in to post a comment.