Recent

Author Topic: How to modify file checksum?  (Read 1549 times)

TomTom

  • Full Member
  • ***
  • Posts: 170
How to modify file checksum?
« on: August 14, 2019, 01:06:39 pm »
Hi :)
I have many files that need to have their checksums changed. How can I do this? Is this even possible?
These are tif images. I know I could add single pixel at random position and checksum will change but Im wondering if there is some more elegant way (not changing image).


howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: How to modify file checksum?
« Reply #1 on: August 14, 2019, 01:42:23 pm »
A checksum is a derived statistic.
Unless the binary representation of the file changes in some way, its checksum will not change (unless the checksum calculation algorithm is substandard).

TomTom

  • Full Member
  • ***
  • Posts: 170
Re: How to modify file checksum?
« Reply #2 on: August 14, 2019, 01:49:54 pm »
So... I need to change something in the file like in my case, set random pixel to random color for example.. or change some meta-data... Am I right?

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: How to modify file checksum?
« Reply #3 on: August 14, 2019, 01:51:51 pm »
Some checksums have certain properties. E.g. you make the file 4 bytes longer to n+4, and take the checksum of the first n bytes, and craft a value to put in the four extra bytes so that the value over n+4 bytes is what you want.


Thaddy

  • Hero Member
  • *****
  • Posts: 14205
  • Probably until I exterminate Putin.
Re: How to modify file checksum?
« Reply #4 on: August 14, 2019, 02:35:23 pm »
If the hash is over the full TTiffIFD record, you can possibly modify the date, or one of the document properties, like the model of the scanner  8-)
Specialize a type, not a var.

 

TinyPortal © 2005-2018