Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chromatic (983)

  (email not shown publicly)

Blog Information [] Profile for chr0matic []

Journal of chromatic (983)

Wednesday May 22, 2002
12:59 AM

Hiding Behind the Bill of Rights

[ #5138 ] encrypts any file. It creates a self-extracting archive that requires a very special key in another file -- the text of the Bill of Rights.

"Self-extracting", in this case, means that you must have a recent Perl and my Crypt::CipherSaber module installed. (In fact, you ought to have the most recent, though unreleased, version, to avoid a silly warning.) To encrypt, pass the name of the file to run and the name of the output file. To decrypt a file, pass the name of the key file and, optionally, the name of the decrypted output file. You can also redirect STDOUT, if you're exceptionally daring.

There are a couple of limitations. First, the aforementioned module patch would be nice, but it's not ready. (In debugging, I found some inflexible bits in the module that should be fixed). Second, I'm not positive it writes binary files correctly. The most fatal flaw is that you need the exact text of the Bill of Rights I used, right down to the formatting. I'll fix this flaw first.

I'd point to the text I used, but that would be a circumvention device. Oh wait, did the first ten amendments of the Constitution of the United States of America just become illegal? Oops.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I dunno, especially since you require certain formatting, it makes it a bit odd. I think maybe just using the First Amendment -- either all one line line, or else lenient with whitespace -- might be more fun.
    • Fixing the formatting is pretty easy. I just haven't taken the time to regenerate the initial state array. After that, it's just a couple of judicious tr/// commands to strip out whitespace and to force everything to lowercase.

      As my roommate asked about this this morning, yes, Nick, it is a symmetric algorithm. If you have the state array, you can decrypt it. The point, however, is to make an auto-decrypting file without the state array. That way, you need the secret key.