QCryptographicHash embed a checksum into a file (wav)
-
Hello,
I am quite new to crypto, and I have a task to add a checksum to a files. To be more descriptive they are wave files, and the checksum is contained withing the LSB on each N samples. So the idea is to find if the file has been modified. I saw that
QCryptographicHashis something I may use, but if somebody has an experience with it, could you give a point or two. Would be most appreciated.Regards.
-
Hi and welcome to devnet,
Do you mean you want to modfiy a wav file and embed the checksum of the complete file within the file ?
-
Hi and welcome to devnet,
Do you mean you want to modfiy a wav file and embed the checksum of the complete file within the file ?
-
You are aware that you'll be adding noise to your audio file doing that ?
In any case, when doing a checksum for a file, you usually do it for the whole unmodified file, you don't embed it within a file because that would mean that you are modifying the file that you want to make verifiable.
-
You are aware that you'll be adding noise to your audio file doing that ?
In any case, when doing a checksum for a file, you usually do it for the whole unmodified file, you don't embed it within a file because that would mean that you are modifying the file that you want to make verifiable.
@SGaist
I know I am making noise inside of it, but as far as I know the 1 bit is always a noise, 0, 1 mostly... so I am OK adding my own noise to the file and make it to be a checksum. I sawQCryptographicHashso I wonder if this is easy to do with it instead of using aopenssl/md5orHMAC. Also a point or two would be welcome. -
How big is that file and would you be distributing it ?
Also, why not make a file wide md5 ?
-
How big is that file and would you be distributing it ?
Also, why not make a file wide md5 ?
Well the problem is that the file would be of unknown size, but at least the size must be MD5-able if I can say so. It won't be needed to checksum a file of 1-2 seconds. I don't know yet the full requirements, that's why I ask for advice and a simple hint how to use the QCrypto for this since it sounds OK for the job.
Regards.
-
Then it's best to have all the requirement before continuing. Like I said modifying a file content to add checksum here and there sounds pretty strange.
-
Then it's best to have all the requirement before continuing. Like I said modifying a file content to add checksum here and there sounds pretty strange.
-
QByteArray hashed = QCryptographicHash::hash("stuff-to-hash", QCryptographicHash::Md5);