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 Ryhl
    Commented Feb 4, 2019 at 20:49

1 Answer 1


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$
    – Ella Rose
    Commented 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$
    – kelalaka
    Commented Feb 4, 2019 at 20:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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