The approach you described is largely security theater. Supposing an attacker has compromised a machine and is capable of retrieving stored data, it reasonably likely that the attacker will be capable of either capturing the key as it is transmitted or reading the key while it is stored in memory.
If you start with the assumption that a machine is compromised, then there's not really a way to guarantee secrecy of anything done on the machine. Homomorphic encryption resolves this, but (as far as I'm aware) it is too computationally expensive to be viable at present.
If you start with the assumption that a machine is compromised, then there's not really a way to guarantee secrecy of anything done on the machine. Homomorphic encryption resolves this, but (as far as I'm aware) it is too computationally expensive to be viable at present.