in order to protect against that you need a key ex...
# general
w
in order to protect against that you need a key exchange that happens outside the vulnerable process. This is how cryptocurrencies do it