<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>jcgruenhage&#39;s Blog - pgp</title>
    <link rel="self" type="application/atom+xml" href="https://jcg.re/tags/pgp/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://jcg.re"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2023-06-04T00:00:00+00:00</updated>
    <id>https://jcg.re/tags/pgp/atom.xml</id>
    <entry xml:lang="en">
        <title>openpgp-key-janitor</title>
        <published>2023-06-04T00:00:00+00:00</published>
        <updated>2023-06-04T00:00:00+00:00</updated>
        
        <author>
          <name>Jan Christian Grünhage</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jcg.re/blog/openpgp-key-janitor/"/>
        <id>https://jcg.re/blog/openpgp-key-janitor/</id>
        
        <content type="html" xml:base="https://jcg.re/blog/openpgp-key-janitor/">&lt;p&gt;I&#39;ve been working on a tool for maintenance of PGP keys. The repository is over
at https://git.jcg.re/jcgruenhage/openpgp-key-janitor, and contains the current
work-in-progress code base.&lt;/p&gt;
&lt;h2 id=&quot;goals&quot;&gt;Goals&lt;/h2&gt;
&lt;p&gt;As described in &lt;a href=&quot;https://jcg.re/blog/replacing-my-pgp-key/&quot;&gt;a previous
blogpost&lt;/a&gt;, I&#39;m maintaining my key on
an airgapped device. This means that for doing stuff like ariadne.id OpenPGP
profiles, I need to create the proofs on an online machine, transfer stuff onto
the other device and then add the notations using gpg, transfer the key back,
upload it and then try to verify on keyoxide.org to see whether it all worked.
This process is complicated and error prone, not user friendly and quite
annoying.&lt;/p&gt;
&lt;p&gt;My goal with &lt;code&gt;openpgp-key-janitor&lt;/code&gt; is that I can prepare my changes fully on an
online machine and just need to run a simple command on the airgapped device.
For this, I&#39;ve created a &lt;code&gt;yaml&lt;/code&gt; representation of what I want the key to look
like, including expiry, subkeys, user IDs and notations. &lt;code&gt;openpgp-key-janitor&lt;/code&gt;
just looks at the spec file, the key, and checks what changes need to be made to
get the key to match to the spec file.&lt;/p&gt;
&lt;p&gt;As an example, a spec that matches my current key:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BABED8; background-color: #0F111A;&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFCB6B;&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;validity_period&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; 2y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;primary&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;  flags&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;certify&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;  cipher_suite&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; Cv25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;subs&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; flags&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;authenticate&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    cipher_suite&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; Cv25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; flags&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;sign&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    cipher_suite&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; Cv25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; flags&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;encrypt_for_transport&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; encrypt_at_rest&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    cipher_suite&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; Cv25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;user_ids&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;Jan Christian Grünhage &amp;lt;jan.christian@gruenhage.xyz&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    notation&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; matrix:u/@jan.christian:gruenhage.xyz?org.keyoxide.r=!dBfQZxCoGVmSTujfiv:matrix.org&amp;amp;org.keyoxide.e=$dE1DfTlKCtVtxk1P4wv5keXXGIgoHC57BK1Q2kQse_I&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; https://gist.github.com/jcgruenhage/188ca8c3fb50db507878af11f74c29b9&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; dns:jcg.re?type=TXT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; https://git.jcg.re/jcgruenhage/gitea_proof&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; dns:gruenhage.xyz?type=TXT&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; https://gitlab.com/jcgruenhage/gitlab_proof&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@metacode.biz&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; https://chaos.social/@jcgruenhage&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;Jan Christian Grünhage &amp;lt;jcgruenhage@famedly.com&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    notation&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;      -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; proof@ariadne.id&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; matrix:u/@jcgruenhage:famedly.de?org.keyoxide.r=!dBfQZxCoGVmSTujfiv:matrix.org&amp;amp;org.keyoxide.e=$2h_cjzzmycmcpLCkJmBj8yJqSNSSrKoLYV7mljsBMJg&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;Jan Christian Grünhage &amp;lt;jcgruenhage@entropia.de&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;Jan Christian Grünhage &amp;lt;me@jcg.re&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;Jan Christian Grünhage &amp;lt;j.gruenhage@famedly.com&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Changes I&#39;d like to make but haven&#39;t because I was too annoyed to do so far:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The proofs in my primary user ID are still using the old metacode.biz keys.
Changing that using GnuPG is terribly annoying though, so I won&#39;t do it for
now.&lt;/li&gt;
&lt;li&gt;My old (but still functional!) work email address is something that I wanted
to remove. It&#39;s an alias to my primary work email and I largely don&#39;t use it
anymore. Moving the notation would be nice, but I was okay with just dropping
the user ID for now. Which I thought I did. I just accidentally used &lt;code&gt;deluid&lt;/code&gt;
instead of &lt;code&gt;revsig&lt;/code&gt;, meaning that the UID is still very much alive. Reading
the manual would&#39;ve prevented this mistake, and once I was finished on my
airgapped machine and continued on my online machine I realised immediately
what the mistake was, but it&#39;s an easy enough mistake to make.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;current-state&quot;&gt;Current state&lt;/h2&gt;
&lt;p&gt;Right now, &lt;code&gt;openpgp-key-janitor&lt;/code&gt; can only do very little: It tries to read an
existing key, if that works, it writes it out again. If no key exists, it
generates a new one that matches the spec. Changes to existing keys aren&#39;t
implemented yet.&lt;/p&gt;
&lt;p&gt;Looking at the sample spec committed in the repo:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BABED8; background-color: #0F111A;&quot; &gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #FFCB6B;&quot;&gt;---&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;validity_period&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; 2y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;primary&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;  flags&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;certify&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; sign&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;  cipher_suite&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; Cv25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;subs&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; flags&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: [&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;encrypt_for_transport&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; encrypt_at_rest&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    cipher_suite&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; Cv25519&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;    validity_period&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt; 3y&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #F07178;&quot;&gt;user_ids&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;  -&lt;/span&gt;&lt;span style=&quot;color: #F07178;&quot;&gt; value&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;: &amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #C3E88D;&quot;&gt;Alice Lovelace &amp;lt;alice@openpgp.example&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #89DDFF;&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Running &lt;code&gt;openpgp-key-janitor&lt;/code&gt; generates a few things here:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BABED8; background-color: #0F111A;&quot; &gt;&lt;code data-lang=&quot;shellsession&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;openpgp-key-janitor on  main is 📦 v0.1.0 via 🦀 v1.69.0❯ ls -hl sampletotal 8.0K&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-rw-r-- 1 jcgruenhage jcgruenhage 252 Jun  4 11:08 spec.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;openpgp-key-janitor on  main is 📦 v0.1.0 via 🦀 v1.69.0❯ ./target/debug/openpgp-key-janitor sample&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;openpgp-key-janitor on  main is 📦 v0.1.0 via 🦀 v1.69.0❯ ls -hl sampletotal 20K&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-rw-r-- 1 jcgruenhage jcgruenhage 1.3K Jun  4 11:09 public.asc&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-rw-r-- 1 jcgruenhage jcgruenhage 1.5K Jun  4 11:09 rev.asc&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-rw-r-- 1 jcgruenhage jcgruenhage 1.4K Jun  4 11:09 secret.asc&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-rw-rw-r-- 1 jcgruenhage jcgruenhage  252 Jun  4 11:08 spec.yml&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;openpgp-key-janitor on  main is 📦 v0.1.0 via 🦀 v1.69.0❯ sq inspect sample/public.ascsample/public.asc: OpenPGP Certificate.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Fingerprint: 8DD748AEABF834CCB1DDF3FCE76C163C9D484531&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Public-key algo: EdDSA&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Public-key size: 256 bits&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  Creation time: 2023-06-04 09:08:04 UTC&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Expiration time: 2025-06-03 21:08:04 UTC (creation time + P730DT43200S)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Key flags: certification, signing&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;         Subkey: 6F0A6A3BAC9A40EB19E29257A773CA5C1D7059B0&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Public-key algo: ECDH&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Public-key size: 256 bits&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  Creation time: 2023-06-04 09:08:04 UTC&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Expiration time: 2026-06-04 03:08:04 UTC (creation time + P1095DT64800S)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Key flags: transport encryption, data-at-rest encryption&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;         UserID: Alice Lovelace &amp;lt;alice@openpgp.example&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, a key matching the description in the spec is being generated
successfully. The three files written out are &lt;code&gt;public.asc&lt;/code&gt;, containing the
certificate, &lt;code&gt;secret.asc&lt;/code&gt; contains everything in the certificate, plus the
private bits for the keys, and &lt;code&gt;rev.asc&lt;/code&gt; contains everything in the certificate,
plus a revocation signature for the primary key.&lt;/p&gt;
&lt;p&gt;When starting with &lt;code&gt;secret.asc&lt;/code&gt; already present, it tries to load all three
files and makes sure that the content matches. The three files are merged into a
working state, the primary key revocation is filtered out again and stored
separately. If no revocation signature is present yet, it&#39;ll be generated then.&lt;/p&gt;
&lt;h2 id=&quot;planned-features&quot;&gt;Planned features&lt;/h2&gt;
&lt;p&gt;I want to implement at a minumum:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Adjusting user IDs, which includes adding and removing them, as well as
creating new signatures that update annotations. The usecases here are adding
and removing user IDs when email addresses change, as well as updating
notations for ariadne.id OpenPGP profiles for keyoxide proofs.&lt;/li&gt;
&lt;li&gt;Extending the exiry of keys, so that extending keys (roughly every 2 years in
my case) becomes less of a hassle.&lt;/li&gt;
&lt;li&gt;Adding subkeys that are in the spec, but not in the key. The usecase here
would be for example that you already have a key containing an encryption
subkey for example, but not a signing subkey.&lt;/li&gt;
&lt;li&gt;Revoking subkeys that are not in the spec but are present in the key. Is
there a usecase for this? I&#39;m not entirely sure.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Additional features I&#39;ve thought about but that I don&#39;t have concrete plans for
yet:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Revoking subkeys that are present in both the key and the spec. If you were
handling your subkeys online and think they might have been compromised, or
lost a smartcard for which you forgot to change the admin pin or something
like that, you might want to replace your subkeys without fully revoking the
primary key. How exactly this should be represented in the spec isn&#39;t clear
to me though, which is why I don&#39;t have concrete plans for that yet.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;future&quot;&gt;Future&lt;/h2&gt;
&lt;p&gt;If you have opinions or suggestions on this, feel free to &lt;a href=&quot;https://jcg.re/contact/&quot;&gt;reach
out&lt;/a&gt; to me or to open an issue on the repository directly. I&#39;d be
happy to receive feedback and hear about people using this.&lt;/p&gt;
&lt;h2 id=&quot;thanks&quot;&gt;Thanks&lt;/h2&gt;
&lt;p&gt;This work wouldn&#39;t be possible without the awesome work by the people over at
&lt;a rel=&quot;external&quot; href=&quot;https://sequoia-pgp.org/&quot;&gt;Sequoia-PGP&lt;/a&gt;. The Rust libraries they provide for
handling anything OpenPGP related are amazing and made the implementation of
&lt;code&gt;openpgp-key-janitor&lt;/code&gt; so far fairly straight forward. My implementation of
&lt;code&gt;openpgp-key-janitor&lt;/code&gt; resulted in a a few contributions upstream and working
with them has been really nice.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>git diff on PGP keys</title>
        <published>2022-08-08T00:00:00+00:00</published>
        <updated>2022-08-08T00:00:00+00:00</updated>
        
        <author>
          <name>Jan Christian Grünhage</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jcg.re/blog/diffing-pgp-keys/"/>
        <id>https://jcg.re/blog/diffing-pgp-keys/</id>
        
        <content type="html" xml:base="https://jcg.re/blog/diffing-pgp-keys/">&lt;p&gt;Reasoning about changes to PGP keys is a bit difficult. A changed expiration
