Bug report: FromHex then MD5/SHA1 has wrong computation
See original GitHub issueSummary
When using FromHex
then MD5
computation recipe, sometimes, the hash is wrong.
It seems that bytes >= 0x80 have a problem with the transformation.
Example
See the following example:
The correct hash for a single 0x80 byte should be:
>>> import hashlib
>>> hashlib.md5(bytes([0x80])).hexdigest()
'8d39dd7eef115ea6975446ef4082951f'
Possible solutions
It seems that at least another online tool is failing at this: https://cryptii.com/hexadecimal/md5 Note that the result for SHA1 is also wrong. However, the new version https://v4.cryptii.com/enigma outputs the correct result.
Issue Analytics
- State:
- Created 6 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Ten simple rules for reporting a bug - PLOS
Bugs, of course, are flaws in computer software—flaws that can make the software crash, become unresponsive, or produce incorrect output, or ...
Read more >How to get the MD5 and SHA1 checksum for a file - IBM
The tool to use to compute the checksum is: sha1sum. ... If two files have the same MD5 checksum value, then there is...
Read more >How to Report Bugs Effectively - PowerWorld
Anybody who has written software for public use will probably have received at least one bad bug report. Reports that say nothing ("It...
Read more >Ten simple rules for reporting a bug - PMC - NCBI - NIH
Bugs, of course, are flaws in computer software—flaws that can make the software crash, become unresponsive, or produce incorrect output, or ...
Read more >HEC-FDA Bug Report - Hydrologic Engineering Center
If you have encountered a problem, then please take the time to send us a bug report. USACE users: Please submit bug reports...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is because update accept message as utf-8 string. U need to use updateFromArray for binary data.
@slurdge Ah yes, I misunderstood. If the manual state update method is for strings then go ahead and leave it as a string. Make sure you run
grunt test
once you’ve made the changes in case some of the hashing tests break. They shouldn’t as I generated the expected hashes using Python and some other online sources, however those other sources might also be wrong in the same way.