diff --git a/Site/algorithm.html b/Site/algorithm.html index 36659335..0e08b180 100644 --- a/Site/algorithm.html +++ b/Site/algorithm.html @@ -85,10 +85,10 @@ - +
- +

Master Password

@@ -118,13 +118,13 @@

Master Password uses a stateless algorithm that relies solely on its implementation and the user's inputs. The user is expected to remember the following information:

@@ -132,26 +132,33 @@ In short, the algorithm is comprised of the following steps:

+

+ A note on types: +

+

The Master Password

- The user chooses a single master password, preferably sufficiently long to harden against brute-force attacks. Master Password recommends absurd two or three-word sentences as they're easily remembered and generally sufficiently high in entropy. + The user chooses a single master password, preferably sufficiently long to harden against brute-force attacks. Master Password recommends absurd three or four-word sentences as they're easily remembered and generally sufficiently high in entropy.

- The application then creates a scrypt key derivative from the user's password. This process takes quite a bit of processing time and memory. This step exists to make brute-force attempts at guessing the master password from a given output password far more difficult, to practically infeasible, even for otherwise vulnerable password strings. + The application then creates a scrypt key derivative from the user's password. This process takes quite a bit of processing time and memory. This step exists to make brute-force attempts at guessing the master password from a given output password far more difficult, to practically infeasible, even for otherwise vulnerable password strings.

                 key   = scrypt( P, S, N, r, p, dkLen )
                 where
-                P     = master password (UTF-8)
-                S     = <empty>
-                N     = 16384
+                P     = master password
+                S     = "com.lyndir.masterpassword" . name length . name
+                N     = 32768
                 r     = 8
-                p     = 1
+                p     = 2
                 dkLen = 64
             
@@ -167,8 +174,7 @@ These input values are combined in a byte array, separated by a single NUL byte. In order, the input values are the site name (UTF-8 decoded), the master key, and a salt (this is the password counter, a 32-bit unsigned integer in network byte order). The byte array is hashed using the SHA-1 algorithm to yield the seed as a result.

-                salt = htonl( password counter )
-                seed = sha1( site name . "\0" . key . "\0" . salt )
+                seed = hmac-sha256( key, "com.lyndir.masterpassword" . site name length . site name . counter )
             

Generating The Output

@@ -180,33 +186,58 @@

Since the idea is that the output password can be used directly as a password to protect the user's account on the site, it needs to be able to pass the site's password policy. - Master Password addresses this problem by introducing password types. Each password type describes what an output password must look like and maps to a set of ciphers. Ciphers describe the resulting output password using a series of characters that map to character groups of candidate output characters. A cipher has the same length as the output password it yields. Each character in the cipher maps to a specific character group. At each position of the output password, a character is chosen from the character group identified by the character in the cipher at the same position. + Master Password addresses this problem by introducing password types. Each password type describes what an output password must look like and maps to a set of templates. Templates describe the resulting output password using a series of characters that map to character groups of candidate output characters. A template has the same length as the output password it yields. Each character in the template maps to a specific character group. At each position of the output password, a character is chosen from the character group identified by the character in the template at the same position.

- The following ciphers are defined: + The following templates are defined: