This article needs additional citations for verification. (March 2019)
In cryptography, PKCS #1 is the first of a family of standards called Public-Key Cryptography Standards (PKCS), published by RSA Laboratories. It provides the basic definitions of and recommendations for implementing the RSA algorithm for public-key cryptography. It defines the mathematical properties of public and private keys, primitive operations for encryption and signatures, secure cryptographic schemes, and related ASN.1 syntax representations.
The current version is 2.2 (2012-10-27). Compared to 2.1 (2002-06-14), which was republished as RFC 3447, version 2.2 updates the list of allowed hashing algorithms to align them with FIPS 180-4, therefore adding SHA-224, SHA-512/224 and SHA-512/256.
The PKCS #1 standard defines the mathematical definitions and properties that RSA public and private keys must have. The traditional key pair is based on a modulus, , that is the product of two distinct large prime numbers, and , such that .
Starting with version 2.1, this definition was generalized to allow for multi-prime keys, where the number of distinct primes may be two or more. When dealing with multi-prime keys, the prime factors are all generally labeled as for some , such that:
As a notational convenience, and .
The RSA public key is represented as the tuple , where the integer is the public exponent.
The RSA private key may have two representations. The first compact form is the tuple , where is the private exponent. The second form has at least five terms (p, q, dp, dq, qinv), or more for multi-prime keys. Although mathematically redundant to the compact form, the additional terms allow for certain computational optimizations when using the key. In particular, the second format allows to derive the public key.
The standard defines several basic primitives. The primitive operations provide the fundamental instructions for turning the raw mathematical formulas into computable algorithms.
- I2OSP - Integer to Octet String Primitive - Converts a (potentially very large) non-negative integer into a sequence of bytes (octet string).
- OS2IP - Octet String to Integer Primitive - Interprets a sequence of bytes as a non-negative integer
- RSAEP - RSA Encryption Primitive - Encrypts a message using a public key
- RSADP - RSA Decryption Primitive - Decrypts ciphertext using a private key
- RSASP1 - RSA Signature Primitive 1 - Creates a signature over a message using a private key
- RSAVP1 - RSA Verification Primitive 1 - Verifies a signature is for a message using a public key
By themselves the primitive operations do not necessarily provide any security. The concept of a cryptographic scheme is to define higher level algorithms or uses of the primitives so they achieve certain security goals.
There are two schemes for encryption and decryption:
- RSAES-OAEP: improved Encryption/decryption Scheme; based on the Optimal Asymmetric Encryption Padding scheme proposed by Mihir Bellare and Phillip Rogaway.
- RSAES-PKCS1-v1_5: older encryption/decryption scheme as first standardized in version 1.5 of PKCS #1.
Note: A small change was made to RSAES-OAEP in PKCS #1 version 2.1, causing RSAES-OAEP in PKCS #1 version 2.0 to be totally incompatible with RSA-OAEP in PKCS #1 version 2.1 and version 2.2.
There are also two schemes for dealing with signatures:
- RSASSA-PSS: improved Probabilistic Signature Scheme with appendix; based on the probabilistic signature scheme originally invented by Bellare and Rogaway.
- RSASSA-PKCS1-v1_5: old Signature Scheme with Appendix as first standardized in version 1.5 of PKCS #1.
The two signature schemes make use of separately defined encoding methods:
- EMSA-PSS: encoding method for signature appendix, probabilistic signature scheme.
- EMSA-PKCS1-v1_5: encoding method for signature appendix as first standardized in version 1.5 of PKCS #1.
The signature schemes are actually signatures with appendix, which means that rather than signing some input data directly, a hash function is used first to produce an intermediary representation of the data, and then the result of the hash is signed. This technique is almost always used with RSA because the amount of data that can be directly signed is proportional to the size of the keys; which is almost always much smaller than the amount of data an application may wish to sign.
- Versions 1.1–1.3, February through March 1991, privately distributed.
- Version 1.4, June 1991, published for NIST/OSI Implementors' Workshop.
- Version 1.5, November 1993. First public publication. Republished as RFC 2313.
- Version 2.0, September 1998. Republished as RFC 2437.
- Version 2.1, June 2002. Republished as RFC 3447.
- Version 2.2, October 2012. Republished as RFC 8017.
Below is a list of cryptography libraries that provide support for PKCS#1:
In 1998, Daniel Bleichenbacher published a seminal paper on what became known as Bleichenbacher's attack (also known as "million message attack"). PKCS #1 was subsequently updated in the release 2.0 and patches were issued to users wishing to continue using the old version of the standard. With slight variations this vulnerability still exists in many modern servers.
In 2006, Bleichenbacher presented a new forgery attack against the signature scheme RSASSA-PKCS1-v1_5.
- Ilmari Karonen (27 October 2017). "Can I get a public key from an RSA private key?". Stack Exchange.
- Jean-Sébastien Coron, Marc Joye, David Naccache, and Pascal Paillier (2000). New Attacks on PKCS #1 v1.5 Encryption (PDF). Lecture Notes in Computer Science. 1807. EUROCRYPT. pp. 369–381. doi:10.1007/3-540-45539-6. ISBN 978-3-540-67517-4. S2CID 8447520.CS1 maint: multiple names: authors list (link)
- Romain Bardou, Riccardo Focardi, Yusuke Kawamoto, Lorenzo Simionato, Graham Steel, Joe-Kai Tsay (2012). "Efficient Padding Oracle Attacks on Cryptographic Hardware". Rr-7944. INRIA: 19.CS1 maint: uses authors parameter (link)
- RFC 3218 – Preventing the Million Message Attack on Cryptographic Message Syntax
- Hanno Böck; Juraj Somorovsky; Craig Young. "ROBOT attack: Return Of Bleichenbacher's Oracle Threat". Retrieved February 27, 2018.
- Tetsuya Izu, Masahiko Takenaka, Takeshi Shimoyama (April 2007). "Analysis on Bleichenbacher's Forgery Attack". The Second International Conference on Availability, Reliability and Security (ARES'07). IEEE. pp. 1167–1174. doi:10.1109/ARES.2007.38. ISBN 978-0-7695-2775-8. S2CID 2459509.CS1 maint: uses authors parameter (link)