Skip to content

Commit a2f9c94

Browse files
committed
Add option for generated PANDA secrets.
This changes the working in the new contact UI and adds a "Generate" button in the PANDA flow. This is to support exchanging shared secrets via email or IM which, while not as secure as other options, is a lot easier.
1 parent 0d05536 commit a2f9c94

File tree

1 file changed

+30
-9
lines changed

1 file changed

+30
-9
lines changed

client/gui.go

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1987,9 +1987,13 @@ func (c *guiClient) newContactUI(contact *Contact) interface{} {
19871987
},
19881988
{
19891989
{1, 1, nil},
1990-
{1, 1, Label{text: `Manual keying involves exchanging key material with your contact in a secure and authentic manner, i.e. by using PGP. The security of Pond is moot if you actually exchange keys with an attacker: they can masquerade the intended contact or could simply do the same to them and pass messages between you, reading everything in the process. Note that the key material is also secret - it's not a public key and so must be encrypted as well as signed.
1990+
{1, 1, Label{text: `Shared secret keying involves anonymously contacting a global, shared service and performing key agreement with another party who holds the same shared secret.
19911991
1992-
Shared secret keying involves anonymously contacting a global, shared service and performing key agreement with another party who holds the same shared secret and shared time as you. For example, if you met your contact in real life, you could agree on a shared secret and the time (to the minute). Later you can both use this function to bootstrap Pond communication. The security of this scheme rests on the secret being unguessable, which is very hard for humans to manage. So there is also a scheme whereby a deck of cards can be shuffled and split between you.`, wrap: 400}},
1992+
If other other party is someone who you are in email or IM contact with, then a button is provided to generate a secret, which can then be sent to the other party. Neither Email nor IM ensures that someone didn't change the secret during transmission but you can verify the other party's fingerprint later and, as always, have to weigh convenience against security.
1993+
1994+
If, for example, you met your contact in real life, you could agree on a shared secret and the time (to the minute). Later you can both use this function to bootstrap Pond communication. The security of this scheme rests on the secret being unguessable, which is very hard for humans to manage. So there is also a scheme whereby a deck of cards can be shuffled and split between you.
1995+
1996+
Manual keying (not generally recommended) involves exchanging key material with your contact in a secure and authentic manner, i.e. by using PGP. The security of Pond is moot if you actually exchange keys with an attacker: they can masquerade the intended contact or could simply do the same to them and pass messages between you, reading everything in the process. Note that the key material is also secret - it's not a public key and so must be encrypted as well as signed.`, wrap: 400}},
19931997
},
19941998
{
19951999
{1, 1, nil},
@@ -2000,16 +2004,16 @@ Shared secret keying involves anonymously contacting a global, shared service an
20002004
{1, 1, Label{widgetBase: widgetBase{hExpand: true}}},
20012005
{1, 1, Button{
20022006
widgetBase: widgetBase{
2003-
name: "manual",
2007+
name: "shared",
20042008
},
2005-
text: "Manual Keying",
2009+
text: "Shared secret",
20062010
}},
20072011
{1, 1, Label{widgetBase: widgetBase{hExpand: true}}},
20082012
{1, 1, Button{
20092013
widgetBase: widgetBase{
2010-
name: "shared",
2014+
name: "manual",
20112015
},
2012-
text: "Shared secret",
2016+
text: "Manual Keying",
20132017
}},
20142018
{1, 1, Label{widgetBase: widgetBase{hExpand: true}}},
20152019
},
@@ -2278,7 +2282,15 @@ func (c *guiClient) newContactPanda(contact *Contact, existing bool, nextRow int
22782282
widgetBase: widgetBase{font: fontMainLabel, foreground: colorHeaderForeground, hAlign: AlignEnd, vAlign: AlignCenter},
22792283
text: "Shared secret",
22802284
}},
2281-
{2, 1, Entry{widgetBase: widgetBase{name: "shared"}}},
2285+
{2, 1, Grid{
2286+
colSpacing: 5,
2287+
rows: [][]GridE{
2288+
{
2289+
{1, 1, Entry{widgetBase: widgetBase{name: "shared", width: 400}}},
2290+
{1, 1, Button{widgetBase: widgetBase{name: "generate"}, text: "Generate"}},
2291+
},
2292+
},
2293+
}},
22822294
},
22832295
{
22842296
{1, 1, Label{
@@ -2342,9 +2354,13 @@ func (c *guiClient) newContactPanda(contact *Contact, existing bool, nextRow int
23422354
},
23432355
{
23442356
{1, 1, nil},
2345-
{1, 1, Label{text: `The shared secret can be a phrase, or can be generated by shuffling one or two decks of cards together, splitting the stack roughly in half and giving one half to each person. (Or you can do both the card trick and have a phrase.) Additionally, it's possible to use the time of the meeting as a salt if you agreed on it.
2357+
{1, 1, Label{text: `If you received a secret from someone, enter it as the "Shared secret" and ignore the rest.
2358+
2359+
If you wish to email/IM a shared secret, click "Generate" to create one and send it to them over email or IM.
23462360
2347-
When entering the cards enter the number or face of the card first, and then the suite - both as single letters. So the three of dimonds is '3d' and the ace of spades is 'as'. Discard the jokers. Click on a card to delete.`, wrap: 400}},
2361+
If you are agreeing upon the shared secret via other means, then it can be a phrase, or can be generated by shuffling one or two decks of cards together, splitting the stack roughly in half and giving one half to each person. (Or you can do both the card trick and have a phrase.) Additionally, it's possible to use the time of a meeting as a salt if you agreed on it.
2362+
2363+
When entering cards enter the number or face of the card first, and then the suite - both as single letters. So the three of dimonds is '3d' and the ace of spades is 'as'. Discard the jokers. Click on a card to delete.`, wrap: 400}},
23482364
},
23492365
{
23502366
{1, 1, nil},
@@ -2484,6 +2500,11 @@ SharedSecretEvent:
24842500
contact.pandaKeyExchange = kx.Marshal()
24852501
contact.kxsBytes = nil
24862502
break SharedSecretEvent
2503+
case click.name == "generate":
2504+
var secret [16]byte
2505+
c.randBytes(secret[:])
2506+
c.gui.Actions() <- SetEntry{name: "shared", text: fmt.Sprintf("%x", secret[:])}
2507+
c.gui.Signal()
24872508
}
24882509
}
24892510
}

0 commit comments

Comments
 (0)