Jump to content

Privacy-Enhanced Mail: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Unbuggy (talk | contribs)
Correct format of sample PEM block
m Turned paragraph into "Examples" subsection.
 
(17 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{short description|Family of file formats associated with RFC 1421}}
{{short description|Family of file formats associated with RFC 1421}}
{{Security protocol}}
{{Security protocol}}
'''Privacy-Enhanced Mail''' ('''PEM''') is a [[de facto]] file format for storing and sending cryptographic [[Key (cryptography)|keys]], [[Public key certificate|certificates]], and other data, based on a set of 1993 [[Internet Engineering Task Force|IETF]] standards defining "privacy-enhanced mail." While the original standards were never broadly adopted, and were supplanted by [[Pretty Good Privacy|PGP]] and [[S/MIME]], the textual encoding they defined became very popular. The PEM format was eventually formalized by the IETF in [[rfc:7468|RFC 7468]].
'''Privacy-Enhanced Mail''' ('''PEM''') is a [[de facto]] file format for storing and sending cryptographic [[Key (cryptography)|keys]], [[Public key certificate|certificates]], and other data, based on a set of 1993 [[Internet Engineering Task Force|IETF]] standards defining "privacy-enhanced mail." While the original standards were never broadly adopted and were supplanted by [[Pretty Good Privacy|PGP]] and [[S/MIME]], the textual encoding they defined became very popular. The PEM format was eventually formalized by the IETF in [[rfc:7468|RFC 7468]].<ref>{{cite journal |last=Johnson |first=Mike |date=1995-10-01 |title=Cryptology in Cyberspace |journal=Cryptologia |volume=19 |issue=4 |pages=392–396 |doi=10.1080/0161-119591884042 |issn=0161-1194 |s2cid=41770450}}</ref>


