Supposed I have written a program, and I want to make sure that its code will not be changed (for now, let's assume we are using an interpreted / scripting language, so "just compile it" is not a valid answer).
So I would like to detect if someone changes the code. How can I do this reliably?
The most obvious way is to hash the code, put the hash into the code, and verify it - but of course this does not work, as it is pretty easy to simply rehash the code. You would have to know the hash in advance and put it into it while calculating the hash, but this is a chicken-egg problem, obviously.
Are there any other options that are reliable?