In
cryptography
Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or ''-logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adve ...
, PKCS #1 is the first of a family of standards called
Public-Key Cryptography Standards (PKCS), published by
RSA Laboratories
RSA Security LLC, formerly RSA Security, Inc. and doing business as RSA, is an American computer security, computer and network security company with a focus on encryption and encryption standards. RSA was named after the initials of its co-fo ...
. It provides the basic definitions of and recommendations for implementing the
RSA
RSA may refer to:
Organizations Academia and education
* Rabbinical Seminary of America, a yeshiva in New York City
*Regional Science Association International (formerly the Regional Science Association), a US-based learned society
*Renaissance S ...
algorithm for
public-key cryptography
Public-key cryptography, or asymmetric cryptography, is the field of cryptographic systems that use pairs of related keys. Each key pair consists of a public key and a corresponding private key. Key pairs are generated with cryptographic a ...
. 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.
Keys
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 number
A prime number (or a prime) is a natural number greater than 1 that is not a product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime because the only way ...
s, 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:
:
for
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 , 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.
Primitives
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
Schemes
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
Mihir Bellare is a cryptographer and professor at the University of California San Diego. He has published several seminal papers in the field of cryptography (notably in the area of provable security), many of which were co-written with Phillip R ...
and
Phillip Rogaway
Phillip Rogaway is a professor of computer science at the University of California, Davis. He graduated from Beverly Hills High School, and later earned a BA in computer science from UC Berkeley and completed his PhD in cryptography at MIT, in ...
.
* 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
External links
Raising the standard for RSA signatures: RSA-PSSRFC 4056: Use of the RSASSA-PSS Signature Algorithm in Cryptographic Message Syntax (CMS)RFC 5756: Updates for RSAES-OAEP and RSASSA-PSS Algorithm ParametersRFC 8017: PKCS #1: RSA C ...
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
A hash function is any function that can be used to map data of arbitrary size to fixed-size values. The values returned by a hash function are called ''hash values'', ''hash codes'', ''digests'', or simply ''hashes''. The values are usually ...
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.
Version history
* 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 .
* Version 2.0, September 1998. Republished as . Introduced the RSAEP-OAEP encryption scheme.
* Version 2.1, June 2002. Republished as . Introduced multi-prime RSA and the RSASSA-PSS signature scheme
* Version 2.2, October 2012. Republished as .
Implementations
Below is a list of cryptography libraries that provide support for PKCS#1:
*
Botan
*
Bouncy Castle
Bounce or The Bounce may refer to:
* Deflection (physics), the event where an object collides with and bounces against a plane surface
Books
* Mr. Bounce, a character from the Mr. Men series of children's books
Broadcasting, film and TV
* ' ...
*
BSAFE
Dell BSAFE, formerly known as RSA BSAFE, is a FIPS 140-2 validated cryptography library, available in both C and Java. BSAFE was initially created by RSA Security, which was purchased by EMC and then, in turn, by Dell. When Dell sold the RSA ...
*
cryptlib
cryptlib is an open-source cross-platform software security toolkit library. It is distributed under the Sleepycat License, a free software license compatible with the GNU General Public License. Alternatively, cryptlib is available under a pro ...
*
Crypto++
Crypto++ (also known as CryptoPP, libcrypto++, and libcryptopp) is a free and open-source C++ class library of cryptographic algorithms and schemes written by Wei Dai. Crypto++ has been widely used in academia, student projects, open-source, and ...
*
Libgcrypt
Libgcrypt is a cryptography library developed as a separated module of GnuPG.
It can also be used independently of GnuPG, but depends on its error-reporting library Libgpg-error.
It provides functions for all fundamental cryptographic building bl ...
*
mbed TLS
Mbed TLS (previously PolarSSL) is an implementation of the Transport Layer Security, TLS and SSL protocols and the respective cryptographic algorithms and support code required. It is distributed under the Apache License version 2.0. Stated on t ...
*
Nettle
{{redirect, Nettle
Nettle refers to plants with stinging hairs, particularly those of the genus ''Urtica''. It can also refer to plants which resemble ''Urtica'' species in appearance but do not have stinging hairs. Plants called "nettle" include ...
*
OpenSSL
OpenSSL is a software library for applications that provide secure communications over computer networks against eavesdropping or need to identify the party at the other end. It is widely used by Internet servers, including the majority of HT ...
*
wolfCrypt
wolfSSL is a small, portable, embedded SSL/TLS library targeted for use by embedded systems developers. It is an open source implementation of TLS (SSL 3.0, TLS 1.0, 1.1, 1.2, 1.3, and DTLS 1.0, 1.2, and 1.3) written in the C programming langu ...
Attacks
Multiple attacks were discovered against PKCS #1 v1.5.
In 1998,
Daniel Bleichenbacher
Daniel Bleichenbacher (born 1964) is a Swiss cryptographer, previously a researcher at Bell Labs, and currently employed at Google. He received his Ph.D. from ETH Zurich in 1996 for contributions to computational number theory, particularly concern ...
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.
See also
*
Comparison of cryptography libraries
The tables below compare cryptography libraries that deal with cryptography algorithms and have API function calls to each of the supported features.
Cryptography libraries
FIPS 140
This table denotes, if a cryptography library provides t ...
References
External links
* - PKCS #1: RSA Cryptography Specifications Version 2.2
*
*
{{Cryptography navbox
Cryptography standards
Digital signature schemes
Digital Signature Standard