What you are talking about is the infamous problem of DRM. There is unfortunately no way to do this. The fundamental problem is one of trust. In current modern systems, the user is god. They have control of the hardware and can therefore abuse the system anyway they want. Your program has to run in their domain. As such, anything your program can do, the user can reverse engineer and do. You can make it harder for them to figure out what they need to do, but ultimately, if it is on their hardware, it is their system, not yours.
This is DRM because ultimately, DRM is about having a secret safe from the user that the software knows. How does DRM on music work? It tries to hide the encryption key for the music such that the software can play it, but the user can't decrypt it. Your case is no different. The answer is either to have a system where the user is not god (ie, the user doesn't have root access to the box and the hardware is trusted as secure) or similarly, run the software on a server you control and limit their access such that they can't do what you don't want them to do.
If you want to attempt it, you can't get much more secure than simply including the key in source code. You can try one of the various commercial systems for obfuscating keys, but they can all be broken. Discussion of detailed techniques for trying to hide it here would be a) too broad and b) useless as anyone could look up this post and see what kinds of things you might be doing.