{
  "version": 1,
  "canonical": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys",
  "title": "Using RSA to Exchange Cryptographic Keys",
  "description": "A historical protocol sketch for using RSA to exchange a shared private key. The original 2009 discussion is preserved as period engineering writing.",
  "language": "en",
  "manifest": "https://xaede.net/representations/index.json",
  "contentHtml": "<article class=\"reading-page\"><header class=\"reading-header\"><nav class=\"page-breadcrumb\" aria-label=\"Breadcrumb\"><ol><li><a href=\"/\">Home</a></li><li><a href=\"/writing\">Writing</a></li><li><span aria-current=\"page\">Using RSA to Exchange Cryptographic Keys</span></li></ol></nav><div class=\"article-label\"><span>Archive edition / Legacy Xaede</span><time datetime=\"2009-08-21\">August 21, 2009</time><span>3 MIN READ</span></div><h1>Using RSA to Exchange Cryptographic Keys</h1><p class=\"byline\"><a href=\"/about\" rel=\"author\">Josh English</a></p><p class=\"edition-note\">From the original Xaede archive. This is historical writing, preserved in a new reading edition. Technical advice, tools and project status reflect the time of publication.</p></header><div class=\"reading-body prose\"><p>The following is a methodology for programmers to provide a simplified implementation for using the RSA algorithm to exchange a shared private key from another cryptosystem such as AES or Blowfish for further secure communications. This methodology will be described following the typical practice in cryptography as an imaginary conversation between two fictional characters that have names taken from successive letters of the alphabet. For the the following discussion, Alfred represents an entity wishing to instantiate secure communications, and Beatrice is representative of the recipient.</p>\n\n<p>To begin, Alfred has already obtained in a secure fashion a copy of Beatrice’s public RSA key, e.g. she handed him a disk with the key, or he verified it with a hashing algorithm, or he used a trusted 3rd-party mechanism, etc. Alfred begins his conversation with Beatrice by generating his own RSA key with an arbitrary number of bits (though hopefully as least as large as Beatrice’s). Additionally, Alfred should pick a key length that is of sufficient length as to be thought computationally impossible to guess it in a reasonable time frame, say a couple of centuries at least.</p>\n<p>At this point, Alfred has a copy of Beatrice’s public RSA key, and Alfred has generated his own RSA key. Alfred then transmits his public key to Beatrice, which has been first encrypted with Beatrice’s public key, and then cryptographically signed with Alfred’s private key. This way, only Beatrice may be able to decrypt Alfred’s public key, and with Alfred’s private key signature, Beatrice can validate that she is indeed speaking to Alfred.</p>\n<p>Upon receipt of Alfred’s message, Beatrice will then decrypt Alfred’s public key using her private key. She then will generate a new key that will be used as a private shared key for further communications. She takes her new key, and encrypts it with Alfred’s public RSA key. Beatrice then signs the result with her private key, and transmits the resulting message to Alfred. At this point, Beatrice has a cryptographically-signed message from Alfred, along with his public key, and the new shared private key generated by Beatrice.</p>\n<p>Upon receipt of Beatrice’s response, Alfred uses his private key to decrypt the private shared key he received from Beatrice. He can further use Beatrice’s public key to validate her private-key signature of the message she sent. At this point, both Alfred and Beatrice have established each other’s cryptographic but not real identity, and have exchanged a key that they can use to safely encrypt any further messages they wish to exchange.</p>\n<p>If Alfred and Beatrice want to eliminate any real possibility of cryptanalytic attack against their further communications, they may use the private shared key only to exchange a single message, and will generate a new shared key every time they wish to send each other a message.</p>\n\n<p>So, how to we easily translate this into programmer-land? Here is a simple example: if you think of Alfred as a computer game client, and Beatrice as a computer game server, you now have a methodology that will allow you to prevent 3rd-parties from listening in on any sensitive communications, e.g. paying a monthly subscription fee, transmission of critical or advertisement material, purchasing merchandise from inside a game, etc.</p></div><footer class=\"article-footer\"><span class=\"eyebrow\">PUBLICATION RECORD</span><p>Recovered article · Legacy Xaede · August 21, 2009</p><p>Originally published on Xaede. The recovered text is included in this reading edition.</p><p class=\"small\">Original authorship and publication date are preserved. This edition restores the reading layout. Recovered historical images are hosted here; unavailable images are identified where relevant.</p></footer></article>",
  "structuredData": {
    "@context": "https://schema.org",
    "@graph": [
      {
        "@type": "Person",
        "@id": "https://xaede.net/#josh-english",
        "name": "Josh English",
        "url": "https://xaede.net/about",
        "sameAs": [
          "https://github.com/josh-english-2k18",
          "https://medium.com/@jengas",
          "https://www.linkedin.com/in/joshua-s-english",
          "https://x.com/JoshSeriesAI"
        ],
        "jobTitle": "VP of Engineering",
        "description": "Josh English is VP of Engineering at Chronicle Media and was previously CTO of Series Entertainment. His career spans more than twenty-five years of distributed systems, game technology and engineering leadership. At Google he worked as a lead engineer on large-scale services and applied ML; at Big Run Studios he led multidisciplinary technology teams across seven time zones and four countries. At Series he directed engineering, QA, DevOps and infrastructure supporting live commercial games and AI-enabled production. He also builds personal games and developer tools to investigate how emerging capabilities work in practice, and writes about engineering judgment, organisation design and product economics.",
        "mainEntityOfPage": {
          "@id": "https://xaede.net/about#webpage"
        }
      },
      {
        "@type": "WebSite",
        "@id": "https://xaede.net/#website",
        "url": "https://xaede.net/",
        "name": "Xaede",
        "alternateName": [
          "Xaede.net",
          "Josh English — Xaede"
        ],
        "inLanguage": "en",
        "publisher": {
          "@id": "https://xaede.net/#josh-english"
        }
      },
      {
        "@type": "WebPage",
        "@id": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys#webpage",
        "url": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys",
        "name": "Using RSA to Exchange Cryptographic Keys",
        "description": "A historical protocol sketch for using RSA to exchange a shared private key. The original 2009 discussion is preserved as period engineering writing.",
        "inLanguage": "en",
        "isPartOf": {
          "@id": "https://xaede.net/#website"
        },
        "about": {
          "@id": "https://xaede.net/#josh-english"
        },
        "mainEntity": {
          "@id": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys#article"
        },
        "breadcrumb": {
          "@id": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys#breadcrumbs"
        }
      },
      {
        "@type": "Article",
        "@id": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys#article",
        "name": "Using RSA to Exchange Cryptographic Keys",
        "headline": "Using RSA to Exchange Cryptographic Keys",
        "description": "A historical protocol sketch for using RSA to exchange a shared private key. The original 2009 discussion is preserved as period engineering writing.",
        "author": {
          "@id": "https://xaede.net/#josh-english"
        },
        "inLanguage": "en",
        "mainEntityOfPage": {
          "@id": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys#webpage"
        },
        "genre": "Archive edition",
        "datePublished": "2009-08-21",
        "wordCount": 535,
        "url": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys"
      },
      {
        "@type": "BreadcrumbList",
        "@id": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys#breadcrumbs",
        "itemListElement": [
          {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://xaede.net/"
          },
          {
            "@type": "ListItem",
            "position": 2,
            "name": "Writing",
            "item": "https://xaede.net/writing"
          },
          {
            "@type": "ListItem",
            "position": 3,
            "name": "Using RSA to Exchange Cryptographic Keys",
            "item": "https://xaede.net/writing/using-rsa-to-exchange-cryptographic-keys"
          }
        ]
      }
    ]
  }
}
