We use GnuPG for encrypting data, which we upload to a central storage.
The public key is being stored on a web-server, and the encrypting script re-downloads it if it's changed. This was done in order to easily refresh the public key every so often on all the servers.
After some security thinking, I got the paranoia, that someone can (unlikely, but potentially), break into the web-server, and replace the public key with his own.
This would give 2 very unpleasant effects:
1) The hacker could read the data, if he manages to break out into the central storage as well.
2) Even if he doesn't - we won't be able to read the data as well as the private key got changed, and it all can be considered as lost!
Can someone advice how to prevent this threat, or perhaps suggest a more robust, but still convenient, key refresh approach?
Thanks!