From 71527cc4b1185f1605e052c61d4850e0cdfb8495 Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 25 Jul 2019 16:36:53 -0400 Subject: [PATCH] Switched back to sha256, sha512 is just too long. --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 1fe6256..27b6667 100644 --- a/index.js +++ b/index.js @@ -102,7 +102,7 @@ app.get('/api/postVideoSponsorTimes', function (req, res) { let hashedIP = ip + globalSalt; //hash it 5000 times, this makes it very hard to brute force for (let i = 0; i < 5000; i++) { - let hashCreator = crypto.createHash('sha512'); + let hashCreator = crypto.createHash('sha256'); hashedIP = hashCreator.update(hashedIP).digest('hex'); } @@ -268,7 +268,7 @@ function getHashedUserID(userID) { let hashedUserID = userID; //hash it 5000 times, this makes it very hard to brute force for (let i = 0; i < 5000; i++) { - let hashCreator = crypto.createHash('sha512'); + let hashCreator = crypto.createHash('sha256'); hashedUserID = hashCreator.update(hashedUserID).digest('hex'); }