For example the Go package memguard.
Couldn't a devoted attacker just find the encryption key in memory? Is it that some forms of attacks can't expose all of memory but only adjacent memory/memory in a certain location?
For example the Go package memguard.
Couldn't a devoted attacker just find the encryption key in memory? Is it that some forms of attacks can't expose all of memory but only adjacent memory/memory in a certain location?
If an attacker is able to dump the entire memory content, then, yes, they can get the key and defeat the encryption. However, many attacks aren't that far-reaching and can actually be addressed with encryption. Also note that the package doesn't rely on encryption alone but uses other mechanisms like prevent memory swapping and core dumps. In that sense, the Rust package seems similar to the “key shielding” which OpenSSH uses to protect keys at rest.
There are several benefits:
It's generally a good idea to address the problem of memory protection with a single reusable package rather than let every developer figure this out all by themself for each application.