| 1 | package Aut::Crypt; | ||
| 2 | |||
| 3 | # $Id: Crypt.pm,v 1.2 2004/04/08 16:55:13 cvs Exp $ | ||
| 4 | |||
| 5 | 1 | ▶ | use Crypt::CBC; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 9 | 0 | my $class=shift; | |
| 10 | 0 | my $key=shift; | |
| 11 | 0 | my $self; | |
| 12 | |||
| 13 | 0 | $self->{"key"}=$key; | |
| 14 | |||
| 15 | 0 | bless $self,$class; | |
| 16 | 0 | return $self; | |
| 17 | } | ||
| 18 | |||
| 19 | 0 | ▶ | sub encrypt { |
|
Subroutine
encrypt: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 20 | 0 | my $self=shift; | |
| 21 | 0 | my $text=shift; | |
| 22 | 0 | my $cbc=new Crypt::CBC( { 'key' => $self->{"key"}, 'cipher' => 'Blowfish' } ); | |
| 23 | 0 | return $cbc->encrypt($text); | |
| 24 | } | ||
| 25 | |||
| 26 | 0 | ▶ | sub decrypt { |
|
Subroutine
decrypt: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 27 | 0 | my $self=shift; | |
| 28 | 0 | my $text=shift; | |
| 29 | 0 | my $cbc=new Crypt::CBC( { 'key' => $self->{"key"}, 'cipher' => 'Blowfish' } ); | |
| 30 | 0 | return $cbc->decrypt($text); | |
| 31 | } | ||
| 32 | |||
| 33 | 1 | 1; | |
| 34 | __END__ | ||