Encrypt the whole credentials data
This commit is contained in:
@@ -36,9 +36,9 @@
|
|||||||
|
|
||||||
// Credentials are stored encrypted in the Browsen's localstorage (yes, it's NOT safe, but it's a hurdle)
|
// Credentials are stored encrypted in the Browsen's localstorage (yes, it's NOT safe, but it's a hurdle)
|
||||||
userLoginButton.onclick=function(){
|
userLoginButton.onclick=function(){
|
||||||
credentials={username:userNameField.value,passwordCrypt:encryptXor(userPasswordField.value, '5346245634634765377')};
|
credentials={username:userNameField.value,password:userPasswordField.value};
|
||||||
localStorage.setItem("Credentials",JSON.stringify(credentials));
|
localStorage.setItem("Credentials",encryptXor(JSON.stringify(credentials), '5346245634634765377'));
|
||||||
alert('Credentials Saved.');
|
console.log('Credentials Saved.');
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
};
|
};
|
||||||
userLoginButton.onkeydown=onclick;
|
userLoginButton.onkeydown=onclick;
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
localStorage.setItem("LastLoginDate",new Date().getTime())
|
localStorage.setItem("LastLoginDate",new Date().getTime())
|
||||||
clearInterval(myInterval);
|
clearInterval(myInterval);
|
||||||
userNameField.value=credentials.username;
|
userNameField.value=credentials.username;
|
||||||
userPasswordField.value=encryptXor(credentials.passwordCrypt, '5346245634634765377');
|
userPasswordField.value=credentials.password;
|
||||||
|
|
||||||
userLoginButton.click();
|
userLoginButton.click();
|
||||||
}
|
}
|
||||||
@@ -57,7 +57,8 @@
|
|||||||
|
|
||||||
// Password is encrypted with XOR to preent "accidental" revelation
|
// Password is encrypted with XOR to preent "accidental" revelation
|
||||||
let credentials=localStorage.getItem("Credentials");
|
let credentials=localStorage.getItem("Credentials");
|
||||||
if (credentials!==null) { credentials=JSON.parse(credentials); }
|
if (credentials!==null) { credentials=JSON.parse(encryptXor(credentials, '5346245634634765377')); }
|
||||||
|
console.log(credentials);
|
||||||
loginThread(credentials);
|
loginThread(credentials);
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|||||||
Reference in New Issue
Block a user