Services/KeyExchange: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
= Overview =
= Overview =


Explore using J-PAKE to securely pass credentials to another device.
Explore using J-PAKE to securely pass credentials to another device.  


Tracking bug is {{bug|601644}}.
Tracking bug is {{bug|601644}}.  


= Engineers Involved =
= Engineers Involved =


* Tarek (server)
*Tarek (server)  
* Philipp (FxSync)
*Philipp (FxSync)  
* Stefan (FxHome)
*Stefan (FxHome)


= User Requirements =
= User Requirements =


* Setting up a new mobile device should only involve entering a short code on the desktop device
*Setting up a new mobile device should only involve entering a short code on the desktop device  
* Secondary request, not a hard requirement, is that if the user has a mobile device, and is setting up a desktop device, that the flow is similar and still involves entering the key on the desktop
*Secondary request, not a hard requirement, is that if the user has a mobile device, and is setting up a desktop device, that the flow is similar and still involves entering the key on the desktop


= Desired User Flow =
= Desired User Flow =


# User chooses "quick setup" on new device
#User chooses "quick setup" on new device  
# Device displays a setup key that contains both the initial secret and a channel ID
#Device displays a setup key that contains both the initial secret and a channel ID  
# On a device that is authenticated, user chooses "add another device" and is prompted for that key
#On a device that is authenticated, user chooses "add another device" and is prompted for that key  
# The two devices exchange messages to build the secure tunnel
#The two devices exchange messages to build the secure tunnel  
# The already-authenticated device passes all credentials (username/password/passphrase) to the new device
#The already-authenticated device passes all credentials (username/password/passphrase) to the new device  
# New device completes setup and starts syncing
#New device completes setup and starts syncing
 
= Implementation (draft)  =
 
== Terminology  ==
 
*Desktop: Client that has Fx Sync already set up
*Mobile: Client that needs to be set up (of course this could be another desktop computer, too)
*PIN: code that is displayed on Mobile and entered on Desktop
*Secret: weak secret that is used to start the J-PAKE algorithm
*Key: strong secret that both clients derive through J-PAKE
 
== Flow  ==
 
<ol>
<li>Mobile asks server for new channel ID (3 characters a-z0-9)
<pre>GET /new_channel  -->  "a7i"</pre></li>
<li>Mobile generates PIN from channel ID + random weak secret (3 characters a-z0-9), computes and uploads J-PAKE msg 1
<pre>PUT /channel_id</pre></li>
<li>Desktop asks user for the PIN, extracts channel ID and weak secret, fetches Mobile's msg 1
<pre>GET /channel_id</pre></li>
<li>Desktop computes and uploads msg 1
<pre>PUT /channel_id</pre></li>
<li>Mobile retrieves Desktop's msg 1
<pre>GET /channel_id</pre>
<p>computes and uploads msg 2</p>
<pre>PUT /channel_id</pre></li>
<li>Desktop retrieves Mobile's msg 2
<pre>GET /channel_id</pre>
<p>computes msg 2 and key, encrypts Sync credentials and uploads msg 2 and encrypted credentials</p>
<pre>PUT /channel_id</pre></li>
<li>Mobile retrieve's Desktop's msg 2 and encrypted credentials
<pre>GET /channel_id</pre>
<p>computes key and decrypts Sync credentials.</p></li>

Revision as of 21:31, 4 October 2010

Overview

Explore using J-PAKE to securely pass credentials to another device.

Tracking bug is bug 601644.

Engineers Involved

  • Tarek (server)
  • Philipp (FxSync)
  • Stefan (FxHome)

User Requirements

  • Setting up a new mobile device should only involve entering a short code on the desktop device
  • Secondary request, not a hard requirement, is that if the user has a mobile device, and is setting up a desktop device, that the flow is similar and still involves entering the key on the desktop

Desired User Flow

  1. User chooses "quick setup" on new device
  2. Device displays a setup key that contains both the initial secret and a channel ID
  3. On a device that is authenticated, user chooses "add another device" and is prompted for that key
  4. The two devices exchange messages to build the secure tunnel
  5. The already-authenticated device passes all credentials (username/password/passphrase) to the new device
  6. New device completes setup and starts syncing

Implementation (draft)

Terminology

  • Desktop: Client that has Fx Sync already set up
  • Mobile: Client that needs to be set up (of course this could be another desktop computer, too)
  • PIN: code that is displayed on Mobile and entered on Desktop
  • Secret: weak secret that is used to start the J-PAKE algorithm
  • Key: strong secret that both clients derive through J-PAKE

Flow

  1. Mobile asks server for new channel ID (3 characters a-z0-9)
    GET /new_channel  -->  "a7i"
  2. Mobile generates PIN from channel ID + random weak secret (3 characters a-z0-9), computes and uploads J-PAKE msg 1
    PUT /channel_id
  3. Desktop asks user for the PIN, extracts channel ID and weak secret, fetches Mobile's msg 1
    GET /channel_id
  4. Desktop computes and uploads msg 1
    PUT /channel_id
  5. Mobile retrieves Desktop's msg 1
    GET /channel_id

    computes and uploads msg 2

    PUT /channel_id
  6. Desktop retrieves Mobile's msg 2
    GET /channel_id

    computes msg 2 and key, encrypts Sync credentials and uploads msg 2 and encrypted credentials

    PUT /channel_id
  7. Mobile retrieve's Desktop's msg 2 and encrypted credentials
    GET /channel_id

    computes key and decrypts Sync credentials.