1Crypt::RSA::ES::OAEP(3)User Contributed Perl DocumentatioCnrypt::RSA::ES::OAEP(3)
2
3
4
6 Crypt::RSA::ES::OAEP - Plaintext-aware encryption with RSA.
7
9 my $oaep = new Crypt::RSA::ES::OAEP;
10
11 my $ct = $oaep->encrypt( Key => $key, Message => $message ) ⎪⎪
12 die $oaep->errstr;
13
14 my $pt = $oaep->decrypt( Key => $key, Cyphertext => $ct ) ⎪⎪
15 die $oaep->errstr;
16
18 This module implements Optimal Asymmetric Encryption, a plaintext-aware
19 encryption scheme based on RSA. The notion of plaintext-aware implies
20 it's computationally infeasible to obtain full or partial information
21 about a message from a cyphertext, and computationally infeasible to
22 generate a valid cyphertext without knowing the corresponding message.
23 Plaintext-aware schemes, such as OAEP, are semantically secure, non-
24 malleable and secure against chosen-ciphertext attack. For more infor‐
25 mation on OAEP and plaintext-aware encryption, see [3], [9] & [13].
26
28 new()
29
30 Constructor.
31
32 version()
33
34 Returns the version number of the module.
35
36 encrypt()
37
38 Encrypts a string with a public key and returns the encrypted string on
39 success. encrypt() takes a hash argument with the following mandatory
40 keys:
41
42 Message
43 A string to be encrypted. The length of this string should not
44 exceed k-42 octets, where k is the octet length of the RSA modulus.
45 If Message is longer than k-42, the method will fail and set
46 $self->errstr to "Message too long." This means the key must be at
47 least _336_ bits long if you are to use OAEP.
48
49 Key Public key of the recipient, a Crypt::RSA::Key::Public object.
50
51 decrypt()
52
53 Decrypts cyphertext with a private key and returns plaintext on suc‐
54 cess. $self->errstr is set to "Decryption Error." or appropriate error
55 on failure. decrypt() takes a hash argument with the following manda‐
56 tory keys:
57
58 Cyphertext
59 A string encrypted with encrypt(). The length of the cyphertext
60 must be k octets, where k is the length of the RSA modulus.
61
62 Key Private key of the receiver, a Crypt::RSA::Key::Private object.
63
64 Version
65 Version of the module that was used for creating the Cyphertext.
66 This is an optional argument. When present, decrypt() will ensure
67 before proceeding that the installed version of the module can suc‐
68 cessfully decrypt the Cyphertext.
69
71 See ERROR HANDLING in Crypt::RSA(3) manpage.
72
74 See BIBLIOGRAPHY in Crypt::RSA(3) manpage.
75
77 Vipul Ved Prakash, <mail@vipul.net>
78
80 Crypt::RSA(3), Crypt::RSA::Primitives(3), Crypt::RSA::Keys(3),
81 Crypt::RSA::SSA::PSS(3)
82
83
84
85perl v5.8.8 2007-04-17 Crypt::RSA::ES::OAEP(3)