==Format==
==Format==
Many cryptography standards use [[Abstract Syntax Notation One|ASN.1]] to define their data structures, and [[X.690#DER encoding|Distinguished Encoding Rules]] (DER) to serialize those structures.<ref>{{Cite IETF|rfc=7468|section=1|title=Textual Encodings of PKIX, PKCS, and CMS Structures|last=Sean|first=Leonard|last2=Simon|first2=Josefsson|date=April 2015||language=en|access-date=2017-03-06}}</ref> Because DER produces [[Binary file|binary]] output, it can be challenging to transmit the resulting files through systems, like electronic mail, that only support ASCII.
Many cryptography standards use [[Abstract Syntax Notation One|ASN.1]] to define their data structures, and [[X.690#DER encoding|Distinguished Encoding Rules]] (DER) to serialize those structures.<ref>{{Cite IETF|rfc=7468|section=1|title=Textual Encodings of PKIX, PKCS, and CMS Structures|last=Sean|first=Leonard|last2=Simon|first2=Josefsson|date=April 2015||language=en|access-date=2017-03-06}}</ref> Because DER produces [[Binary file|binary]] output, it can be challenging to transmit the resulting files through systems, like electronic mail, that only support ASCII.


The PEM format solves this problem by encoding the binary data using [[Base64encoded|base64]]. PEM also defines a one-line header, consisting of "-----BEGIN ", a label, and "-----", and a one-line footer, consisting of "-----END ", a label, and "-----". The label determines the type of message encoded. Common labels include "CERTIFICATE", "CERTIFICATE REQUEST", "PRIVATE KEY" and "X509 CRL".
The PEM format solves this problem by encoding the binary data using [[Base64encoded|base64]]. PEM also defines a one-line header, consisting of {{code|-----BEGIN }}, a label, and {{code|-----}}, and a one-line footer, consisting of {{code|-----END }}, a label, and {{code|-----}}. The label determines the type of message encoded. Common labels include {{code|CERTIFICATE}}, {{code|CERTIFICATE REQUEST}}, {{code|PRIVATE KEY}} and {{code|X509 CRL}}.

PEM data is commonly stored in files with a ".pem" suffix, a ".cer" or ".crt" suffix (for certificates), or a ".key" suffix (for public or private keys).<ref>{{Cite web|url=https://web.archive.org/web/20190804070022/http://www.gtopia.org/blog/2010/02/der-vs-crt-vs-cer-vs-pem-certificates/|title=DER vs. CRT vs. CER vs. PEM Certificates and How To Convert Them|website=www.gtopia.org|access-date=2020-02-04}}</ref> The label inside a PEM file represents the type of the data more accurately than the file suffix, since many different types of data can be saved in a ".pem" file.

A PEM file may contain multiple instances. For instance, an operating system might provide a file containing a list of trusted [[CA certificate]]s, or a web server might be configured with a "chain" file containing an end-entity certificate plus a list of intermediate certificates.


<syntaxhighlight lang="pem">
<syntaxhighlight lang="pem">
----BEGIN PRIVATE KEY-----
-----BEGIN PRIVATE KEY-----

MIIJRAIBADANBgkqhkiG9w0BAQEFAAS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</syntaxhighlight>
</syntaxhighlight>

PEM data is commonly stored in files with a ".pem" suffix, a ".cer" or ".crt" suffix (for certificates), or a ".key" suffix (for public or private keys).<ref>{{Cite web|url=http://www.gtopia.org/blog/2010/02/der-vs-crt-vs-cer-vs-pem-certificates/|title=DER vs. CRT vs. CER vs. PEM Certificates and How To Convert Them|website=www.gtopia.org|archive-url=https://web.archive.org/web/20190804070022/http://www.gtopia.org/blog/2010/02/der-vs-crt-vs-cer-vs-pem-certificates/|access-date=2020-02-04|archive-date=2019-08-04}}</ref> The label inside a PEM file represents the type of the data more accurately than the file suffix, since many different types of data can be saved in a ".pem" file. In particular PEM refers to the header and base64 wrapper for a binary format contained within, but does not specify any type or format for the binary data, so that a PEM file may contain "almost anything base64 encoded and wrapped with BEGIN and END lines".<ref>{{Cite web|url=https://stackoverflow.com/questions/5355046/where-is-the-pem-file-format-specified|title=Where is the PEM file format specified?}}</ref>

===Examples===
* An operating system might provide a PEM file containing a list of trusted [[CA certificate]]s, each of which in its own BEGIN/END sections;
* A web server might be configured with a "chain" file containing an end-entity certificate plus a list of intermediate certificates, each of which in its own BEGIN/END sections.


== Privacy-enhanced mail ==
== Privacy-enhanced mail ==
Line 71: Line 24:


== History ==
== History ==
The initiative to develop Privacy Enhanced Mail began in 1985 on behalf of the PSRG (Privacy and Security Research Group) <ref>{{Cite journal|last=Kent|first=S.|date=1993|title=Internet Privacy Enhanced Mail|url=https://www.semanticscholar.org/paper/Internet-Privacy-Enhanced-Mail-Kent/06ff74906277b6ae330190419a55a2eeeaffab2f|journal=CACM|doi=10.1145/163381.163390}}</ref> also known as the Internet Research Task Force.
The initiative to develop Privacy Enhanced Mail began in 1985 on behalf of the PSRG (Privacy and Security Research Group)<ref>{{cite journal |last=Kent |first=S. |date=1993 |title=Internet Privacy Enhanced Mail |journal=Communications of the ACM |volume=36 |issue=8 |pages=48–60 |doi=10.1145/163381.163390 |doi-access=free |s2cid=15759913}}</ref> also known as the Internet Research Task Force. This task force is a subsidiary of the [[Internet Architecture Board]] (IAB) and their efforts have resulted in the Requests for Comment (RFCs) which are suggested Internet guidelines.<ref>{{Cite journal |last=Kent |first=Stephen T. |date=1993-08-01 |title=Internet Privacy Enhanced Mail |url=https://dl.acm.org/doi/10.1145/163381.163390 |journal=Communications of the ACM |volume=36 |issue=8 |pages=48–60 |doi=10.1145/163381.163390 |issn=0001-0782|doi-access=free }}</ref>


== References ==
== References ==
Line 77: Line 30:


[[Category:Cryptographic protocols]]
[[Category:Cryptographic protocols]]
[[Category:Computer file formats]]

Latest revision as of 12:55, 17 December 2023

Privacy-Enhanced Mail (PEM) is a de facto file format for storing and sending cryptographic keys, certificates, and other data, based on a set of 1993 IETF standards defining "privacy-enhanced mail." While the original standards were never broadly adopted and were supplanted by PGP and S/MIME, the textual encoding they defined became very popular. The PEM format was eventually formalized by the IETF in RFC 7468.[1]

Format

[edit]

Many cryptography standards use ASN.1 to define their data structures, and Distinguished Encoding Rules (DER) to serialize those structures.[2] Because DER produces binary output, it can be challenging to transmit the resulting files through systems, like electronic mail, that only support ASCII.

The PEM format solves this problem by encoding the binary data using base64. PEM also defines a one-line header, consisting of -----BEGIN, a label, and -----, and a one-line footer, consisting of -----END, a label, and -----. The label determines the type of message encoded. Common labels include CERTIFICATE, CERTIFICATE REQUEST, PRIVATE KEY and X509 CRL.

-----BEGIN PRIVATE KEY-----

-----END PRIVATE KEY-----

PEM data is commonly stored in files with a ".pem" suffix, a ".cer" or ".crt" suffix (for certificates), or a ".key" suffix (for public or private keys).[3] The label inside a PEM file represents the type of the data more accurately than the file suffix, since many different types of data can be saved in a ".pem" file. In particular PEM refers to the header and base64 wrapper for a binary format contained within, but does not specify any type or format for the binary data, so that a PEM file may contain "almost anything base64 encoded and wrapped with BEGIN and END lines".[4]

Examples

[edit]
  • An operating system might provide a PEM file containing a list of trusted CA certificates, each of which in its own BEGIN/END sections;
  • A web server might be configured with a "chain" file containing an end-entity certificate plus a list of intermediate certificates, each of which in its own BEGIN/END sections.

Privacy-enhanced mail

[edit]

The PEM format was first developed in the privacy-enhanced mail series of RFCs: RFC 1421, RFC 1422, RFC 1423, and RFC 1424. These standards assumed prior deployment of a hierarchical public key infrastructure (PKI) with a single root. Such a PKI was never deployed, due to operational cost and legal liability concerns.[citation needed] These standards were eventually obsoleted by PGP and S/MIME, competing e-mail encryption standards.[citation needed]

History

[edit]

The initiative to develop Privacy Enhanced Mail began in 1985 on behalf of the PSRG (Privacy and Security Research Group)[5] also known as the Internet Research Task Force. This task force is a subsidiary of the Internet Architecture Board (IAB) and their efforts have resulted in the Requests for Comment (RFCs) which are suggested Internet guidelines.[6]

References

[edit]
  1. ^ Johnson, Mike (1995-10-01). "Cryptology in Cyberspace". Cryptologia. 19 (4): 392–396. doi:10.1080/0161-119591884042. ISSN 0161-1194. S2CID 41770450.
  2. ^ Sean, Leonard; Simon, Josefsson (April 2015). Textual Encodings of PKIX, PKCS, and CMS Structures. sec. 1. doi:10.17487/RFC7468. RFC 7468. Retrieved 2017-03-06.
  3. ^ "DER vs. CRT vs. CER vs. PEM Certificates and How To Convert Them". www.gtopia.org. Archived from the original on 2019-08-04. Retrieved 2020-02-04.
  4. ^ "Where is the PEM file format specified?".
  5. ^ Kent, S. (1993). "Internet Privacy Enhanced Mail". Communications of the ACM. 36 (8): 48–60. doi:10.1145/163381.163390. S2CID 15759913.
  6. ^ Kent, Stephen T. (1993-08-01). "Internet Privacy Enhanced Mail". Communications of the ACM. 36 (8): 48–60. doi:10.1145/163381.163390. ISSN 0001-0782.