A better solution would be to rely on an external source that the user can NOT control to store part of the password. Otherwise, wherever you hide it, it is easy to spot someone with a few free tools and a little time.
Personally, I found that the best place to store such data is in clear text, as well as other data that the application often accesses. Keep in mind that if a user has access to change data, he is at risk.
If you want to block your program, it is necessary that the key already exists before your program starts. Thus, you only need to worry about how you get the key, and since it is encrypted, it will be more difficult for them to create one that works for your system.
For your initial authentication process, you can put part of the key on your web server, provide the user with the access key needed to create the encrypted file. Using the access key will lead them to the key on your server, and if it is valid, then allow them to save the encrypted file. If you are worried about reactivating, then after activating it, you can delete the file on your web server.
Another option would be to use something like OnGuard ( latest version ) to encode a time-limited key that you provide to the user. Then, when activation starts, check that the key you supplied expires or not, and if so, do not allow activation. Thus, your activation key is at risk for a limited period of time.
Do not spend a lot of time on this. Even the best algorithm can be fixed with a few NOP instructions after deploying the application.
skamradt
source share