Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

How to use Crypt::Module

by m_jaser (Novice)
on May 16, 2017 at 00:51 UTC ( #1190353=perlquestion: print w/replies, xml ) Need Help??
m_jaser has asked for the wisdom of the Perl Monks concerning the following question:

Hi PerlMonks,

I have a perl script which I'd like to encrypt before it is further distributed, I came across the "Module::Crypt" module and now i'm trying to install it but running into errors, please see below the cpan install log.

My Questions are:

1- Is "Module::Crypt" good enough to encrypt a perl script?

2- Would the script's execution slow down after it is encrypted?

3- I couldn't find good info or examples on how to use this module, can you please help share any info you have on the Crypt module?

Thank You...!

Going to read '/home/emarwja/.cpan/Metadata' Database was generated on Mon, 15 May 2017 01:53:49 GMT Running install for module 'Module::Crypt' Running make for A/AA/AAR/Module-Crypt-0.06.tar.gz Checksum for /home/emarwja/.cpan/sources/authors/id/A/AA/AAR/Module-Cr +ypt-0.06.tar.gz ok Scanning cache /home/emarwja/.cpan/build for sizes ...................................................................... +......DONE CPAN.pm: Going to build A/AA/AAR/Module-Crypt-0.06.tar.gz Checking if your kit is complete... Looks good Generating a Unix-style Makefile Writing Makefile for Module::Crypt Writing MYMETA.yml and MYMETA.json cp Crypt.pm blib/lib/Module/Crypt.pm Manifying 1 pod document AAR/Module-Crypt-0.06.tar.gz /usr/bin/make -- OK Running make test PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM" "-MTes +t::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'bl +ib/lib', 'blib/arch')" t/*.t t/01-basic.t ... 1/4 Can't exec "gcc": No such file or directory at /u +sr/lib/perl5/5.14/ExtUtils/CBuilder/Base.pm line 320. error building /home/emarwja/.cpan/build/Module-Crypt-0.06-KS3wJ4/t/ou +tput/tmp.725HDoQ_K/Foo/Bar.o from '/home/emarwja/.cpan/build/Module-C +rypt-0.06-KS3wJ4/t/output/tmp.725HDoQ_K/Foo/Bar.c' at /usr/lib/perl5/ +5.14/ExtUtils/CBuilder/Base.pm line 175. t/01-basic.t ... Failed 3/4 subtests t/02-nopass.t .. 1/4 Can't exec "gcc": No such file or directory at /u +sr/lib/perl5/5.14/ExtUtils/CBuilder/Base.pm line 320. error building /home/emarwja/.cpan/build/Module-Crypt-0.06-KS3wJ4/t/ou +tput/tmp.2l5rqhYfM/Foo/Bar.o from '/home/emarwja/.cpan/build/Module-C +rypt-0.06-KS3wJ4/t/output/tmp.2l5rqhYfM/Foo/Bar.c' at /usr/lib/perl5/ +5.14/ExtUtils/CBuilder/Base.pm line 175. t/02-nopass.t .. Failed 3/4 subtests t/03-death.t ... 1/4 Can't exec "gcc": No such file or directory at /u +sr/lib/perl5/5.14/ExtUtils/CBuilder/Base.pm line 320. error building /home/emarwja/.cpan/build/Module-Crypt-0.06-KS3wJ4/t/ou +tput/tmp.mfsA7O4tA/Foo/Bar.o from '/home/emarwja/.cpan/build/Module-C +rypt-0.06-KS3wJ4/t/output/tmp.mfsA7O4tA/Foo/Bar.c' at /usr/lib/perl5/ +5.14/ExtUtils/CBuilder/Base.pm line 175. t/03-death.t ... Failed 3/4 subtests t/04-addl1.t ... 1/3 Can't exec "gcc": No such file or directory at /u +sr/lib/perl5/5.14/ExtUtils/CBuilder/Base.pm line 320. error building /home/emarwja/.cpan/build/Module-Crypt-0.06-KS3wJ4/t/ou +tput/tmp.o38HupnwY/Foo/Bar.o from '/home/emarwja/.cpan/build/Module-C +rypt-0.06-KS3wJ4/t/output/tmp.o38HupnwY/Foo/Bar.c' at /usr/lib/perl5/ +5.14/ExtUtils/CBuilder/Base.pm line 175. t/04-addl1.t ... Failed 2/3 subtests t/05-addl2.t ... 1/4 Can't exec "gcc": No such file or directory at /u +sr/lib/perl5/5.14/ExtUtils/CBuilder/Base.pm line 320. error building /home/emarwja/.cpan/build/Module-Crypt-0.06-KS3wJ4/t/ou +tput/tmp.0Xlt2aTWA/Foo/Bar.o from '/home/emarwja/.cpan/build/Module-C +rypt-0.06-KS3wJ4/t/output/tmp.0Xlt2aTWA/Foo/Bar.c' at /usr/lib/perl5/ +5.14/ExtUtils/CBuilder/Base.pm line 175. t/05-addl2.t ... Failed 3/4 subtests Test Summary Report ------------------- t/01-basic.t (Wstat: 0 Tests: 1 Failed: 0) Parse errors: Bad plan. You planned 4 tests but ran 1. t/02-nopass.t (Wstat: 0 Tests: 1 Failed: 0) Parse errors: Bad plan. You planned 4 tests but ran 1. t/03-death.t (Wstat: 0 Tests: 1 Failed: 0) Parse errors: Bad plan. You planned 4 tests but ran 1. t/04-addl1.t (Wstat: 0 Tests: 1 Failed: 0) Parse errors: Bad plan. You planned 3 tests but ran 1. t/05-addl2.t (Wstat: 0 Tests: 1 Failed: 0) Parse errors: Bad plan. You planned 4 tests but ran 1. Files=5, Tests=5, 4 wallclock secs ( 0.06 usr 0.37 sys + 1.07 cusr + 1.91 csys = 3.42 CPU) Result: FAIL Failed 5/5 test programs. 0/5 subtests failed. Makefile:857: recipe for target 'test_dynamic' failed make: *** [test_dynamic] Error 255 AAR/Module-Crypt-0.06.tar.gz /usr/bin/make test -- NOT OK //hint// to see the cpan-testers results for installing this module, t +ry: reports AAR/Module-Crypt-0.06.tar.gz Running make install Manifying 1 pod document Appending installation info to /usr/lib/perl5/5.14/i686-cygwin-threads +-64int/perllocal.pod AAR/Module-Crypt-0.06.tar.gz /usr/bin/make install -- OK Failed during this command: AAR/Module-Crypt-0.06.tar.gz : make_test FAILED but f +ailure ignored because 'force' in effect

