aboutsummaryrefslogtreecommitdiffhomepage
path: root/public
diff options
context:
space:
mode:
Diffstat (limited to 'public')
-rw-r--r--public/scripts/chat.js2
-rw-r--r--public/scripts/encryption.js22
2 files changed, 18 insertions, 6 deletions
diff --git a/public/scripts/chat.js b/public/scripts/chat.js
index 2c191b9..497349b 100644
--- a/public/scripts/chat.js
+++ b/public/scripts/chat.js
@@ -55,7 +55,7 @@ async function evaluateKeyGeneration() {
throw 'Not verified!';
}
await encryption.generatePrivateFingerprint(pin);
- await encryption.decryptPrivateKey();
+ await encryption.decryptPrivateKey(); // try decrypting
chat();
} catch (err) { // decrypting failed
if (tryCount === 3) {
diff --git a/public/scripts/encryption.js b/public/scripts/encryption.js
index c06bc95..735cc33 100644
--- a/public/scripts/encryption.js
+++ b/public/scripts/encryption.js
@@ -311,15 +311,22 @@ const self = module.exports = {
.then(obj => obj.user.userId.userid.replace(/ \((.+?)\)/g, '')) || '',
/**
- * Gets the unique fingerprint of the peer, generated using every data javascript can get from the
+ * Generates the unique fingerprint of the peer using every data javascript can get
+ * from the
* browser and the hashed passphrase of the peer
* @param passphrase
* @returns {Promise<void>}
*/
- generatePrivateFingerprint: passphrase => fingerprintJs.getPromise()
- .then((components) => {
+ generatePrivateFingerprint: passphrase => fingerprintJs.getPromise({
+ excludes: {
+ screenResolution: true,
+ availableScreenResolution: true,
+ },
+ })
+ .then(async (components) => {
const fingerprintHash = fingerprintJs.x64hash128(components.map(pair => pair.value)
.join(), 31);
+ console.log(fingerprintHash);
let shaObj = new JsSHA('SHA3-512', 'TEXT');
shaObj.update(passphrase);
const passphraseHash = shaObj.getHash('HEX');
@@ -330,11 +337,16 @@ const self = module.exports = {
}),
/**
- * Gets the unique fingerprint of the peer, generated using every data javascript can get from the
+ * Generates the unique fingerprint of the peer using every data javascript can get from the
* browser and a randomly generated string
* @returns {Promise<void>}
*/
- generatePublicFingerprint: () => fingerprintJs.getPromise()
+ generatePublicFingerprint: () => fingerprintJs.getPromise({
+ excludes: {
+ screenResolution: true,
+ availableScreenResolution: true,
+ },
+ })
.then(async (components) => {
const fingerprintHash = fingerprintJs.x64hash128(components.map(pair => pair.value)
.join(), 31);