Comments (1)
No, it's not a bug, but it is an interesting issue that had me scratching my head for a bit. Utilities like sha256sum and md5sum etc, print the hash value as a hex-encoded string. But the hash value is really just a large number. Hashrat can print this number as octal, hex-encoded, base-64, or a number of other output formats. But internally, when it's doing repeated hashing, hashrat doesn't convert the hash values to hex, base64, or anything else.
So, inside hashrat the sha256 hash is done, and this produces a binary value, not a hex-encoded string. That is then fed into the md5 hash, which produces another binary value, which is then encoded as hex, base64 or whatever for output (unless we want to do more hashes, where it is passed along the pipeline unencoded).
In order to simulate this with sha256 sum and md5sum, we'd need some way of decoding the hex output into raw bytes. I found the xxd utility can do this:
echo -n 'test' | sha256sum
9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 -
echo -n '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08' | xxd -r -p - | md5sum
9962791b4b77f382035b7869e0a8eaf8 -
Which now produces the same output as hashrat.
But this method of feeding the output of one hashing program into another hadn't occurred to me before, and it's handy for checking that hashrat is working as expected, so I'll be checking for this kind of thing going forwards.
from hashrat.
Related Issues (20)
- Hashrat always returns exit code 1 when used for something else than checking hashes HOT 3
- Should use unrolled SHA2 transform by default
- 3 Error when try to compiling the code under Mac os HOT 2
- [Feature Request] Verbose mode HOT 2
- Zlib support reported as enabled when --enable-ssl is but --enable-zlib is NOT given HOT 1
- Unable to compile while enable-zlib is given HOT 1
- Problem with special characters in the filename/path HOT 2
- The return of hashrat -p64 is not compliant with rfc 4648 HOT 4
- feature request: hex input HOT 1
- Is the outputting of new files with -C implemented? HOT 3
- "-c -xattr" didn't work properly HOT 1
- Feature Request: argon2
- feature request: Don't update xattrs for unmodified files HOT 5
- SHA-256 tests reported as broken HOT 7
- HMAC Segmentation fault HOT 1
- No escaping of file names with "'" when calling hook script HOT 2
- Feature Request: Return exit code of zero (0) when hashing a file. HOT 1
- [HELPWANTED] Windows binary HOT 1
- Unable to use SSL/TLS with OpenSSL 1.1 HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hashrat.