Question

can anyone recommend a good method to create a sha1 salt using javascript ?

Was it helpful?

Solution

First, read up on what a salt is for to make sure you understand it. This and this will get you started, but you should read more.

Essentially, any random data of appropriate size will work for your purpose. Generally speaking, the fact that you are using SHA1 is irrelevant.

Just make sure it is large enough to prevent realistic rainbow table attacks.

OTHER TIPS

Although this is an older post, it still appears at the top of the results for a search on "sha1 javascript". (Excluding a question on how to Decode SHA1 using javascript?)

For anyone simply looking for a js encryption library, the following link might be helpful:

crypto-js

At this time, there's no built-in javascript mechanism for handling (en/de)cryption so it's likely your best bet unless you prefer using the jQuery plugin above.

Check out this jQuery Plugin: http://plugins.jquery.com/project/sha1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top