Cryptography

From HerzbubeWiki
Jump to: navigation, search

Overview

This page contains assorted cryptography-related information that does not really fit into any of the other cryptography-related pages that deal with more specific matters.


Glossary

PKI 
Public key infrastructure
SSO 
Single sign-on
CA 
Certificate authorities
CRL 
Certificate revocation list
OCSP 
Online Certificate Status Protocol. A way of checking an X.509 certificate's validity. Firefox 3 enables OCSP checking by default.
ITU 
International Telecommunication Union. An international organization established to standardize and regulate international radio and telecommunications. It is one of the specialized agencies of the United Nations. It is made up of 3 sectors: ITU-T (telecommunication standardization), ITU-R (radiocommunication) and ITU-D (telecommunication development).
ASN.1 
Abstract Syntax Notation One. A standard and flexible notation that describes data structures for representing, encoding, transmitting, and decoding data. ASN.1 is made up of several sub-standard (e.g. X.690 for defining BER, CER and DER). ASN.1 is used in telecommunications and computer networking. ASN.1 is a joint ISO/IEC and ITU-T standard.
DER (also BER and CER) 
Distinguished Encoding Rules (also Basic Encoding Rules and Canonical Encoding Rules). Are all defined in X.690, which is part of the ASN.1 standard. DER is a subset of BER and defines how to uniquely and unambiguously encode a data structure in a binary format. DER has been defined for the needs of X.509, because BER is not suitable for X.509. See further down for details.
PEM 
Privacy Enhanced Mail. A proposed but never deployed/used IETF standard. The PEM format is defined in RFC 1421. See further down for details.
RSA 
Algorithm for public-key cryptography. Stands for Rivest, Shamir, and Adleman, the co-inventors of the algorithm. The first algorithm known to be suitable for signing as well as encryption
RSA Security 
The security division of EMC Corporation. Originally founded in 1977 under the name of "RSA Data Security Inc" by the inventors of the RSA algorithm, but subsequently acquired by EMC.
PKCS 
Public Key Cryptography Standards. A group of standards devised and published by RSA Security with the aim of promoting and facilitating the use of public-key techniques, which is a business interest of the company. PKCS were not real industry standards because RSA Security retained control over them, but this seems to have changed somewhat lately. See Wikipedia article.
PKCS#7 
One of the PKCS standards. Defines how to sign and/or encrypt (officially called "envelope") data under a PKI. A PKCS#7 data structure contains the signed data, optionally accompanied by the certificate used for the signature. It is unclear what type of certificates may be used (certainly X.509, but also others?).
.p7c 
Filename extension. A .p7c file is a degenerated PKCS#7 SignedData structure, without the actual data, just certificate(s) or CRL(s). The filename extension .p7b seems to refer to the same file type, although this is not entirely clear.
PKCS#12 
One of the PKCS standards. Defines a file format commonly used to store private keys with accompanying public key certificates, protected with a password-based symmetric key. This is a container format that can contain multiple embedded objects, e.g. multiple certificates. PKCS#12 is the successor to the PFX (Personal Information Exchange) protocol from Microsoft. It is unclear what types of certificates or keys may be used (certainly X.509 certificates, but also others?). See the OpenSSL PKCS#12 FAQ.
.p12 
Filename extension. A .p12 file may contain certificate(s) (public) and private keys (password protected), stored in the format defined by PKCS#12.


X.509

For details refer to the Wikipedia article.

Almost verbatim from Wikipedia:

X.509 is a standard for a public key infrastructure (PKI) for single sign-on (SSO) and Privilege Management Infrastructure (PMI). X.509 specifies, amongst other things, standard formats for public key certificates, certificate revocation lists, attribute certificates, and a certification path validation algorithm.

Usually X.509 assumes a strict hierarchical system of CAs for issuing certificates. This contrasts with web of trust models such as PGP. Version 3 of X.509 includes the flexibility to support other topologies like bridges and meshes (RFC 4158). It can be used in a peer-to-peer, OpenPGP-like web of trust, but was rarely used that way as of 2004.

Again from Wikipedia:

[...] The term "X.509 certificate" usually refers to the IETF's PKIX Certificate and CRL Profile of the X.509 v3 certificate standard, as specified in RFC 5280, commonly referred to as PKIX for Public Key Infrastructure (X.509).


Formats for certificates and public/private keys

DER

The DER format is defined in X.690 (X.690 official link requiring payment, 2002 version of the standard), which is part of the ASN.1 standard. Refer to the Wikipedia article for some details.

DER is a binary format and has been defined to satisfy the needs of X.509.

A common filename extension is .der


PEM

The PEM format is defined by RFC 1421. Also refer to the Wikipedia articles about PEM and Base64.

PEM uses a Base64 encoding, representing the 64 digits in the base64 numbering system with the ASCII characters A-Z, a-z, 0-9, "+", and "/", in that order. The resulting data is broken into lines containing exactly 64 digits (or ASCII characters) each. Line delimiters can be platform specific. The "equal sign" character ("=") can be used for padding the last line or to flag the end of the data. The lines of data are preceded and followed by an "encapsulation boundary" line, which varies depending on the context, but always begins and ends with hyphens, and the text enclosed by the hyphens begins with either "BEGIN" or "END".

Note: The MIME specification (RFC 2045) uses the same 64-character alphabet and encoding mechanism as PEM. It also uses the "=" for padding in the same way. It differs slightly in that it does not prescribe a fixed line length (it defines a maximum line length, though).

The PEM format can be used to represent X.509 certificates (in DER format), certificate requests, PKCS#7 objects, RSA keys, etc. It appears (but is not entirely clear) that PEM can be used to represent any type of (binary) data.

A common filename extension is .pem. A file in the PEM format may contain one or more PEM-encoded "objects", each enclosed between its own BEGIN/END delimiter lines. For instance, a certificate chain can be included. The order in which objects appear is significant.


Radix-64 (ASCII Armor)

A format described by the OpenPGP standard in RFC 4880. This format is identical to the encoding described by the MIME specification, with the exception of an optional 24-bit CRC checksum that is calculated over the unencoded data and then encoded and added to the rest of the encoded data separated by a "=" character.

Since MIME is almost identical to PEM, Radix-64/ASCII Armor is, by extension, also almost identical to PEM.

GnuPG can import/export ASCII armored keys. GnuPG also has the ability to convert any binary data into ASCII armored format, and back. See the PGP page for details.


PKCS#7

TODO


PKCS#12

TODO