My X system uses a public key to decrypt encryption and does some work based on this. But the user of the system, which I do not trust, has access to the system, cipher and key.
So what he can do is change the cipher, create another set of keys, encrypt with the private key and replace the cipher and public key. Therefore, the next time the system will not know that the message has changes. In principle, I do not care if the user can read it, my problem is that he can not change it, so I thought about MAC, unfortunately, the evil user can change the MAC, because he has access to the repository.
The big problem is that the user will always have unlimited access to the cipher and keys, how can I protect all this?
source share