To answer this question, you need to think about who your attackers are (i.e. who is trying to hide the data?).
For this purpose, it helps if you are working with a simple Threat Model (basically: who bothers you, what you want to protect, the types of attacks that they can carry out, and the risks of this).
Once this is done, you can determine whether you should try to protect data from being written to disk (even if it is decrypted only in memory).
I know this answer may seem useful, but I hope that it helps you realize that you need to specifically indicate (and therefore know) that you are the attackers before you can defend against them correctly (i.e. you can end up fully realizing absolutely useless protection, etc.).
source
share