RFC 2313
RFC 2313
Kaliski
Request for Comments: 2313 RSA Laboratories East
Category: Informational March 1998
Copyright Notice
Overview
This document describes a method for encrypting data using the RSA
public-key cryptosystem.
1. Scope
This document describes a method for encrypting data using the RSA
public-key cryptosystem. Its intended use is in the construction of
digital signatures and digital envelopes, as described in PKCS #7:
The document also describes a syntax for RSA public keys and private
keys. The public-key syntax would be used in certificates; the
private-key syntax would be used typically in PKCS #8 private-key
information. The public-key syntax is identical to that in both X.509
and Privacy-Enhanced Mail. Thus X.509/PEM RSA keys can be used in
this document.
2. References
3. Definitions
Upper-case symbols (e.g., BT) denote octet strings and bit strings
(in the case of the signature S); lower-case symbols (e.g., c) denote
integers.
The next six sections specify key generation, key syntax, the
encryption process, the decryption process, signature algorithms, and
object identifiers.
Each entity shall generate a pair of keys: a public key and a private
key. The encryption process shall be performed with one of the keys
and the decryption process shall be performed with the other key.
Thus the encryption process can be either a public-key operation or a
private-key operation, and so can the decryption process. Both
processes transform an octet string to another octet string. The
processes are inverses of each other if one process uses an entity’s
public key and the other process uses the same entity’s private key.
6. Key generation
Each entity shall privately and randomly select two distinct odd
primes p and q such that (p-1) and e have no common divisors, and
(q-1) and e have no common divisors.
n = pq .
Notes.
7. Key syntax
This section gives the syntax for RSA public and private keys.
Notes.
8. Encryption process
The length of the data D shall not be more than k-11 octets, which is
positive since the length k of the modulus is at least 12 octets.
This limitation guarantees that the length of the padding string PS
is at least eight octets, which is a security condition.
Notes.
A block type BT, a padding string PS, and the data D shall be
formatted into an octet string EB, the encryption block.
EB = 00 || BT || PS || 00 || D . (1)
Notes.
k
x = SUM 2^(8(k-i)) EBi . (2)
i = 1
Note. The integer encryption block x satisfies 0 <= x < n since EB1
= 00 and 2^(8(k-1)) <= n.
k
y = SUM 2^(8(k-i)) EDi . (3)
i = 1
where ED1, ..., EDk are the octets of ED from first to last.
9. Decryption process
Notes.
The data D shall be encrypted with the signer’s RSA private key as
described in Section 7 to give an octet string ED, the encrypted
data. The block type shall be 01. (See Section 8.1.)
The encrypted data ED shall be decrypted with the signer’s RSA public
key as described in Section 8 to give an octet string D, the data.
Note. X.509’s object identifier rsa also identifies RSA public keys
as defined in Section 7, but does not identify private keys, and
identifies different encryption and decryption processes. It is
expected that some applications will identify public keys by rsa.
Such public keys are compatible with this document; an rsaEncryption
process under an rsa public key is the same as the rsaEncryption
process under an rsaEncryption public key.
Security Considerations
Revision history
Versions 1.0-1.3
Version 1.4
Version 1.5
Acknowledgements
Author’s Address
Burt Kaliski
RSA Laboratories East
20 Crosby Drive
Bedford, MA 01730
The limited permissions granted above are perpetual and will not be
revoked by the Internet Society or its successors or assigns.