[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



Oop, I missed this the other day . . .

[...]

    Christopher> I read in the O'reilly book "Learning Python" that
    Christopher> the code can be compiled into a .pyc file.  How do I
    Christopher> compile into .pyc so that I can distribute the code
    Christopher> without the source being seen?  This is one of my
    Christopher> biggest problems with Perl.

Python bytecode's not going to prevent anyone from mucking with things
any more than compiling Java to bytecode does (or C to machine code
for that matter).  If someone's determined enough they'll be able to
recover pretty near the original source.


Having said that, if you want to raise the bar to discourage casual
mucking for Perl see perldoc B::Byetcode (although it's still pretty
experimental), PAR (which will wrap everything up into an executable
with an embedded zip archive), or one of the obfuscation filters (the
original Acme::Bleach, the somewhat repetitive Acme::Buffy, or the
swiss army chainsaw of source obfuscation Acme::EyeDrops) from CPAN.
Acme::EyeDrops comes with a script that'll easily let you turn:

#!/usr/bin/perl
print "Hello world\n";


Into this (yes, this is valid perl; not that that's going to surprise the
python people much . . . :)

#!/usr/bin/perl
                                      ''=~('('.'?'
           .'{'.(                   '`'|'%').("\["^
        '-').('`'|                '!').('`'|',').'"'
 .'#'."\!".  "\/".(              '['^'.').('['^'(').(
'['^')').'/'.(('`')|            '"').('`'|')').(('`')|
'.').'/'.('['^"\+").(          '`'|'%').('['^')').('`'
  |',').('!'^('+')).(        '!'^'+').('['^'+').(('[')^
       ')').('`'|')')      .('`'|'.').('['^'/').('{'^'['
      ).'\\'.('"').(     '`'^'(').('`'|'%').('`'|(',')).(
     '`'|',').("\`"|   '/').('{'^'[').('['^',').('`'|'/').
    ('['^')').('`'|   ',').('`'|'$').'\\'.'\\'.('`'|'.').''.
    '\\'.'"'."\;".(  '!'^'+').('!'^'+').('`'|'%').('['^'#').(
    '`'|')').('['^  '/').('{'^'[').('^'^('`'|'.')).';'.("\!"^
    '+').('!'^'+')  .'"'.'}'.')');$:='.'^'~';$~='@'|'(';$^=')'
    ^'[';$/='`'|'.';$,='('^'}';$\='`'|'!';$:=')'^'}';$~=('*')|
    '`';$^='+'^'_';$/='&'|'@';$,='['&'~';$\=','^'|';$:='.'^'~';
     $~='@'|'(';$^=')'^'[';$/='`'|'.';$,='('^'}';$\='`'|'!';$:=
     ')'^'}';$~='*'|'`';$^='+'^'_';$/='&'|'@';$,='['&'~';$\=','^
      '|';$:='.'^'~';$~='@'|'(';$^=')'^'[';$/='`'|'.';$,='('^'}';
       $\='`'|'!';$:=')'^'}';$~='*'|'`';$^='+'^'_';$/='&'|'@';$,=
        '['&'~';$\=','^'|';$:='.'^'~';$~='@'|'(';$^=')'^"\["; $/=
         '`'|'.';$,='('^'}';$\='`'|'!';$:=')'^'}';$~='*'|'`'  ;$^
          ='+'^'_';$/='&'|'@';$,='['&'~';$\=','^'|' ;$:='.'^  '~'
            ;$~='@'|'(';$^=')'^'[';$/='`'|"\.";$,=  '('^'}'   ;$\
             ='`'| '!';$:=')'^'}';$~='*'|"\`";$^=   '+'^'_'   ;$/
                   ='&'|'@';$,='['&'~';$\=(',')^    '|';$:=   '.'
                   ^'~';$~=    '@'|'(';$^ ="\)"^     '[';$/   =(
                   ('`'))|     "\.";$,=   ('(')^     '}';$\  =(
                   ('`'))|     "\!";$:=   "\)"^       "\}";  (
                   ($~))=      '*'|'`';   ($^)         ='+'
                   ^"\_";     $/=('&')|   '@';         ($,)
                    ='['&     "\~";$\=    ','^         '|';
                    ($:)=     '.'^'~'     ;$~=         '@'|
                    '(';     $^=')'       ^'['         ;$/=
                    '`'|     '.'          ;$,=         '('^
                    '}';      $\=         '`'          |((
                    '!'        ));       $:=           ')'
                    ^((         '}'     ));            $~=
                    '*'          |((   '`'              ))
                    ;(             ($^))=               ((
                    ((              '+'))               ))
                    ^+             "\_";$/=             ((
                   '&'            ))|+ "\@";            $,
                  =((           '['))&  '~';           $\=
                 ','^         "\|";$:=   '.'          ^'~'
               ;($~)=                                ('@')|
             "\(";$^=                               ')'^'['


__END__

-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org|  Vincent, you should cease askin'          \ o.O'
                      |  scary questions." -- Jules                =(___)=
                      |                                               U


</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="01305" href="msg01305.html">[ale] Py[h]hon syntax (sic)</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (fletch at phydeaux.org)</li></ul></li>
<li><strong><a name="01317" href="msg01317.html">[ale] Py[h]hon syntax (sic)</a></strong>
<ul><li><em>From:</em> jloden at toughguy.net (Jay Loden)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="01121" href="msg01121.html">[ale] Pyhon syntax</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (fletch at phydeaux.org)</li></ul></li>
<li><strong><a name="01129" href="msg01129.html">[ale] Pyhon syntax</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
<li><strong><a name="01133" href="msg01133.html">[ale] Py[h]hon syntax (sic)</a></strong>
<ul><li><em>From:</em> scherrey at proteus-tech.com (Benjamin Scherrey)</li></ul></li>
<li><strong><a name="01207" href="msg01207.html">[ale] Py[h]hon syntax (sic)</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
<li><strong><a name="01215" href="msg01215.html">[ale] Py[h]hon syntax (sic)</a></strong>
<ul><li><em>From:</em> jpheale at LearnLink.Emory.Edu (John P. Healey)</li></ul></li>
<li><strong><a name="01233" href="msg01233.html">[ale] Py[h]hon syntax (sic)</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg01303.html">[ale] Question for the Fedora users</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg01305.html">[ale] Py[h]hon syntax (sic)</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg01278.html">[ale] Py[h]hon syntax (sic)</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg01305.html">[ale] Py[h]hon syntax (sic)</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#01304"><strong>Date</strong></a></li>
<li><a href="threads.html#01304"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>