Hi,

I know about using md5 for obtaining a hash for a password and such but that isn't what I'm after.

What I'm trying to figure out without the caffeine roaring through my bloodstream, is how to hide a password in this circumstance:
I have a script that I enter my login/password once but will contact an arbitrary number of other machines via ssh/telnet/rlogin/etc. The problem is that if I force perl to core dump (i.e. kill -4), I can scan the core dump for my login & password because it was in memory.
Remember that I want to enter the login/password only once, hide the password (encryption of some sort) and keep the window where the password is in cleartext in memory to a minimum amount of time (used for the remote connection login).

So far, I haven't found any way to do this without significant holes:

  1. encrypting a hash or other memory region requires the key to be stored which could be retrieved to unencypt the password in the core file.
  2. Storing the password in a file (encrypted or not) poses a similar risk.
  3. Storing the password in memory using a 1 way hash requires the user to reenter the password

Obviously, this is a worst case scenerio with no easy answers that I can determine.

Jason L. Froebe

Team Sybase member

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1


In reply to hiding passwords by jfroebe

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.