-GIMP is freeware.
did you source that from the GIMP documentation? because it very much appears you didn't. (please link to the direct quote if i'm wrong).
in contrast my quote comes directly from page 4 of their own PDF User Manual which very clearly states:
The GIMP is not freeware
personally i'll go with what GIMP says in their own manual. you're welcome to believe whatever thing you wish - enjoy.
i'm trying to understand your exact scenario.
but in general, the problem is where do you get your original key, or original hash to verify from? if they are both coming from the server, along with the code which processes them, then if the server is compromised, so are you.
thankfully browsers give alot of crypto API lately (as discussed in your link)
but you still need at minimum a secure key, a hash and trusted code to verify the code the server serves you. there are ofc solutions to this problem, but if the server is unstrusted, you absolutely can't get it from them, which means you have to get it from somewhere else (that you trust).