line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::SSH::Perl::Cipher::IDEA; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
23
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Net::SSH::Perl::Cipher; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
21
|
|
7
|
1
|
|
|
1
|
|
4
|
use base qw( Net::SSH::Perl::Cipher ); |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
114
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
464
|
use Net::SSH::Perl::Cipher::CFB; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
30
|
|
10
|
1
|
|
|
1
|
|
584
|
use Crypt::IDEA; |
|
1
|
|
|
|
|
1015
|
|
|
1
|
|
|
|
|
227
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
6
|
|
|
6
|
1
|
14
|
my $class = shift; |
14
|
6
|
|
|
|
|
19
|
my $ciph = bless { }, $class; |
15
|
6
|
50
|
|
|
|
27
|
$ciph->init(@_) if @_; |
16
|
6
|
|
|
|
|
86
|
$ciph; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub init { |
20
|
6
|
|
|
6
|
0
|
11
|
my $ciph = shift; |
21
|
6
|
|
|
|
|
19
|
my($key, $iv) = @_; |
22
|
6
|
|
|
|
|
33
|
my $idea = IDEA->new(substr $key, 0, 16); |
23
|
6
|
|
|
|
|
190
|
$ciph->{cfb} = Net::SSH::Perl::Cipher::CFB->new($idea, $iv); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub encrypt { |
27
|
3
|
|
|
3
|
1
|
2585
|
my($ciph, $text) = @_; |
28
|
3
|
|
|
|
|
11
|
$ciph->{cfb}->encrypt($text); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub decrypt { |
32
|
3
|
|
|
3
|
1
|
14
|
my($ciph, $text) = @_; |
33
|
3
|
|
|
|
|
8
|
$ciph->{cfb}->decrypt($text); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |