3 ms·
After a little bit of digging seems to be the best way to currently wipe out sensitive data is to implement something like in libsodium https://github.com/jedis
by doe88 13y ago
After a little bit of digging seems to be the best way to currently wipe out sensitive data is to implement something like in libsodium https://github.com/jedisct1/libsodium/blob/master/src/libsodium/sodium/utils.c#L19 https://github.com/jedisct1/libsodium/blob/master/src/libsod...
1- Try to use SecureZeroMemory() on Windows
2- Use memcpy_s() if available, which from its manpage is guaranteed not to be optimized away by compilers
3- Use a loop to manually zero-out the buffer after having casted to a volatile pointer, again to prevent compiler optimizations