when I hash a file with Md5 what is hashed?

后端 未结 2 1721
孤独总比滥情好
孤独总比滥情好 2021-01-12 15:07

is it just the file contents that get hashed? Is there any way to include the file name and or metadata such as creation date into the hashing process?

2条回答
  •  [愿得一人]
    2021-01-12 16:03

    In general, all the file hashers encrypts only the binary content of the file.

    You can prove this with the following process:

    1. Apply the md5 algorithm to a file
    2. Copy this file into other directory and change its name.
    3. Apply the md5 algorithm to the copy.
    4. Compare both of the results. They are equal!

提交回复
热议问题