Re:Show HN: Securely Handle Encryption Keys in Go
by dimitri1995 on Saturday April 22, 2017 @05:25PM
(#14174894)
Not really, you're suppose to use memguard to create a slice then an address is returned; there is no original data.
The go runtime might optimize away your memzero, or it could have created other copies that you don't have a handle to.
In the Rust version of my library (and maybe in the go version, it's been ages since I worked on it), I go out of my way to make it difficult to copy data from runtime-managed memory into a secret buffer. You can do this, and it makes a best-effort attempt at zeroing the data when you do, but you lose a lot of hard guarantees when you do.