You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: TEP-0012.md
+39-2Lines changed: 39 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,10 @@ The seed words are prefixed with an additional `"torrust"` word, and displayed t
119
119
120
120
Clients must provide an option for the user to give a seed-password in generation and recovery.
121
121
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.
123
126
124
127
## Public and Private Key Derivation
125
128
Deriving the keys according to: [BIP-32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki).
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._
134
139
135
140
## Login Credential Encoding
136
141
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
215
220
If matching, authorise user according to their user public key. (U_client).
216
221
```
217
222
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>
7. Server checks the received `authentication_token` matches self-derived value.
250
+
218
251
# Compatibility
219
252
220
253
The updated client will support both login in with the new authentication scheme, and transferring existing users with password authentication to the new scheme.
221
254
222
255
# Reference Implementations
223
256
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