Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    1. Home
    2. Tags
    3. qcryptographich
    Log in to post

    • SOLVED QCryptographicHash results mismatches
      General and Desktop • file qcryptographich • • bogdan_bdg  

      12
      0
      Votes
      12
      Posts
      45
      Views

      @Christian-Ehrlicher No, and I asked you to check the original question rather than the latest update, which you seem to have trouble understanding without the original context. So here's the quote from the original question for you: When I run this [code in question] under GNU/Linux the output hash is the same as a result of running command line tool md5 or md5sum. When I run the very same code under MacOS - I get different hashes from the application and command line. I never wrote I was trying to compare hashes between two different OSes (and files for that matter). The mismatch was between hash given by the Qt code I quoted and the regular command line tool hashing a file on the same OS.
    • UNSOLVED Decrypt QMessageAuthenticationCode
      General and Desktop • qcryptographich encrypt decrypt hash-based qmessageauthent • • Nouriemm  

      6
      0
      Votes
      6
      Posts
      1528
      Views

      Thanks folks That is what I was looking for.
    • SOLVED Unable to generate MD5 of a QString
      General and Desktop • qstring crypto qcryptographich hash • • Qjay  

      3
      0
      Votes
      3
      Posts
      2618
      Views

      Thanks !! I just figured it out after reading Docs !! Thanks for replying (y)
    • [Solved] QCryptographicHash::hash() on QIODevice.read() and QCryptographicHash.addData(QIODevice).result() give different values
      General and Desktop • qiodevice qcryptographich • • Gallaecio  

      4
      0
      Votes
      4
      Posts
      1547
      Views

      I’ve found out what my issue was. I was reading binary files, and char arrays end at null characters ('\0'), which binary files may have. I found out that I can use a QByteArray all the way instead of an array of chars, resulting in a more readable that works regardless of the null characters in the binary file: const qint64 CHUNK_SIZE = 9728000; ioDevice.seek(0); QByteArray data = ioDevice.read(CHUNK_SIZE); QByteArray hash = QCryptographicHash::hash(data, QCryptographicHash::Md4); std::cout << "ioDevice.read() hash: " << hash.toHex().toStdString() << std::endl;