This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// bower install crypto-js | |
// Add to scripts to html file | |
// <script src="bower_components/crypto-js/crypto-js.js"></script> | |
// <script src="bower_components/crypto-js/pbkdf2.js"></script> | |
function auth(password) { | |
// Make a salt with CryptoJS.lib.WordArray.random(128/8); | |
var salt = 'your salt'; // CryptoJS.lib.WordArray.random(128/8); | |
// 1000 iterations takes a couple seconds in the browser. Wouldn't want to go much higher if this is a browser implementation |