date, revoked user IDs, added certifications, and so, you don&#39;t see that when
looking at the file. When they&#39;re tracked in a git repo, asking &lt;code&gt;git diff&lt;/code&gt; is
going to be of little to no help. Either they are binary files, and you don&#39;t
see anything, or they are &lt;code&gt;pem&lt;/code&gt; encoded / ASCII armored files, then you might
see a bunch of changes that you can&#39;t read. But surely, git must have a solution
for this?&lt;/p&gt;
&lt;p&gt;The solution &lt;code&gt;git&lt;/code&gt; provides here is called a &quot;diff driver&quot;. You can match files
in your repo via
&lt;a rel=&quot;external&quot; href=&quot;https://www.git-scm.com/docs/gitattributes#_diff&quot;&gt;&lt;code&gt;.gitattributes&lt;/code&gt;&lt;/a&gt;, to set the
&lt;code&gt;diff&lt;/code&gt; attribute to the name of the driver you&#39;re going to use for generating a
diff. For this to work, you need to have a specific file extension that you&#39;re
using for PGP keys, so that you can match on that in your &lt;code&gt;.gitattributes&lt;/code&gt; file.
I&#39;m using &lt;code&gt;.pub&lt;/code&gt; for this, resulting in the following line in my
&lt;code&gt;.gitattributes&lt;/code&gt; file:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BABED8; background-color: #0F111A;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;*.pub diff=pgp&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next up is getting into diff drivers. We want a textual diff that gives us
information about what changed in the binary file, and luckily, git has a ready
made way to handle such cases generically.
&lt;a rel=&quot;external&quot; href=&quot;https://git-scm.com/docs/gitattributes#_performing_text_diffs_of_binary_files&quot;&gt;&lt;code&gt;diff.&amp;lt;driver&amp;gt;.textconv&lt;/code&gt;&lt;/a&gt;
allows us to set a command for generating a textual representation of the binary
blob we&#39;re examinating. Now let&#39;s add that to our git config:&lt;/p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #BABED8; background-color: #0F111A;&quot; &gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[diff &amp;quot;pgp&amp;quot;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	textconv = &amp;lt;command&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Well.. How do we show all of the data of a PGP key? There&#39;s two options here:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;GnuPG&lt;/strong&gt;, with &lt;code&gt;gpg --show-keys --with-fingerprint --with-subkey-fingerprints --with-sig-list&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sequoia PGP&lt;/strong&gt;, with &lt;code&gt;sq inspect --certifications&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I prefer the output of Sequoia over the output of GnuPG, even though the GnuPG
output is slightly more detailed than the Sequoia output, because it&#39;s a bit
easier to grasp and there&#39;s less noise around, but that&#39;s a highly subjective
matter, so if you want to try this, just play around with both and see what
works for you.&lt;/p&gt;
&lt;p&gt;Last but not least: Are we done here? Not really. The &lt;code&gt;.gitattributes&lt;/code&gt;
documentation has a whole section about choosing between textconv versus an
external diff tool, because those also exist. An external diff tool would get
both of the files and generate a diff output completely on it&#39;s own. This has
benefits, because it allows us to be a bit smarter about what info we might want
to display. If a key has a new signature on one UID, &lt;code&gt;textconv&lt;/code&gt; based diffing
does give us surrounding certifications, which is not really all that
interesting information. The drawbacks to an external diff tool are additional
complexity, and worse performance, because we need to run the diff tool for each
combination of old and new file. When using &lt;code&gt;textconv&lt;/code&gt;, you can cache those by
setting &lt;code&gt;cachetextconv&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;, which does help if you look at &lt;code&gt;git log -p&lt;/code&gt;
for example and the same file was edited multiple times.&lt;/p&gt;
</content>
        
    </entry>
    <entry xml:lang="en">
        <title>Replacing my PGP key</title>
        <published>2021-08-13T00:00:00+00:00</published>
        <updated>2021-08-13T00:00:00+00:00</updated>
        
        <author>
          <name>Jan Christian Grünhage</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jcg.re/blog/replacing-my-pgp-key/"/>
        <id>https://jcg.re/blog/replacing-my-pgp-key/</id>
        
        <content type="html" xml:base="https://jcg.re/blog/replacing-my-pgp-key/">&lt;p&gt;It&#39;s time &lt;em&gt;again&lt;/em&gt;, I&#39;m replacing my PGP key. Going from RSA 4096 to ed25519.&lt;/p&gt;
