More entropy.
This commit is contained in:
parent
b86d5883bc
commit
dc52dfe703
2 changed files with 18 additions and 12 deletions
|
@ -1653,14 +1653,17 @@ if (typeof Crypto == "undefined" || !Crypto.util) {
|
|||
entropyStr += pluginsStr + mimeTypesStr;
|
||||
// cookies and storage: 1 bit
|
||||
entropyStr += navigator.cookieEnabled + typeof (sessionStorage) + typeof (localStorage);
|
||||
// language: ~7 bit
|
||||
entropyStr += navigator.language;
|
||||
// history: ~2 bit
|
||||
entropyStr += window.history.length;
|
||||
// location
|
||||
entropyStr += window.location;
|
||||
|
||||
var entropyBytes = Crypto.SHA256(entropyStr, { asBytes: true });
|
||||
sr.seedInt8(entropyBytes[0]);
|
||||
sr.seedInt8(entropyBytes[1]);
|
||||
sr.seedInt8(entropyBytes[2]);
|
||||
sr.seedInt8(entropyBytes[3]);
|
||||
sr.seedInt8(entropyBytes[4]);
|
||||
sr.seedInt8(entropyBytes[5]);
|
||||
for (var i = 0 ; i < entropyBytes.length ; i++) {
|
||||
sr.seedInt8(entropyBytes[i]);
|
||||
}
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
|
|
@ -166,13 +166,16 @@
|
|||
entropyStr += pluginsStr + mimeTypesStr;
|
||||
// cookies and storage: 1 bit
|
||||
entropyStr += navigator.cookieEnabled + typeof (sessionStorage) + typeof (localStorage);
|
||||
// language: ~7 bit
|
||||
entropyStr += navigator.language;
|
||||
// history: ~2 bit
|
||||
entropyStr += window.history.length;
|
||||
// location
|
||||
entropyStr += window.location;
|
||||
|
||||
var entropyBytes = Crypto.SHA256(entropyStr, { asBytes: true });
|
||||
sr.seedInt8(entropyBytes[0]);
|
||||
sr.seedInt8(entropyBytes[1]);
|
||||
sr.seedInt8(entropyBytes[2]);
|
||||
sr.seedInt8(entropyBytes[3]);
|
||||
sr.seedInt8(entropyBytes[4]);
|
||||
sr.seedInt8(entropyBytes[5]);
|
||||
for (var i = 0 ; i < entropyBytes.length ; i++) {
|
||||
sr.seedInt8(entropyBytes[i]);
|
||||
}
|
||||
}
|
||||
})();
|
Loading…
Reference in a new issue