Does metadata change the hash for the file?

We know that the hash value for a file is independent of the file name. And I did some experiment, and he proved that from the point of view of mac os, changing the label (red, ..), keywords, description (in the open meta) file does not change the hash value.

But changing metadata in jpeg changes the hash.

So, I'm starting to wonder why he holds on? Any hint or inspirational tutorial?

+4
source share
2 answers

The tool you used apparently hashed what the OS sees as the contents of the file, which in the case of JPEG contains some metadata defined in the JPEG standard. Keywords, descriptions, etc. Stored outside the file contents corresponding to the file system.

(What is considered data and what metadata can be quite arbitrary and depend on the context, for example, applications and processing platforms.)

+5
source

There are various ways to store metadata. For structured storage files created by COM applications, it is embedded directly in the file data. This will change the hash of the file if the properties of the document have been changed. In volumes formatted using NTFS 5 (Win2k and later), document properties can be added to any type of file and stored in alternative data streams. I assume the same is true for the OS X file system.

+1
source

Source: https://habr.com/ru/post/1346626/


All Articles