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