Heh... I've done just that some time ago; we have a CSV file with customer data / emergency passwords that gets mailed around to the response team, gpg encrypted. I wrote a Tk app to retrieve that information and display it, since there was no other tool at hand but the shell, gpg, tar etc. It's an ugly quick hack meant to be fired up only in case of urgency. It spread through the company, and there was much discussion concerning safety, memory latency, swap impregnation and so on...

My take on that is: Thou shalt not utter passwords but inside thyself. At the moment sensitive information is on display, that display becomes a location inside thyself which thou shalt not reveal. Since that information propagates through your computer memory via X cut buffers and what not, your whole box is to be treated as being inside thyself, once a security token has been accessed. So you must keep it from utterance, and the only safe way to detach your responsibility from that box is turning it off (provided it's disks are encrypted and the swapspace is disposed of properly at shutdown).

In short, it's not a matter of memory destruction but of perception. Security is about awareness, not about a particular device, much the same as firewalls aint software or appliances, but concepts.

Even if I provide for my colleague to encrypt proper all their data with unbreakable ciphers, I cannot prevent them from shouting in the mall.

That said, your approach seems safe to me (for some value of safe ;-) which doesn't mean it could not be improved...

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

In reply to Re: Can I do secure memory management in Perl scripts for cryptographic applications? by shmem
in thread Can I do secure memory management in Perl scripts for cryptographic applications? by radiantmatrix

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.