JavaScript and C # compatible hash code

I need a way to hash passwords in C # and the ability to hash the same password in JavaScript and get the same result in order to implement the offline authentication mechanism.

I found the bCrypt version for JavaScript here: http://code.google.com/p/javascript-bcrypt/downloads/detail?name=jBCrypt-v2.2.tar.gz , and there are also C # implementations, but I don’t know compatible.

I need this for the web application that I am developing, which can be used by different people in a group in situations where a network connection is not always available. All data will be uploaded to the web application, but each user will see only his share of the data. To do this, I need users to authenticate, even if there is no network connection. I think I can do this by storing all the usernames and their password hashes (created by the ASP.NET MVC / C # controller) in local storage. Then, when the user enters his password, I would find his hash using JavaScript and compare it with the hashed password stored in local storage.

The web application does NOT process banking information or any such confidential data, so the security requirements are minimal.

+3
source share
2 answers

Bcrypt is bcrypt . You will need three functions to use the bcrypt function: salt, key, and value.

As long as you can provide the three required values ​​in some way, and the libraries are not broken, then the result of the bcrypt hash will be the same - the parameters and the result may need to be converted between the byte [] and the hexadecimal string or something else but the hash value will be the same.

Salt and value are sometimes encoded in a "hash" - for example, combined into one line. In this case, it is just a simple conversion to create / extract the appropriate parameters and exchange format.


, , , . bcrypt / . ( , .)

, , ​​ . , , .


, , . , , bcrypt , , - , . ( - , ..)

+2

All Articles