I recently wrote out a small javascript library that allows you to verify identity server password hashes in nodeJS. While I was doing the research I learnt that the type of hash, iterations and salt length is encoded by adding extra bytes to the final hash that is given in base64 afterwards.
Specifically the order is always the same and by reading the initial 25 bytes of data you learn everything about how the Subkey was encoded. Here's an example including the insertion example.
this.writeNetworkByteOrder(outputBytes, 1, 1);
this.writeNetworkByteOrder(outputBytes, 5, 10000);
this.writeNetworkByteOrder(outputBytes, 9, salt.length);
function() writeNetworkByteOrder(buffer, offset, value){
buffer[offset + 0] = value >> 0;
buffer[offset + 1] = value >> 8;
buffer[offset + 2] = value >> 16;
buffer[offset + 3] = value >> 24;
}
Is this common practice? Should I try and avoid using the default password hasher provided with identity server? How much is given away by knowing this information?
Why this isn't a duplicate
My question is specifically about the encoding that happens on the resulting hash. This is the base64 hash that is the result of the identity server operation. Providing you know the hash is base64 you can readily read the encryption type, iterations and salt length directly from it. I want to know how or if this is safe and if it's considered good security practice.