Skip to content

Commit 018f551

Browse files
committed
[tep] rename doc and minor edits.
- TEP-asymmetric_key_client_authentication.md -> TEP-0012.md - Some clarifications and expansions based upon Jose's questions.
1 parent f4c3825 commit 018f551

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

TEP-asymmetric_key_client_authentication.md renamed to TEP-0012.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,10 @@ The seed words are prefixed with an additional `"torrust"` word, and displayed t
119119

120120
Clients must provide an option for the user to give a seed-password in generation and recovery.
121121

122-
* The client should only need their seed mnemonic code in the case they have lost their other login credentials.
122+
### Storage of Mnemonic Code
123+
The client should delete from memory the recovery seed once the user has confirmed that they have backed up the seed, and the key-pair for login has been generated.
124+
125+
This gives the user some forward security. In the future the user may wish to use the same seed to rotate their keys (for example, when logging in on a new computer). Because the seed is not saved in the client, if the users' client is compromised at a later date, the seed itself remains secret.
123126

124127
## Public and Private Key Derivation
125128
Deriving the keys according to: [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki).
@@ -130,7 +133,9 @@ m / purpose' / version' / torrust-purpose' / index'
130133
131134
m / "torrust" / 0 / "authentication" / 0
132135
```
133-
The resulting node is a private-public secp256k1 key-pair.
136+
The resulting node is a private-public secp256k1 key-pair. (the same elliptical-curve as is used in bitcoin).
137+
138+
___Note:__ as an extension, the future client may choose to register a series of public keys with the server, i.e. 0, 1, 2, 3, etc, and only keep the current key in storage, this will allow for easier key-rotation in the future._
134139

135140
## Login Credential Encoding
136141
For encoding the secp256k1, we use [BIP-340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki) encoding, 32-bytes for public keys.</br>
@@ -215,9 +220,41 @@ token_auth
215220
If matching, authorise user according to their user public key. (U_client).
216221
```
217222

223+
_The server now can issue a session token to the client accordingly._
224+
225+
## Security Analysis
226+
227+
This scheme is very simple, it would be very good there was some formal security analysis.
228+
229+
The basic protocol follows:
230+
231+
1. Both derive a common ephemeral (temporary) key:</br>
232+
`client_ephemeral (DH) server_ephemeral -> ephemeral_key`
233+
234+
2. Both derive a common authentication key:</br>
235+
`client_public (DH) server_ephemeral -> authentication_key`
236+
237+
3. Client derives the common authentication token:</br>
238+
`sever_uri + ephemeral_key + authentication_key -> authentication_token`
239+
240+
4. Client sends URI and authentication token to server:</br>
241+
`client: sever_uri, authentication_token => server`
242+
243+
5. Server checks `sever_uri` matches expected value.
244+
245+
6. Server also derives the common authentication token:</br>
246+
`sever_uri + ephemeral_key + authentication_key -> authentication_token`
247+
`authentication_token`
248+
249+
7. Server checks the received `authentication_token` matches self-derived value.
250+
218251
# Compatibility
219252

220253
The updated client will support both login in with the new authentication scheme, and transferring existing users with password authentication to the new scheme.
221254

222255
# Reference Implementations
223256

257+
## Similar Implementations
258+
This scheme is so simple that I guess there should be!
259+
260+
However, the common ones that I have found are far-more complex than what we use here, (such as getting a CA involved with the authentication).

0 commit comments

Comments
 (0)