The Garbage Collector does not manage variables, so the question in this way makes no sense. It manages allocated objects in the heap managed by him. When you create a variable in your code it exists only in it, has nothing to do with execution. Do not confuse the concepts. Variables are not managed, do not exist during execution.
The first paragraph also has the wrong premise that can be accessed by any system. This, in general, is not true, and even in the cases that happen you can do nothing to prevent, is a compromised system.
Even after editing the second paragraph does not say what came.
The third asks for something that is normal to happen without doing anything, or has nothing to do, because it is a compromised system. Any content available within the computer can be accessed if the system is compromised. Under normal conditions only the application can access.
By compromised system understand that any machine that has a user accessing has at least the commitment towards it, ie the user does what he wants on his machine, if he has the knowledge or can delegate to another person, there’s nothing that can stop you doing that.
If you don’t want to give non-crypted access, because the algorithm that does this will already be a vulnerability that will allow you to even decrypt something that’s not even on your computer. Look for a solution that doesn’t need to be decrypted, or that isn’t done in environments you don’t control 100%, which is difficult. If you can’t do that, accept the insecurity. Anyway there’s nothing you can do in programming to try this better.
Note that the whole conceptualization is wrong, so any path based on it will be wrong by definition. And even though I answered, because I think it doesn’t come out of that, the question remains confused.
I started answering, but the whole text doesn’t make sense. The Garbage Collector does not manage variables, so the question in this way makes no sense. It manages allocated objects in the heap managed by him. The whole first paragraph doesn’t make sense to me either. In the second paragraph it seems to think that memory is an agent aware of something, when it is only a storage place. What is the reason for this?
– Maniero
I’ll edit the question @Maniero.
– CypherPotato