Security bridge on bitcoin-qt walletpassphrase
The wallet passphrase protects against an attacker who has access to your disk but not the rest of your system.

If someone has access to your bitcoind through RPC, you need to protect by setting an RPC password, not a wallet encryption password.