Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does metadata alter hash for a file?

We know that hash value for a file is independent of filename. And I did some experiment and it proved that in terms of mac os, the change of label(red,..), keywords, description (in open meta) of a file do not alter hash value.

But the change of metadata in jpeg does change the hash.

So I start to wonder why it holds? Any clue or inspiring tutorial?

like image 818
colinfang Avatar asked Apr 04 '11 21:04

colinfang


1 Answers

The tool that you used apparently hashed what the OS considers as file contents, which in the case of a JPEG includes some metadata defined in the JPEG standard. Keywords, description, etc. are stored outside of the file contents proper by the filesystem.

(What is considered data and what metadata can be rather arbitrary and dependent on the context, e.g. the processing application and platform.)

like image 159
Fred Foo Avatar answered Sep 28 '22 09:09

Fred Foo