Changes

Jump to: navigation, search

Identity/AttachedServices/KeyServerProtocol

1,735 bytes added, 03:46, 10 July 2013
Crypto Notes: explain how wrap(kB) uses XOR
Strong entropy is needed in the following places:
* (client) initial creation of kA and kB
* (client) creation of private "a" value inside SRP
* (server) initial creation of kA and wrap(kB)
* (server) creation of private "B" value inside SRP
* (server) creation of signToken and resetToken
A slightly more-traditional alternative would be to use AES-CTR (with the same HMAC-SHA256 used here), with a randomly-generated IV. This is equally secure, but requires implementors to obtain an AES library (with CTR mode, which does not seem to be universal). An even more traditional technique would be AES-CBC, which introduces the need for padding and a way to specify the length of the plaintext. The additional specification complexity, plus the library load, leads me to prefer HKDF+XOR.
 
kB is equal to the XOR of wrapKey (which is a deterministic function of the user's email address, password, stretchSalt, and the stretching parameters) and the server's randomly-generated wrap(kB) value, making kB a random value too. Using XOR as a wrapping function allows us to avoid sending kB or wrap(kB) in the initial createAccount arguments, which are not protected by SRP, and thus would enable an eavesdropper to mount a dictionary attack on the password (using wrap(kB) as their oracle).
 
Likewise, allowing the server to generate kA avoids exposure during createAccount. The only point of vulnerability is a forgotten-password resetAccount() message, if an eavesdropper can learn the resetToken. In this case, the attacker might either use the resetToken themselves (then use signToken to learn kA and wrap(kB)), or passively decrypt the resetAccount() arguments to retrieve just wrap(kB). Given wrap(kB) and some encrypted browser data, the attacker can guess passwords (and derive kB, etc) until the data decrypts properly.
 
To make this technique safe, any time kB or the password is changed, the stretchSalt should be changed too. Otherwise knowledge of both wrap(old-kB) and old-kB would reveal wrapKey, making it easy to deduce the new kB. Changing stretchSalt causes wrapKey to change too, preventing this.
 
stretchSalt is incorporated at the end of the stretching process to allow it to proceed in parallel with the getToken1() call that retrieves the salt. The inputs to the lengthy stretch come entirely from the user (email and password) or are optimistically (stretching parameters). This speedup seems more important than the minor security benefit of including the salt at the beginning of the stretch.
= Glossary =
Confirm
471
edits

Navigation menu