1Crypt::Mac::Pelican(3)User Contributed Perl DocumentationCrypt::Mac::Pelican(3)
2
3
4

NAME

6       Crypt::Mac::Pelican - Message authentication code Pelican (AES based
7       MAC)
8

SYNOPSIS

10          ### Functional interface:
11          use Crypt::Mac::Pelican qw( pelican pelican_hex );
12
13          # calculate MAC from string/buffer
14          $pelican_raw  = pelican($key, 'data buffer');
15          $pelican_hex  = pelican_hex($key, 'data buffer');
16          $pelican_b64  = pelican_b64($key, 'data buffer');
17          $pelican_b64u = pelican_b64u($key, 'data buffer');
18
19          ### OO interface:
20          use Crypt::Mac::Pelican;
21
22          $d = Crypt::Mac::Pelican->new($key);
23          $d->add('any data');
24          $d->addfile('filename.dat');
25          $d->addfile(*FILEHANDLE);
26          $result_raw  = $d->mac;     # raw bytes
27          $result_hex  = $d->hexmac;  # hexadecimal form
28          $result_b64  = $d->b64mac;  # Base64 form
29          $result_b64u = $d->b64umac; # Base64 URL Safe form
30

DESCRIPTION

32       Provides an interface to the Pelican message authentication code (MAC)
33       algorithm.
34

EXPORT

36       Nothing is exported by default.
37
38       You can export selected functions:
39
40         use Crypt::Mac::Pelican qw(pelican pelican_hex );
41
42       Or all of them at once:
43
44         use Crypt::Mac::Pelican ':all';
45

FUNCTIONS

47   pelican
48       Logically joins all arguments into a single string, and returns its
49       Pelican message authentication code encoded as a binary string.
50
51        $pelican_raw = pelican($key, 'data buffer');
52        #or
53        $pelican_raw = pelican($key, 'any data', 'more data', 'even more data');
54
55   pelican_hex
56       Logically joins all arguments into a single string, and returns its
57       Pelican message authentication code encoded as a hexadecimal string.
58
59        $pelican_hex = pelican_hex($key, 'data buffer');
60        #or
61        $pelican_hex = pelican_hex($key, 'any data', 'more data', 'even more data');
62
63   pelican_b64
64       Logically joins all arguments into a single string, and returns its
65       Pelican message authentication code encoded as a Base64 string.
66
67        $pelican_b64 = pelican_b64($key, 'data buffer');
68        #or
69        $pelican_b64 = pelican_b64($key, 'any data', 'more data', 'even more data');
70
71   pelican_b64u
72       Logically joins all arguments into a single string, and returns its
73       Pelican message authentication code encoded as a Base64 URL Safe string
74       (see RFC 4648 section 5).
75
76        $pelican_b64url = pelican_b64u($key, 'data buffer');
77        #or
78        $pelican_b64url = pelican_b64u($key, 'any data', 'more data', 'even more data');
79

METHODS

81   new
82        $d = Crypt::Mac::Pelican->new($key);
83
84   clone
85        $d->clone();
86
87   reset
88        $d->reset();
89
90   add
91        $d->add('any data');
92        #or
93        $d->add('any data', 'more data', 'even more data');
94
95   addfile
96        $d->addfile('filename.dat');
97        #or
98        $d->addfile(*FILEHANDLE);
99
100   mac
101        $result_raw = $d->mac();
102
103   hexmac
104        $result_hex = $d->hexmac();
105
106   b64mac
107        $result_b64 = $d->b64mac();
108
109   b64umac
110        $result_b64url = $d->b64umac();
111

SEE ALSO

113       ·   CryptX
114
115       ·   <http://eprint.iacr.org/2005/088.pdf>
116
117
118
119perl v5.28.0                      2017-09-15            Crypt::Mac::Pelican(3)
Impressum