Code-Crypt

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "ExtUtils::MakeMaker" : "6.30"
         }
      },
      "develop" : {
         "requires" : {
            "Test::Pod" : "1.41"
         }
      },
      "runtime" : {
         "requires" : {
            "Crypt::CBC" : "2.32",
            "Crypt::DES" : "2.05",
            "MIME::Base64" : "3.13",
            "Moo" : "1.000007"
         }
      }
   },
   "release_status" : "stable",
   "resources" : {
      "repository" : {
         "type" : "git",

META.yml  view on Meta::CPAN

configure_requires:
  ExtUtils::MakeMaker: 6.30
dynamic_config: 0
generated_by: 'Dist::Zilla version 4.300034, CPAN::Meta::Converter version 2.130880'
license: perl
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: 1.4
name: Code-Crypt
requires:
  Crypt::CBC: 2.32
  Crypt::DES: 2.05
  MIME::Base64: 3.13
  Moo: 1.000007
resources:
  repository: git://github.com/frioux/Code-Crypt.git
version: 0.001000

Makefile.PL  view on Meta::CPAN

  "AUTHOR" => "Arthur Axel \"fREW\" Schmidt <frioux+cpan\@gmail.com>",
  "BUILD_REQUIRES" => {},
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => "6.30"
  },
  "DISTNAME" => "Code-Crypt",
  "EXE_FILES" => [],
  "LICENSE" => "perl",
  "NAME" => "Code::Crypt",
  "PREREQ_PM" => {
    "Crypt::CBC" => "2.32",
    "Crypt::DES" => "2.05",
    "MIME::Base64" => "3.13",
    "Moo" => "1.000007"
  },
  "TEST_REQUIRES" => {},
  "VERSION" => "0.001000",
  "test" => {
    "TESTS" => "t/*.t"
  }
);

README  view on Meta::CPAN

ATTRIBUTES
  "key"
    required. The key used to encrypt the code.

  "get_key"
    required. The code to be inlined into the final code to get the key.
    Could read a file, prompt the user, or anything else.

  "cipher"
    required. The cipher used to encrypt the code. Crypt::Rijndael is
    recommended. See Crypt::CBC for other options.

  "code"
    The code that will be encrypted.

SEE ALSO
    Code::Crypt::Graveyard

AUTHOR
    Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>

dist.ini  view on Meta::CPAN

repository.type = git

[MetaJSON]
[PodWeaver]
[PkgVersion]
[ReadmeFromPod]
[PodSyntaxTests]

[Prereqs]
Moo                 = 1.000007
Crypt::CBC          = 2.32
MIME::Base64        = 3.13
Crypt::DES          = 2.05

lib/Code/Crypt.pm  view on Meta::CPAN

package Code::Crypt;
{
  $Code::Crypt::VERSION = '0.001000';
}

# ABSTRACT: Encrypt your code

use Moo;

use Crypt::CBC;
use MIME::Base64 'encode_base64';
has code => ( is => 'rw' );

has [qw( key get_key cipher )] => (
   is => 'ro',
   required => 1,
);

sub bootstrap {
sprintf(<<'BOOTSTRAP', $_[0]->get_key, $_[0]->cipher );
use strict;
use warnings;

use Crypt::CBC;
use MIME::Base64 'decode_base64';

my $key = do {%s};

my $cipher = Crypt::CBC->new(
   -key => $key,
   -cipher => '%s',
);

my $ciphertext = decode_base64(<<'DATA');
%%sDATA

my $plain = $cipher->decrypt($ciphertext);
local $@ = undef;
eval($plain);

lib/Code/Crypt.pm  view on Meta::CPAN

      warn "built code was: " . Data::Dumper::Concise::Dumper($plain);
   }
   die "This code was probably meant to run elsewhere:\n\n$_"
}
BOOTSTRAP
}

sub ciphercode {
   my $self = shift;

   my $cipher = Crypt::CBC->new(
      -key => $self->key,
      -cipher => $self->cipher,
   );

   my $code = $self->code;
   return $cipher->encrypt($code)
}

sub final_code { sprintf $_[0]->bootstrap, encode_base64($_[0]->ciphercode) }

lib/Code/Crypt.pm  view on Meta::CPAN

B<required>.  The key used to encrypt the code.

=head2 C<get_key>

B<required>.  The code to be inlined into the final code to get the key.  Could
read a file, prompt the user, or anything else.

=head2 C<cipher>

B<required>.  The cipher used to encrypt the code.  L<Crypt::Rijndael> is
recommended.  See L<Crypt::CBC> for other options.

=head2 C<code>

The code that will be encrypted.

=head1 SEE ALSO

L<Code::Crypt::Graveyard>

=head1 AUTHOR



( run in 1.817 second using v1.01-cache-2.11-cpan-e1769b4cff6 )