I found this cool little script on Usenet that encrypts Perl code. It works really well, as I tested it out on several scripts. My question... Is encrypted code such as this script produces portable, or are there any dependency issues?
Here is the script that does the encryption...
#! /usr/bin/perl -w # Copyright (c) 1998 Greg Bacon. All Rights Reserved. # This program is free software. You may distribute it or modify # it (perhaps both) under the terms of the Artistic License that # comes with the Perl Kit. use strict; use integer; foreach my $file (@ARGV) { unless (open FILE, $file) { warn "$0: failed open $file: $!\n"; next; } my $key = int rand 256; my $out = <<EOTop; #! /usr/bin/perl my \$prog = ''; { my \$key = $key; local \$/; \$prog = pack "c*", map { \$_ ^= \$key } unpack "c*", <DATA>; } eval \$prog; __END__ EOTop while (<FILE>) { $out .= pack "c*", map { $_ ^= $key } unpack "c*", $_; } close FILE; unless (open FILE, ">$file") { warn "$0: failed open >$file: $!\n"; next; } print FILE $out; close FILE;; }
In reply to encryption portability? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |