Hey, I am writing some code for a machine that I cannot guarantee the security of, some of the stuff in it I'd rather keep away from prying eyes, beyond the usual obfuscation methods and such. I remember (...or I might of made this up) reading about a module that would have almost all of the code encrypted under some algorithm and would be decrypted and executed at runtime. Since then I have been completely unable to find any more about this so I decided I would try and have a go myself, my first thought was simply to encrypt a file then write a second script which would prompt for the key then decrypt the file then I would pipe the resulting code printed to the perl interpreter. Apparently this is a baaaaaad idea as it freezes up the interpreter, I can't exit without killing the process. My second thought was to use a perl filter that would encrypt the code with blowfish then request the key so it could decrypt the code but from what I have read about perlfilters this isn't really what it is designed to do...

I was just wondering if anyone could offer any tips or ideas on how this could be accomplished?


In reply to Decrypt source before interpreter by Anonymous Monk

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.