Crypt-OpenToken

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

            "Test::NoTabs" : "0",
            "Test::Pod" : "1.41",
            "Test::Pod::Coverage" : "1.08",
            "Test::Spelling" : "0.17",
            "Test::Synopsis" : "0",
            "Test::Vars" : "0"
         }
      },
      "runtime" : {
         "recommends" : {
            "Crypt::CBC" : "0",
            "Crypt::DES_EDE3" : "0",
            "Crypt::NULL" : "0"
         },
         "requires" : {
            "Compress::Zlib" : "0",
            "Crypt::Rijndael" : "0",
            "Date::Parse" : "0",
            "DateTime" : "0",
            "Digest::HMAC_SHA1" : "0",
            "Digest::SHA1" : "0",

META.yml  view on Meta::CPAN

license: artistic_2
meta-spec:
  url: http://module-build.sourceforge.net/META-spec-v1.4.html
  version: '1.4'
name: Crypt-OpenToken
no_index:
  directory:
    - t
    - xt
recommends:
  Crypt::CBC: '0'
  Crypt::DES_EDE3: '0'
  Crypt::NULL: '0'
requires:
  Compress::Zlib: '0'
  Crypt::Rijndael: '0'
  Date::Parse: '0'
  DateTime: '0'
  Digest::HMAC_SHA1: '0'
  Digest::SHA1: '0'
  MIME::Base64: '0'

lib/Crypt/OpenToken/Cipher.pm  view on Meta::CPAN


Returns the key sized used for encryption, in bytes.

=item iv_len()

Returns the length of the Initialization Vector needed for encryption, in
bytes.

=item cipher($key, $iv)

Returns a C<Crypt::CBC> compatible cipher object which implements the
encryption.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

=head1 COPYRIGHT & LICENSE

lib/Crypt/OpenToken/Cipher/AES128.pm  view on Meta::CPAN

use Moose;
use Crypt::Rijndael;
use namespace::autoclean;

with 'Crypt::OpenToken::Cipher';

sub keysize { 16 }
sub iv_len  { 16 }
sub cipher {
    my ($self, $key, $iv) = @_;
    my $crypto = Crypt::Rijndael->new($key, Crypt::Rijndael::MODE_CBC());
    $crypto->set_iv($iv);
    return $crypto;
}

1;

=head1 NAME

Crypt::OpenToken::Cipher::AES128 - AES128 encryption support for OpenToken

lib/Crypt/OpenToken/Cipher/AES128.pm  view on Meta::CPAN


Returns the key size used for AES-128 encryption; 16 bytes.

=item iv_len()

Returns the length of the Initialization Vector needed for AES-128 encryption;
16 bytes.

=item cipher($key, $iv)

Returns a C<Crypt::CBC> compatible cipher the implements the AES-128
encryption.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

=head1 COPYRIGHT & LICENSE

lib/Crypt/OpenToken/Cipher/AES256.pm  view on Meta::CPAN


Returns the key size used for AES-256 encryption; 32 bytes.

=item iv_len()

Returns the length of the Initialization Vector needed for AES-256 encryption;
16 bytes.

=item cipher($key, $iv)

Returns a C<Crypt::CBC> compatible cipher the implements the AES-256
encryption.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

=head1 COPYRIGHT & LICENSE

lib/Crypt/OpenToken/Cipher/DES3.pm  view on Meta::CPAN

package Crypt::OpenToken::Cipher::DES3;

use Moose;
use Crypt::CBC;
use Crypt::DES_EDE3;
use namespace::autoclean;

with 'Crypt::OpenToken::Cipher';

sub keysize { 24 }
sub iv_len  { 8 }
sub cipher {
    my ($self, $key, $iv) = @_;

    my $cipher = Crypt::CBC->new(
        -key         => $key,
        -literal_key => 1,
        -cipher      => 'DES_EDE3',
        -header      => 'none',
        -iv          => $iv,
    );
    return $cipher;
}

1;

lib/Crypt/OpenToken/Cipher/DES3.pm  view on Meta::CPAN


Returns the key size used for DES3 encryption; 24 bytes.

=item iv_len()

Returns the length of the Initialization Vector needed for DES3 encryption; 8
bytes.

=item cipher($key, $iv)

Returns a C<Crypt::CBC> compatible cipher the implements the DES3 encryption.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

=head1 COPYRIGHT & LICENSE

C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under

lib/Crypt/OpenToken/Cipher/null.pm  view on Meta::CPAN


Returns the key size used for NULL encryption; 0 bytes.

=item iv_len()

Returns the length of the Initialization Vector needed for NULL encryption; 0
bytes.

=item cipher($key, $iv)

Returns a C<Crypt::CBC> compatible cipher the implements the NULL encryption.

=back

=head1 AUTHOR

Graham TerMarsch (cpan@howlingfrog.com)

=head1 COPYRIGHT & LICENSE

C<Crypt::OpenToken> is Copyright (C) 2010, Socialtext, and is released under

t/00-report-prereqs.dd  view on Meta::CPAN

                                      'Test::NoTabs' => '0',
                                      'Test::Pod' => '1.41',
                                      'Test::Pod::Coverage' => '1.08',
                                      'Test::Spelling' => '0.17',
                                      'Test::Synopsis' => '0',
                                      'Test::Vars' => '0'
                                    }
                    },
       'runtime' => {
                      'recommends' => {
                                        'Crypt::CBC' => '0',
                                        'Crypt::DES_EDE3' => '0',
                                        'Crypt::NULL' => '0'
                                      },
                      'requires' => {
                                      'Compress::Zlib' => '0',
                                      'Crypt::Rijndael' => '0',
                                      'Date::Parse' => '0',
                                      'DateTime' => '0',
                                      'Digest::HMAC_SHA1' => '0',
                                      'Digest::SHA1' => '0',

t/crypto-3des168.t  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;
use if $ENV{AUTOMATED_TESTING}, 'Test::DiagINC'; use MIME::Base64;
use Test2::V0;
use Test2::Require::Module 'Crypt::CBC';
use Test2::Require::Module 'Crypt::DES_EDE3';

use Crypt::OpenToken;

###############################################################################
# TEST DATA
my @test_data = (
    {   # generated w/PingId PHP Integration Kit
        password_base64 => 'YTY2QzlNdk04ZVk0cUpLeUNYS1crMTlQV0RldWMzdGg=',
        token => 'T1RLAQMdbpCui_Mpsin3jAo2Qcr482eYwghHrjVaX6X4WAAAGBrFPLDACb_ZOnmNNKLj26R-dITesg-bdA**',



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