2.2.1.2 Password Hash String

The password used for authentication into a group is not transmitted as plaintext. Rather it MUST be transmitted as a string-encoded hash of the original group password, in the format specified below.

The password hash of a Unicode string is defined as the SHA1 hash [RFC3174] of the Unicode string (including the null-terminator) followed by the Unicode string "MS P2P Grouping" (including NULL-terminator). For example, if the group password is "password", the following data (as Unicode characters) is used as input into the hash function:

p

a

s

s

w

o

r

d

\0

M

S

 

P

2

P

 

G

r

o

u

p

i

n

g

\0

Once generated, the hash output MUST be encoded as a null-terminated Unicode string with each character representing a nibble in the hash. The character used for each nibble MUST be the Unicode character 'a' plus the value of the nibble. For example, if the hash value is 0x01234567, the encoded string is "abcdefgh".