Catalyst::Plugin::Crypt::CBC - Crypt::CBC plugin for Catalyst.
use Catalyst qw/Crypt::CBC/; # Set option - sample MyApp->config->{crypt_cbc} = { key => 'my secret key', cipher => 'Blowfish', # this sample need Crypt::Blowfish } # Set option - anothor sample MyApp->config->{crypt_cbc} = { key => 'my secret key', cipher => 'Blowfish', iv => '$KJh#(}q', regenerate_key => 0, padding => 'space', prepend_iv => 0, } # Use Crypt::CBC objects within your Catalyst app: my $crypt = $c->crypt_cbc(); # will return a Crypt::CBC object my $plaintext = 'Hello'; my $ciphertext = $crypt->encrypt_hex($plaintext); #53616c7465645f5fa42e58c38281a94fe591200d18dc335f my $return_plain_text = $crypt->decrypt_hex($ciphertext); #Hello # Example when Catalyst::View::TT <a href="uri?id=[% Catalyst.crypt_cbc.encrypt_hex(user_id) %]">user_name</a>
This plugin is to make the wonders of Crypt::CBC easily accesible within a Catalyst application via the Catalyst::Plugin interface. See Crypt::CBC for more information.
Returns a Crypt::CBC object. If params are argued they will be passed to the Crypt::CBC->new() method.
Crypt::CBC->new()
Catalyst, Crypt::CBC
Kazuma Shiraiwa
Copyright (C) 2007 by Kazuma Shiraiwa. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
To install Catalyst::Plugin::Crypt::CBC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Plugin::Crypt::CBC
CPAN shell
perl -MCPAN -e shell install Catalyst::Plugin::Crypt::CBC
For more information on module installation, please visit the detailed CPAN module installation guide.