Sitemap
Press enter or click to view image in full size

Member-only story

JSON and Encryption Keys — A Marriage Made In Heaven

5 min readJun 27, 2025

--

How many encryption and signing key formats are there? The answer to this — is a great deal. Why? Well, these days we can wrap an encryption key with a JSON format, and which provides additional information on how the encryption key can be used.

For a computer, these keys are just a bunch of 1’s and 0’s, but for humans, we are not so good at interpreting binary. Two common formats are DER (binary) and PEM (Base64). When interpreted as hexadecimal, DER looks something like this [here]:

The PEM format is a little more structured with a special header and footer, and with Base64 text in between:

Press enter or click to view image in full size

None of these file formats gives much away about the details of the key, such as its identifier, the type of encryption used, and so on. And so the JSON format is often used to view a key, and Google Tink is a great place to view the key. With this, we can define a symmetric key, and where we give the key and ID, and then define the key type (as we can use a range of encryption methods). In the following, we use an AES GCM key: [link]

{
"primaryKeyId": 1331912396,
"key": [{
"keyData": {…

--

--

Prof Bill Buchanan OBE FRSE
Prof Bill Buchanan OBE FRSE

Written by Prof Bill Buchanan OBE FRSE

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