summaryrefslogtreecommitdiff
path: root/client.js
diff options
context:
space:
mode:
authortomsmeding <hallo@tomsmeding.nl>2015-08-29 11:35:50 +0200
committertomsmeding <hallo@tomsmeding.nl>2015-08-29 11:35:50 +0200
commit1a0cda1c7dc9fa0c5db0bce9a16d483c2a869b3e (patch)
treea4a1c96c5b2c84f9e93e2c6f906151b38b9a5a95 /client.js
parent5a9bb42ee6cb7d46cbd9c84ae24f75e05392d0f0 (diff)
More security -- BREAKING CHANGE
Diffstat (limited to 'client.js')
-rwxr-xr-xclient.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/client.js b/client.js
index ef1812e..32c244b 100755
--- a/client.js
+++ b/client.js
@@ -235,9 +235,11 @@ function registerUser(userid,password){
process.stdout.write("Username? ");
userid=kbd.getLineSync().replace(/[^a-zA-Z0-9_-]/g,"");
process.stdout.write("Password? ");
+var hasher=crypto.createHash("sha512");
kbd.setEcho(false);
-password=kbd.getLineSync();
+hasher.update(kbd.getLineSync());
kbd.setEcho(true);
+password=hasher.digest("hex");
console.log("\nChecking existence...");
userExists(userid,function(exists){