Greetings, monks!

I come to you with some security related questions. I'm coding a daemon that needs to periodically access encrypted data and perform operations on it. At the same time, I need to prevent access from the data in case someone manages to log into the machine. I was figuring doing something likes this:

Upon launch, the daemon asks for the decryption password, which is assigns to a variable and retains all through its run-time. It can then use the password to access the encrypted data, get the information it needs and perform operations.

My first question is: is it possible for someone with terminal access to the system (it is a Linux system) to access the values of variables within a perl script from the outside? Perhaps if they did a memory dump? "hexdump -c"?

My second question is: How about the input stream for a script? I was planning to enter the password simply via <STDIN>. Can someone read things from STDIN from before they accessed the stream?

I apologize in advance. These questions are probably really stupid and show my ignorance of even the simplest things about Perl and Linux. Unfortunately, I had no formal schooling in this kind of stuff so my ignorance is vast. I would appreciate any pointers, because I don't know where to even start looking.


In reply to Reading streams, perl variables when script is running by xtpu

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.