Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: md5 --verify (Read 9812 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

md5 --verify

is there a way to put the md5 of the original wav file in a basic tag like artist, album, or specifically the comment tag when encoding?

I'm using foobar with the command line FLAC.

I know wavpack does this or something very similar.

any way to do this with FLAC - especially when encoding?

my settings right now are:
--best --verify -T "ARTIST=%artist%" -T "ALBUM=%album%" -T "TRACK=%tracknumber%" -T "TITLE=%title%" - --output-name=%d

md5 --verify

Reply #1
"flac -V" (or "flac --verify"), which you are already using

try "metaflac --show-md5sum" on one of your flaces, and you will see

if you want to achieve "md5sum -c"-like functionality, use "flac -t" (aka "flac --test")

md5 --verify

Reply #2
"flac -V" (or "flac --verify"), which you are already using

try "metaflac --show-md5sum" on one of your flaces, and you will see

if you want to achieve "md5sum -c"-like functionality, use "flac -t" (aka "flac --test")


but i want to store it in a tag...like...

-T "COMMENT=%md5sum%"

md5 --verify

Reply #3
well then you'll need md5sum.exe and give it's value somehow to the tagger

but could you please explain what the advantage of this method exactly is (over flac -V & metaflac --show-md5)?

md5 --verify

Reply #4
Yes it's entirely possible via batch script as the command-line tools already exist, though I'm wondering why you wish to do this as well. [/a]

This [a href="http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=59828&view=findpost&p=537105" target="_blank"]post
might be worth looking at if you're paranoid about defective hardware (flac's -V option cannot provide a 100% guarantee against an error in this situation and I have seen incidents where the md5 hash matched the decoded file but did not match the raw PCM data of the original source).

EDIT: Pinch-face smiley made into a link.

md5 --verify

Reply #5
heh, why don't we sign each flac with pgp then? 

md5 --verify

Reply #6
I was more or less just wondering if it was possible. wondering if the generated md5 was accessible during the encoding process


md5 --verify

Reply #8
You could always do this with a batchfile...

Code: [Select]
metaflac.exe --show-md5sum %1 > tempfile.txt
set /p md5var= < tempfile.txt
del tempfile.txt
metaflac.exe --set-tag="MD5=%md5var%" %1


Copy this into notepad, save it as MD5.bat or whatever, and drag and drop the flac file onto it.
And make sure you include the full path to metaflac!

I know many people don't like messing around with batch files, but i personally think they're a godsend!

-Adam

Edit: Sorry, I misread that you wanted the MD5 of the original. I guess this will give you the MD5 of the flac.

md5 --verify

Reply #9
If you want to get the md5 hash of the PCM data from the wave file independently, use sox with the version of md5sum that supports redirection or use shntool.

md5 --verify

Reply #10
Yes it's entirely possible via batch script as the command-line tools already exist, though I'm wondering why you wish to do this as well. [/a]

This [a href="http://www.hydrogenaudio.org/forums/index.php?s=&showtopic=59828&view=findpost&p=537105" target="_blank"]post
might be worth looking at if you're paranoid about defective hardware (flac's -V option cannot provide a 100% guarantee against an error in this situation and I have seen incidents where the md5 hash matched the decoded file but did not match the raw PCM data of the original source).

EDIT: Pinch-face smiley made into a link.



Excuse me greynol. I know this is a very old post. I´m sorry.

I don´t know if I understand what you said. Did you say that if I have two files with the same MD5 checksum maybe they have different raw PCM data?

md5 --verify

Reply #11
This post might be worth looking at if you're paranoid about defective hardware (flac's -V option cannot provide a 100% guarantee against an error in this situation and I have seen incidents where the md5 hash matched the decoded file but did not match the raw PCM data of the original source).


Excuse me greynol. I know this is a very old post. I´m sorry.

I don´t know if I understand what you said. Did you say that if I have two files with the same MD5 checksum maybe they have different raw PCM data?

I read it as the flac file matches the stored md5 and so its decoded wav. What he means went wrong is the source does not match the decoded wav. So there may have been an error before or while feeding the source to the encoder. In such case the md5 fails to guarantee the source is stored correctly, only the flac file itself is ok.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

