My application automatically downloads updates from a central server. I'm a bit worried about someone, for example, hijacking my domain name and pointing it to their own server that offers subverted copies of the application.
It seems to me like symmetric keys are the way to go about this. I'm thinking I can encode the public key right into the program's source and keep the private key on my sever, then add a step to the protocol where the client sends a message meaning "are you an authorized server" and the server sends back a message meaning "I sure am" encoded with the private key, and thus decoding it with the public key verifies that it came from my server. We then proceed as normal.
Assuming this isn't a completely stupid way to go about things, how do I go about it? What lightweight libraries exist to encode/decode with RSA keys? I don't think I want full TLS with SSL; I don't care who reads the update, and I can't really afford decryption overhead anyway - the download times are annoying as it is!