This seems like a good job for digitally signing. A digital signature will ensure the integrity and authentication of your data. The digital signature value will determine whether the data (configuration file) has been changed and that the data has been obtained from a reliable source. A digital signature is created by performing a data hash and then encrypting the hash with the private key from the public / private pair. The application decrypts the encrypted hash, computes the data hash, and compares the decrypted hash with the computed hash. If the hashes match, the data is valid. If they do not match, the data has been changed.
.Net contains these functions in DSACryptoServiceProvider.VerifyHash
Of course, if you don't want to sort through the problem of creating a public / private key pair, you can just go with a simple hash of the configuration file to make sure it has not been changed.
A really important question: what are you going to do when the application detects a modified configuration file?
Are you going to close the application, block certain functions, send you an email, try to get a good copy of the configuration file? These actions are called the integrity check penalty. Right now your application does not perform integrity checks in the configuration file, but when you add the verification, you will need to choose the best way to fail.
source share