mirror of
https://codeberg.org/scip/digiproof.git
synced 2025-12-17 12:41:06 +01:00
initial commit
This commit is contained in:
11
js/security.js
Executable file
11
js/security.js
Executable file
@@ -0,0 +1,11 @@
|
||||
/* crypto helpers */
|
||||
|
||||
|
||||
function pwhash(pass) {
|
||||
/* get the clear text password, generate a salt
|
||||
and hash them together. return the hash */
|
||||
var salt = CryptoJS.lib.WordArray.random(128/8);
|
||||
console.log("key: %s, salt: %s", pass, salt);
|
||||
var key512iter32 = CryptoJS.PBKDF2(pass, salt,{ keySize: 512/32, iterations: 32, hasher: CryptoJS.algo.SHA512 });
|
||||
return key512iter32;
|
||||
}
|
||||
Reference in New Issue
Block a user