I think the data in RAM is secure as long as your process has the RAM allocated to it. At least that's how it works in Linux. Not sure about Windows.

Once you free the RAM, other processes can potentially be allocated that same RAM and get access to the data in it. The usual defense against this is to write binary zeros over the sensitive data before freeing that section of memory. I'm not sure how to do this reliably in Perl, though.

Another potential risk is that the sensitive data will be swapped out to disk by the virtual memory system. Linux has a way of locking memory pages so they can't be swapped out (but the program has to be setuid root). I vaguely recall some setting in Windows that erases the VM file on shutdown. I think that would offer some protection against this risk.


In reply to Re: Is data in RAM insecure, or am I just paranoid? by jdalbec
in thread Is data in RAM insecure, or am I just paranoid? by theAcolyte

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.