Replies are listed 'Best First'.
Re: How to use Crypt::Module
by haukex (Canon) on May 16, 2017 at 08:04 UTC
    Is "Module::Crypt" good enough to encrypt a perl script?

    What is your definition of "good enough"? Note that there are no 100% perfect solutions - simply put, in order to run your code the computer is going to have to see it at some point. Also, you've read the documentation of Module::Crypt, right? In particular the Abstract? "... please keep in mind that nothing will keep a determined person from cracking any defense. We can only hope that with Module::Crypt it will take a seasoned Perl wizard to do this, not ordinary Joe Wannabe Cracker." See also How can I hide the source for my Perl program?

    Would the script's execution slow down after it is encrypted?

    Loading the script might be a little slower, but once it's compiled I think it should run at the same speed. But the only way to know for sure is to measure.

    running into errors, please see below the cpan install log.

    The errors say "Can't exec "gcc": No such file or directory", so it sounds like you don't have the GNU C Compiler installed. It looks like you're on some *NIX system, so you should be able to look into your package manager's directory for the package that contains "gcc". For example, on Debian-based systems like Ubuntu, sudo apt-get install build-essential.

Re: How to use Crypt::Module
by Marshall (Abbot) on May 16, 2017 at 03:50 UTC
    I have a perl script which I'd like to encrypt before it is further distributed,...

    At the end of the day, no matter what the delivery system of the Perl program is, a Perl program will become expanded into source code text somewhere in the filesystem and be compiled by Perl.

    Active State does have a program, PerlApp which can confuse things quite a bit and make recovering the actual source code from an executable file difficult. "Difficult" does not mean impossible.

    The Perl source code will be contained within a Perl executable file. This is not at all like a compiled C program.

    It is certainly possible to encrypt/decrypt a file that is transferred between systems. And of course a Perl program could be such a file. Installing Crypt, although that installation fails, doesn't appear to have anything to do with the desired objective.

Re: How to use Crypt::Module
by hippo (Canon) on May 16, 2017 at 08:00 UTC
    Can't exec "gcc": No such file or directory at /usr/lib/perl5/5.14/ExtUtils/CBuilder/Base.pm line 320.

    That seems pretty self-explanatory to me. You don't have gcc installed or if you do then it isn't in your path.

Re: How to use Crypt::Module
by afoken (Abbot) on May 17, 2017 at 07:21 UTC
Re: How to use Crypt::Module
by herveus (Parson) on May 16, 2017 at 14:36 UTC
        Howdy!

        That assertion depends on how you define "encryption". A simple substitution cipher is encryption. Weak, but...

        That said, my suggestion was tongue-in-cheek ("heppin"). But the goal of the OP was unrealistic, and my suggestion was simpler than the path they were going down.

        yours,
        Michael

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1190353]
Approved by beech
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2018-10-21 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (119 votes). Check out past polls.

    Notices?