I have created a text file called test.txt and the content of the file is Hello World
I would like to change the SHA checksum hash without modifying the contents and filename. Is there any way to do that without using any third party tool on the internet.
-
4$\begingroup$ What are you trying to do? $\endgroup$– Alice RyhlFeb 4, 2019 at 20:49
1 Answer
Hash functions are deterministic, same input same output. Without a modification, you cannot change the result.
The hash of a file is used at least for the integrity check. If you were able to change it without modification the integrity check will have problems.
Note: as mentioned by Ella Rose in the comments if a keyed-hash message authentication code HMAC is used then changing the key will result in a different hash-based message authentication code.
-
4$\begingroup$ They might be able to use some kind of keyed hash function, depending on their use case. But that won't be SHA256 anymore either. $\endgroup$ Feb 4, 2019 at 20:03
-
$\begingroup$ @EllaRose Yes, if it is a keyed function then changing the key will changed the result. Added, thanks. $\endgroup$– kelalakaFeb 4, 2019 at 20:10