/usr/share/doc/libfilter-perl/examples/decrypt/decr is in libfilter-perl 1.57-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #!/usr/bin/perl
# This script will decrypt a Perl script that has been encrypted using the
# "encrypt" script. It cannot decrypt any other kind of encrypted Perl script.
#
# Usage is decr file...
#
use strict;
use warnings;
use vars qw($XOR $BLOCKSIZE $HEADERSIZE $CRYPT_MAGIC_1 $CRYPT_MAGIC_2
$size $mode $line $Fingerprint $file $block $sharp_bang $f
) ;
$XOR = 'Perl' ;
$BLOCKSIZE = length $XOR ;
$HEADERSIZE = 2 ;
$CRYPT_MAGIC_1 = 0xff ;
$CRYPT_MAGIC_2 = 0x00 ;
my $Version = 1 ;
my $module_name = 'Filter::decrypt' ;
my $Fingerprint = pack ("C*", $CRYPT_MAGIC_1, $CRYPT_MAGIC_2) ;
die "Usage: decrypt file...\n"
unless @ARGV ;
# Loop through each file in turn.
foreach $file (@ARGV)
{
if (! -f $file)
{
print "Skipping directory $file\n" if -d $file ;
#print "Skipping strange file $file\n" if ! -d $file ;
next ;
}
open (F, "<", $file) || die "Cannot open $file: $!\n" ;
binmode F;
# skip the #! line
$a = <F> ;
if ($a =~ /^#!/)
{
$sharp_bang = $a ;
$a = <F> ;
}
# skip "use decrypt;" line
die "No use $module_name in $file\n"
unless $a =~ /use\s+$module_name\s*;/ ;
read(F, $f, length($Fingerprint)) || die "Cannot read from $file: $!\n" ;
(print "skipping file '$file': not encrypted\n"), next
unless $f eq $Fingerprint ;
print "decrypting $file to $file.pd\n" ;
open (O, ">", ${file}.".pd") || die "Cannot open ${file}.pd: $!\n" ;
binmode O;
print O $sharp_bang if $sharp_bang ;
while ($size = read(F, $block, $BLOCKSIZE) )
{
print O ($block ^ substr($XOR, 0, $size)) ;
}
close F ;
close O ;
}
|