md5 --verify

Reply #12
This post might be worth looking at if you're paranoid about defective hardware (flac's -V option cannot provide a 100% guarantee against an error in this situation and I have seen incidents where the md5 hash matched the decoded file but did not match the raw PCM data of the original source).


Excuse me greynol. I know this is a very old post. I´m sorry.

I don´t know if I understand what you said. Did you say that if I have two files with the same MD5 checksum maybe they have different raw PCM data?

I read it as the flac file matches the stored md5 and so its decoded wav. What he means went wrong is the source does not match the decoded wav. So there may have been an error before or while feeding the source to the encoder. In such case the md5 fails to guarantee the source is stored correctly, only the flac file itself is ok.


Thank for your answer Wombat

A couple of questions:
1) the source is the CD?
2)  You are talking about rip problems?
3) the flac and the wav with the same MD5 cheksums always have the same raw PCM data?
I'm sorry, I'm principiant

md5 --verify

Reply #13
A couple of questions:
1) the source is the CD?
2)  You are talking about rip problems?
3) the flac and the wav with the same MD5 cheksums always have the same raw PCM data?
I'm sorry, I'm principiant

To 1)+2) i have no idea because greynol did not exactly tell us when that happened. Since he reached posters paradise with reaching the magic 10.000 i doubt he really worries to tell us. I didn't notice this problem myself, maybe others.
To 3) The flac and wav can't have the same checksum. The stored md5 in the flac matches the raw decoded data. If it doesn't the flac format owns --test will detect an error.
Is troll-adiposity coming from feederism?
With 24bit music you can listen to silence much louder!

md5 --verify

Reply #14
A couple of questions:
1) the source is the CD?
2)  You are talking about rip problems?
3) the flac and the wav with the same MD5 cheksums always have the same raw PCM data?
I'm sorry, I'm principiant

To 1)+2) i have no idea because greynol did not exactly tell us when that happened. Since he reached posters paradise with reaching the magic 10.000 i doubt he really worries to tell us. I didn't notice this problem myself, maybe others.
To 3) The flac and wav can't have the same checksum. The stored md5 in the flac matches the raw decoded data. If it doesn't the flac format owns --test will detect an error.


Thanks for your quick answer Wombat!

md5 --verify

Reply #15
1) the source is the CD?
2)  You are talking about rip problems?
Nobody mentioned CDs or ripping in any way, and I wonder how that is relevant to the topic at hand at all. If you worry about perfect rips, please create a new thread about it.

3) the flac and the wav with the same MD5 cheksums always have the same raw PCM data?
It only makes sense to MD5 the decoded streams of both files and compare those, not the files itself. To return to your initial question, in practice there is a non-zero probability that two streams which are different return the same hash checksum (called a collision). More on cryptographic hashing here: http://en.wikipedia.org/wiki/Cryptographic_hash_function
It's only audiophile if it's inconvenient.

md5 --verify

Reply #16
I read the hash function  properties. It is so diffcult to find two files different with the same cheksum. If the files are similar, more difficult. It is near imposible that you can find more than one collision in your life, unless a malicious attack.
So I don't understand what greynol said in the post #5 about: "(flac's -V option cannot provide a 100% guarantee against an error in this situation and I have seen incidents where the md5 hash matched the decoded file but did not match the raw PCM data of the original source)."

Maybe I don't understand what he said because I'm novice.

md5 --verify

Reply #17
He means that on a broken computer it's possible that lossless encoding is not lossless because the computer works with corrupted data or computes things incorrectly. With broken memory it is possible that bits flip and bad data is used both for computing the MD5 and encoding the FLAC file. Such file would looks 100% valid in checks but still doesn't match the original source.

I don't think anyone needs to worry about this because memory errors this bad would be visible to the user as constant crashing of programs. And if your computer can't be trusted in such simple task extra verifications would also be useless when all further verifications would most likely deal with bad data too.
If on the other hand your CPU is broken and computes things incorrectly under heavy strain then it's next to impossible that a broken encode would get a matching MD5.

 

md5 --verify

Reply #18
Thanks for your answer Case!

Very clear!