1 |
package OpenSSL::Cipher; |
2 |
|
3 |
=head1 NAME |
4 |
|
5 |
OpenSSL::Cipher -- Access to OpenSSL Cipher functions |
6 |
|
7 |
=head1 SYNOPSIS |
8 |
|
9 |
use OpenSSL::Cipher qw(new_encrypt new_decrypt enum_ciphers); |
10 |
|
11 |
my %cip = enum_ciphers(); |
12 |
print "cipher \"$_\" keybytes = $cip{$_}\n" for(keys %cip); |
13 |
|
14 |
$ctx = new_encrypt("des-ede", "keykeyke"); |
15 |
$enc = $ctx->update("hi wappla !"); |
16 |
$enc .= $ctx->update ("this, too"); |
17 |
$enc .= $ctx->final; |
18 |
|
19 |
=head1 DESCRIPTION |
20 |
|
21 |
hmm. many things to add, but no time... |
22 |
|
23 |
=cut |
24 |
|
25 |
|
26 |
use OpenSSL; |
27 |
|
28 |
our $VERSION = '0.06'; |
29 |
use base Exporter; |
30 |
@EXPORT_OK = qw(new_encrypt new_decrypt enum_ciphers); |
31 |
|
32 |
=head1 FUNCTIONS |
33 |
|
34 |
=over 4 |
35 |
|
36 |
=item $ctx = new_encrypt($cipname, $key) |
37 |
|
38 |
Creates a handle for encryption method $ciphername using key $key. |
39 |
|
40 |
=item $ctx = new_decrypt($cipname, $key) |
41 |
|
42 |
Creates a handle for decryption method $ciphername using key $key. |
43 |
|
44 |
=item $encdec = $ctx->update($string) |
45 |
|
46 |
Adds $string for en/decryption. |
47 |
|
48 |
=item $restbytes = $ctx->final |
49 |
|
50 |
Finishes the encryption/decryption. |
51 |
|
52 |
=item %cip = enum_ciphers(); |
53 |
|
54 |
Returns a list that consists of "ciphername, keybytes" pairs. |
55 |
|
56 |
=back |
57 |
|
58 |
=head1 SEE ALSO |
59 |
|
60 |
L<OpenSSL>, L<OpenSSL::HMAC>. |
61 |
|
62 |
=head1 AUTHOR |
63 |
|
64 |
Stefan Traby <stefan@hello-penguin.com> |
65 |
http://mindterm.plan9.de/ |
66 |
|
67 |
=cut |
68 |
|
69 |
1; |