-1

When we create a zip archive with same content more than once, the output zip archive may have different digest. It because date and time in the files we used in creating the zip archive. Because of this reason, sometimes I had to set the date time of files which I used in the archive to 1970.01.01 by using the following command. touch -a -m -t 197001010000.00

Is it a good practice to modify the date time?

Thank you in advance.

1

Not sure if this question is completely related to security, but, I'd say that changing the datetime on a file could cause issues if you have any auditing on your files, or try to check when a file that had something important in it was deleted, as the date would be wrong.

I'd suggest doing something like this, where you hash the actual files within the zip, not the archive itself.

Such as, in this answer for Python, hopefully its a starting point at the very least.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.