Hi,

As has been pointed out already, there is a difference between being able to stop someone from casually being able to see in a file and stopping someone with intent and ability.

To stop the former, my favorite technique is using Acme::Bleach (by our own TheDamian). It removes all printable ascii and when it's done only white-space characters remain. It performs the "encryption" the first time it runs, the next time will actually run the file.

Filter::Decrypt runs in much the same way. Make sure to check out the warnings in the documentation, though. It gives a good explanation about why this isn't real security.

I'm not sure how storable fits in to all this. I imagine something like the following:

#! /usr/bin/perl -w use strict; use Acme::Bleach; @main::data = <DATA> __DATA__ #Contents of storable output #go in this section.
Then from a program that requires this code (and defines @main::data), this snippet could populate that array with the data for storable to work on. That may mean when storable generates its data you could just prepend it with those five lines, save it to disk, execute it once (since the first time it just performs the "bleaching") and be done with it.

That's untested and probably won't work as written (I haven't had a chance to play with storable yet). But I hope it will give you some ideas.

Update: ++Tachyon - like I said, this technique is only enough to stop the most easily discouraged folks from getting your data.

Good luck,
{NULE}
--
http://www.nule.org


In reply to Re: secure storage by {NULE}
in thread secure storage by wertert

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.