<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>jcgruenhage&#39;s Blog - matrix</title>
    <link rel="self" type="application/atom+xml" href="https://jcg.re/tags/matrix/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://jcg.re"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2020-05-25T00:00:00+00:00</updated>
    <id>https://jcg.re/tags/matrix/atom.xml</id>
    <entry xml:lang="en">
        <title>Matrix X-Signing</title>
        <published>2020-05-25T00:00:00+00:00</published>
        <updated>2020-05-25T00:00:00+00:00</updated>
        
        <author>
          <name>Jan Christian Grünhage</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://jcg.re/blog/quick-overview-matrix-cross-signing/"/>
        <id>https://jcg.re/blog/quick-overview-matrix-cross-signing/</id>
        
        <content type="html" xml:base="https://jcg.re/blog/quick-overview-matrix-cross-signing/">&lt;p&gt;With the recent release of riot-web 1.6.0, matrix&#39;s new cross signing was
released to the public. While it makes usage a lot easier, those users who want
to understand what&#39;s happening underneath will likely feel overwhelmed by all
the new keys that this introduces.&lt;/p&gt;
&lt;h2 id=&quot;scope&quot;&gt;Scope&lt;/h2&gt;
&lt;p&gt;This blog post will skip over how olm and megolm work, this is meant as just a
quick explainer of why devices can trust other devices through the usage of
cross signing keys.&lt;/p&gt;
&lt;h2 id=&quot;previous-situation&quot;&gt;Previous situation&lt;/h2&gt;
&lt;p&gt;So far, every user had a key pair &lt;em&gt;per device&lt;/em&gt;. Trusting the other devices in a
room meant having to verify each of these device key pairs from each of your own
devices. Not really feasible, since the amount of verifications there grows very
quickly, when chats get bigger. Additionally, each time someone signs in on a
new device, everyone who had previously verified them needs to verify that new
device.&lt;/p&gt;
&lt;h2 id=&quot;new-situation-with-cross-signing&quot;&gt;New situation with cross signing&lt;/h2&gt;
&lt;p&gt;Now, each user get&#39;s three additional key pairs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;MSK&lt;/strong&gt;: The master signing key. This key is used as the root of trust for
the given user and signs the other two keys.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SSK&lt;/strong&gt;: The self signing key. This key is used by a user to sign their own
devices, usually after logging in on a new device.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;USK&lt;/strong&gt;: The user signing key. This key is used to sign the master key of
other users.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&#39;ve built a little diagram below to show which keys are signed by which keys,
hoping that will make stuff a bit clearer.&lt;/p&gt;
&lt;img src=&quot;/images/blog/2020/05/25/matrix-key-diagram.svg&quot; alt=&quot;Key Diagram&quot; width=750 /&gt;
&lt;p&gt;Now, this diagram is about the situation when cross signing is already enabled,
and Alice and Bob have already verified all their devices and each other. When
Alice now wants to send a message from her computer in the (E2EE) DM with Bob,
her computer will check what devices are in the room. It&#39;ll see itself and three
other devices. Alice&#39;s &quot;Phone&quot;, and Bob&#39;s &quot;Phone&quot; and &quot;Computer&quot;. It can trust
the phone, because the computer trusts the MSK, which trusts the SSK, which
trusts the phone. For Bob&#39;s devices, she has a similar trust chain, from her
computer, to her MSK, to her USK, to Bob&#39;s MSK, to Bob&#39;s SSK, and finally, to
Bob&#39;s devices. Therefore, she can trust the devices in the channel, and will
send the encryption key of those messages to those devices. Encrypting the
message is done using megolm, and olm is then used to share the encryption keys
for that message with the other devices in the room, but the details of that are
too much for this post.&lt;/p&gt;
</content>
        
    </entry>
</feed>
