diff --git a/README.md b/README.md index 9d3856f..2d13151 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Did you know that websites can identify you based on the way you type? There are spy libraries that can determine how long keys are held down and the time between keys. This is apparently good enough for spying that it can be used as a form of biometric authentication, by companies like Keytrac and TypingDNA. According to TypingDNA, their software has been used for test proctoring, and in banking apps. -This addon was created to skew the key press timing by limiting the speed of presses. The speed is changed randomly on each page load, with a max of 200ms. +This addon was created to skew the key press timing by limiting the speed of presses. The speed is changed randomly on each page load, with a min of 150ms and a max of 300ms. It uses a less than ideal thread locking solution, as simply buffering text does not stop event listeners from spies. diff --git a/background.js b/background.js index 94f6bd7..518c42b 100644 --- a/background.js +++ b/background.js @@ -19,8 +19,8 @@ const defaultHosts = ""; let appCode = function (){ - const maxValue = 150 - const minValue = 25 + let minValue = 75 + let maxValue = 150 let mainKeyboardPrivacy = function(){ @@ -36,6 +36,8 @@ let appCode = function (){ } return buf[0]; } + let up = getRandNum() + let down = getRandNum() console.debug('Protecting keyboard biometrics on ' + document.location.href) @@ -56,7 +58,7 @@ let appCode = function (){ if (e.key.startsWith('Arrow') || e.key.startsWith('Page')){ return true; } - pausecomp(getRandNum()); + pausecomp(up); return true; }, ) @@ -64,7 +66,7 @@ let appCode = function (){ if (e.key.startsWith('Arrow') || e.key.startsWith('Page')){ return true; } - pausecomp(getRandNum()); + pausecomp(down); we return true; }) @@ -72,7 +74,7 @@ let appCode = function (){ }, 100) } function shouldRunKeyboardPrivacy(value){ - if (typeof value.keyboardprivacywhitelist == undefined){ + if (typeof value.keyboardprivacywhitelist === 'undefined'){ mainKeyboardPrivacy() return } @@ -85,11 +87,10 @@ let appCode = function (){ } mainKeyboardPrivacy() } - function noKeyboardPrivacySettings(){ + function noKeyboardPrivacySettings(value){ mainKeyboardPrivacy() } - let whitelist = browser.storage.sync.get("keyboardprivacywhitelist"); whitelist.then(shouldRunKeyboardPrivacy, noKeyboardPrivacySettings) @@ -99,7 +100,6 @@ const dummyStr = '' let defaultCode = dummyStr + appCode; defaultCode = defaultCode.replace('function (){', 'function keyboardPrivacy(){') -console.debug(defaultCode) async function register(hosts, code) { diff --git a/manifest.json b/manifest.json index 846d6f0..ce437db 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "Private Keyboard", - "version": "1.4", + "version": "1.5", "description": "Protect against keyboard biometrics",