Photo by Alex Motoc on Unsplash

In Cybersecurity, What Are OIDs, PEMs, DERs and ASN.1?

--

One of the most fundamental things for the protection of data is the usage of encryption keys. But, what do they look like, and how can we generate them? In this case, we will generate and view encryption keys within the browser and use JavaScript.

We need ways to distribute our public keys, private keys and digital certificates in a portable format. One of the most common forms is Distinguished Encoding Rules (DER) encoding of ASN.1 (Abstract Syntax Notation One). Overall, these encode the binary data into a format which can be ported from one system to another.

The other common format is PEM, and which converts the binary encoding into a text readable format. This is commonly used to send keys over email or text-based communication channels. With PEM we can encode cryptographic information in a Base64 ASCII format and use plain-text headers of:

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

and a footer of:

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

With DER we represent the binary data for the keys as a hex string.

This article will look at the DER format and has code to decode a hex string and into its contents. Overall ASN.1 is used to define abstract types and values. One of the most basic types is SEQUENCE and is an ordered…

--

--

Prof Bill Buchanan OBE FRSE
ASecuritySite: When Bob Met Alice

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.