line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CryptX; |
2
|
|
|
|
|
|
|
|
3
|
129
|
|
|
129
|
|
703
|
use strict; |
|
129
|
|
|
|
|
200
|
|
|
129
|
|
|
|
|
3155
|
|
4
|
129
|
|
|
129
|
|
507
|
use warnings ; |
|
129
|
|
|
|
|
191
|
|
|
129
|
|
|
|
|
6110
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.080'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require XSLoader; |
8
|
|
|
|
|
|
|
XSLoader::load('CryptX', $VERSION); |
9
|
|
|
|
|
|
|
|
10
|
129
|
|
|
129
|
|
611
|
use Carp; |
|
129
|
|
|
|
|
229
|
|
|
129
|
|
|
|
|
8260
|
|
11
|
|
|
|
|
|
|
my $has_json; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
BEGIN { |
14
|
129
|
50
|
|
129
|
|
418
|
$has_json = 1 if eval { require JSON; 1 }; |
|
129
|
|
|
|
|
43323
|
|
|
0
|
|
|
|
|
0
|
|
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub _croak { |
18
|
23
|
50
|
33
|
23
|
|
121
|
die @_ if ref $_[0] || !$_[-1]; |
19
|
23
|
50
|
|
|
|
144
|
if ($_[-1] =~ /^(.*)( at .+ line .+\n$)/s) { |
20
|
23
|
|
|
|
|
44
|
pop @_; |
21
|
23
|
|
|
|
|
63
|
push @_, $1; |
22
|
|
|
|
|
|
|
} |
23
|
23
|
|
|
|
|
2687
|
die Carp::shortmess @_; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub _decode_json { |
27
|
0
|
0
|
|
0
|
|
|
croak "FATAL: cannot find JSON module" if !$has_json; |
28
|
0
|
|
|
|
|
|
return JSON->new->utf8->decode(shift); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _encode_json { |
32
|
0
|
0
|
|
0
|
|
|
croak "FATAL: cannot find JSON module" if !$has_json; |
33
|
0
|
|
|
|
|
|
return JSON->new->utf8->canonical->encode(shift); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=pod |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
CryptX - Cryptographic toolkit |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 DESCRIPTION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
Perl modules providing a cryptography based on L library. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=over |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item * Symmetric ciphers - see L and related modules |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
L, L, L, L, L, L, |
53
|
|
|
|
|
|
|
L, L, L, L, L, L, |
54
|
|
|
|
|
|
|
L, L, L, L, L, L, |
55
|
|
|
|
|
|
|
L, L, L, L, L, |
56
|
|
|
|
|
|
|
L, L |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=item * Block cipher modes |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
L, L, L, L, L |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=item * Stream ciphers |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
L, L, L, L, |
65
|
|
|
|
|
|
|
L, L |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item * Authenticated encryption modes |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
L, L, L, L, L |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item * Hash Functions - see L and related modules |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L, L, L, L, |
74
|
|
|
|
|
|
|
L, L, L, L, |
75
|
|
|
|
|
|
|
L, L, L, L, L, L, |
76
|
|
|
|
|
|
|
L, L, L, L, L, L, |
77
|
|
|
|
|
|
|
L, L, L, L, L, |
78
|
|
|
|
|
|
|
L, L, L, L, |
79
|
|
|
|
|
|
|
L, L, L, L, L |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item * Checksums |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L, L |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item * Message Authentication Codes |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L, L, L, L, L, |
88
|
|
|
|
|
|
|
L, L, L, L |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=item * Public key cryptography |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
L, L, L, L, L, L |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * Cryptographically secure random number generators - see L and related modules |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L, L, L, L, L |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * Key derivation functions - PBKDF1, PBKDF2 and HKDF |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * Other handy functions related to cryptography |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
L |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=back |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 LICENSE |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 COPYRIGHT |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Copyright (c) 2013-2023 DCIT, a.s. L / Karel Miko |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=cut |