Do I need to do it in order to clear everything from RAM or is a shutdown enough? Are there any OS-agnostic FOSS tools for doing this?
Manually wiping RAM
Other urls found in this thread:
zdnet.com
twitter.com
Just turn it off. For extra tinfoil turn it off at the mains
What if it's a laptop with a bad design for accessing its components?
Why exactly would you need that?
Anyway, just use Memtest86+, it's included/in repos. of most distros, directly accessible from grub.
I'm just curious. Cold-boot attacks and all that.
Come back when you're not stoned and incoherently babbling tech buzzwords.
Unlike flash memory, RAM needs power to keep its data. The caveat is it should still be recoverable a few seconds after power off, or even hours: zdnet.com
If you allocate a lot of memory and write zeroes to it that should be enough, although there's no guarantee you get everything.
I assume that it's what Memtest86+ does, as it's supposed to test the whole memory. If you manually malloc+write from within your OS, then yeah, that's probably not completely reliable.
I guess you could write a simple C program that just mallocs a single byte, zero's it, and repeats (do not free!) until malloc fails.
#include int main(int argc, char** argv) {while (1) { char* x = malloc(sizeof(char)); *x = '\0';}}
I...that's...not really how that works.
Why not? It would wipe the free space.
my bad. I just realized OP asked if shutdown was enough. I assumed they were wanting to keep the computer turned on.
Um...malloc won't give you memory that is already being used. So you wouldn't wipe anything. Or rather, you might wipe residual data from random programs that have already exited, but nothing more than that.
You know, a program that clears up RAM that's not being used could be fairly useful in and of itself.
That won't work. malloc will expand your allocation of one byte to a minimum block size, so you'd only zero part of that block.
Also your program will just crash eventually when malloc fails. Otherwise if you're using some configs of linux the OOM killer will start killing random processes.
Oh yeah, and because you're making a fuckton of tiny allocations, those malloc calls are going to take 99.999% of the program time.
So what's the solution to this perceived problem?
A shutdown is usually fine, but if you want to be extra cautious this is pretty easy.
RAM speeds are much higher than any disk, so it will fill your RAM disk in a few seconds (if that) no matter how much RAM you have.
Are you drunk?
There is a package called secure-delete that provides a program called sdmem, which thoroughly wipes your memory.
unless there's a bottleneck somewhere the ram should fill up practically instantly, given how even ddr2 commonly has speeds (in GB/s) bigger than it's own size
I thought cold boot attacks and memory still retained in RAM for hours was for DDR2 only and was fixed with DDR3.