4

I'm looking for an idea. An idea that can--in some form--allow me to pepper my Perl code with hard-to-remove copyright comments all over the place so that it's almost illegible and is difficult to remove using a regex--with the code still being executable.


As one of the commenters has pointed out below the following trick can be applied to any such normal technique:

perl -MO=Deparse obfuscated.pl > plaintext.pl

Perhaps someone here can find a work around.

4

3 回答 3

7

我的贡献,很容易解决,但可能会绊倒一个草率的代码窃取者:如果版权声明已被篡改,则会在代码中引入细微的错误

例子:

sub square_root {
    my $arg = shift;
    return sqrt($arg + 0.1 * apply_fudge_factor());
}

sub apply_fudge_factor {
    return 8410 != unpack("%32W*", ($::D//=join'',<DATA>));
}

print "sqrt(9)=",square_root(9);

__END__
=head1 NAME

my_program.pl - a program by me, and not by you

=head1 AUTHOR

Copyright (c) 2014 by Me

=cut

pod的校验和是8410。如果在__END__token后面做任何修改,程序的输出是

sqrt(9)=3.01662062579967
于 2014-03-03T17:51:44.520 回答
2

正如评论中所指出的,删除所有评论很容易。

您要做的是以明确无误的方式留下您的商标。你可能想Acme::EyeDrops试一试。

于 2014-03-03T17:30:59.647 回答
1

无论您如何添加版权声明,故意为您的作品赢得荣誉的人可能不会三思而后行。您实际上遇到了一个较大的问题,该问题不容易通过代码解决。

也就是说,我曾经使用过的一个技巧是使用十六进制编辑器将文本添加到我的应用程序使用的 JPEG 图像的尾部。许多程序只是忽略了这个额外的信息,因为它是在通常的 EXIF 字段之外添加的,单独使用图像编辑器很难检测到,尽管可以使用文本搜索来找到它,使用容易识别的文本。有关更多信息,请参阅以下链接...

http://en.wikipedia.org/wiki/Steganography

如果您在 Windows 系统上,另一种选择是将数据加载到称为“备用数据流”的旧技巧。

于 2014-03-03T18:01:30.267 回答