&lt;h2 id=&quot;how-did-i-get-here&quot;&gt;How did I get here?&lt;/h2&gt;
&lt;p&gt;I&#39;ve first started using PGP sometime half a decade ago, and after a few less
successful tries (some of which are still unrevoked, without an expiration
date), I&#39;ve generated my first &quot;proper&quot; PGP key 4 years ago. It was on an
airgapped device, the active subkeys were transferred to a yubikey and I was
using it actively for emails, pass, ssh access and I was quite happy with this
setup. So, where did things go wrong?&lt;/p&gt;
&lt;p&gt;The first messup was when I &quot;lost&quot; my yubikey. I ordered a backup key, replaced
the subkeys with new ones and then wanted to recover my password store by
decrypting them with the keys from my airgapped device. Turns out, the version
of GnuPG I was using &lt;em&gt;deleted&lt;/em&gt; the subkeys from the keyring when transferring
them to the YubiKey, so I didn&#39;t have a copy of them anymore. Luckily, I&#39;ve
found my old yubikey a few days later, I could decrypt my old data and move on
to newer keys.&lt;/p&gt;
&lt;p&gt;Next up, there&#39;s FOSDEM: I was attending the key signing party their in two
years, 2019 and 2020. Each time, I followed the procedure there, but didn&#39;t
complete the homework of actually signing the keys in either case: In the first
case, I left the list unattended at a stand, so obviously I can&#39;t sign keys from
a list where I don&#39;t know whether it&#39;s been tampered with. I feel somewhat bad
for this, because I wanted to participate productively in the web of trust here.
While that one was already embarrassing, the second time was worse: This time, I
kept the list safe. I stored it in a sealed envelope both on the way from and to
the conference, as well as during the conference. I haven&#39;t left it out of sight
at any point, to make sure the list was good. Once home again, I ran into other
trouble: My server, where I was hosting my email had trouble connecting to the
internet. To bring it back online, I moved it from my parents place to my flat,
where I moved in a few months prior. Now, I was on a dynamic IP, so I couldn&#39;t
send mails anymore, because they&#39;d end up in spam everywhere. This delayed it
for a few months, and after moving my mail server to a separate provider, I had
simply forgot. So, tl;dr: Two key signing parties, no signed keys, and plenty of
people who probably don&#39;t like that they made the effort and I messed up my
part.&lt;/p&gt;
&lt;p&gt;Last but not least: Back in November 2019, Yubico released an update to the
firmware to their 5-Series YubiKeys, shipping with support for ed25519 keys.
Not only do these keys have a higher security level per size, they also perform
significantly better. On a modern CPU, this doesn&#39;t really matter, but on
constrained platform such as a YubiKey, a crypto operation of RSA 4096 takes
close to a second, so the tenfold performance improvement really makes a
difference in every day usage. I could have gone for just replacing the subkeys,
but a mixed keypair kinda felt awkward, so in combination with the previous few
reasons, I decided to start with a clean slate.&lt;/p&gt;
&lt;h2 id=&quot;the-new-keys&quot;&gt;The new keys&lt;/h2&gt;
&lt;p&gt;This time, I&#39;ve done a few things differently:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I got a backup key immediately, to make sure I don&#39;t have any downtime if one
becomes unavailable&lt;/li&gt;
&lt;li&gt;I made sure to have encrypted offline backups of my keys on separate physical
media.&lt;/li&gt;
&lt;li&gt;I generated revocation certificates for the key, and I have backups of those
as well.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;What hasn&#39;t changed from before, is that I have a completely offline &lt;code&gt;Certify&lt;/code&gt;
key, with three subkeys, one each for &lt;code&gt;Sign&lt;/code&gt;, &lt;code&gt;Encrypt&lt;/code&gt; and &lt;code&gt;Sign&lt;/code&gt;. So, as of
now, I&#39;ve uploaded my new key to keys.openpgp.org and my own homepage, and will
make sure to update WKD entries as well. If you want to try it out, send me a
message!&lt;/p&gt;
&lt;h2 id=&quot;keybase-keyoxide&quot;&gt;&lt;del&gt;Keybase&lt;/del&gt; Keyoxide&lt;/h2&gt;
&lt;p&gt;If you&#39;ve seen my &lt;a rel=&quot;external&quot; href=&quot;http://keybase.io/jcgruenhage&quot;&gt;keybase profile&lt;/a&gt; before and
check back now, you&#39;ll hopefully see a lot less than before. I&#39;ve reset my account (which is still in progress as of now), so all the verifications and account links from there will be gone. This has a multitude of reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;keybase is proprietary (at least partially)&lt;/li&gt;
&lt;li&gt;keybase is centralized&lt;/li&gt;
&lt;li&gt;keybase got bought by Zoom&lt;/li&gt;
&lt;li&gt;keybase is pushing back PGP in favor of their own keys&lt;/li&gt;
&lt;li&gt;keybase is extending their features too much&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I could probably write a whole blog post about that in itself, but summarized,
keybase isn&#39;t doing what I want anymore, which is &lt;em&gt;just&lt;/em&gt; linking online
identities to PGP keys.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;keyoxide enters chat&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Thankfully, I&#39;m not the only one who felt this way, and someone built an
alternative that ticks all the boxes: It&#39;s a decentralized, FOSS (copyleft!!)
solution, which does &lt;em&gt;nothing&lt;/em&gt; aside of linking PGP keys to online identities.
It already supports more platforms than keybase ever did, although it&#39;s even
more skewed towards nerdy places than keybase was. It&#39;s a bit less polished, the
UX is very rough around the edges, but it get&#39;s the job done. You can see my
profile
&lt;a rel=&quot;external&quot; href=&quot;https://keyoxide.org/hkp/09E8418B46B53B0F825DE4BE018ACF465280F466&quot;&gt;here&lt;/a&gt;, and
you know what? There is no additional server component I have to run, there is
no accounts, nothing. It fetches the avatar from libravatar, the proofs are
embedded into the key itself via notations, and the verification (wherever this
is possible) is done client-side. I&#39;m happy with the outcome here, and am
looking forward to seeing keyoxide evolve.&lt;/p&gt;
</content>
        
    </entry>
</feed>
