使用 JQuery 进行简单的击键动态 (KD) 测量

发布于 2024-10-17 11:38:56 字数 346 浏览 2 评论 0 原文

我想开发一个简单的应用程序来测量停留时间和飞行时间(请参阅http://www.techrepublic.com/article/reduce-multi-factor-authentication-costs-with-behavioral-biometrics/6150761)在文本区域/框中。如何使用 keypress() 或 keydown() up() 方法来记录这些事件?

I want to develop a simple app to measure dwell time and flight time (see http://www.techrepublic.com/article/reduce-multi-factor-authentication-costs-with-behavioral-biometrics/6150761) in a text area / box. how can I use keypress() or keydown() up() methods to record these events?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

匿名的好友 2024-10-24 11:38:56

我不明白为什么这不值得。仅仅因为 JavaScript 可以在客户端进行修改并不意味着攻击者可以重现实际用户的打字模式。

在客户端执行此操作具有保持用户数据私密性的额外好处(例如,您实际上并未收集用户的击键,而仅收集与其打字模式相关的信息)。

我确信仍然存在隐私问题,但这是一个非常有趣的身份验证(或审核/检测)控制。

I don't understand why this would not be worth it. Just because Javascript can be modified on the client side does not mean an attacker could reproduce an actual user's typing patterns.

Doing this on the client side has the added benefit of keeping the user's data private (e.g. you're not actually collecting user's keystrokes, but only information related to their typing patterns).

I'm sure there are still privacy concerns, but this is a very interesting authentication (or auditing/detection) control.

悲歌长辞 2024-10-24 11:38:56

请参阅此处的示例: http://jsfiddle.net/VDMPt/ source

但正如 Andrea 所说,不值得,因为 Javascript 是客户端

var xTriggered = 0;
$('#target').keyup(function(event) {
  if (event.keyCode == '13') {
     event.preventDefault();
   }
   xTriggered++;
   var msg = 'Handler for .keyup() called ' + xTriggered + ' time(s).';
  $.print(msg, 'html');
  $.print(event);
});

$('#other').click(function() {
  $('#target').keyup();
});

See an example here: http://jsfiddle.net/VDMPt/ source

But as Andrea said, is not worth it since Javascript is client side

var xTriggered = 0;
$('#target').keyup(function(event) {
  if (event.keyCode == '13') {
     event.preventDefault();
   }
   xTriggered++;
   var msg = 'Handler for .keyup() called ' + xTriggered + ' time(s).';
  $.print(msg, 'html');
  $.print(event);
});

$('#other').click(function() {
  $('#target').keyup();
});
无人问我粥可暖 2024-10-24 11:38:56

我相信这种方法在现实环境中不会取得成果,因为原则上,用户在 Javascript 中进行的任何处理都可以通过使用简单的 javascript 调试器或 Firebug 等程序轻松修改。

也就是说,您可以通过以下方式测量这两个指标:

  • 停留时间 = keydown()keyup() 之间的时间。在 keydown() 方法中保存当前时间,并在 keyup() 中计算 twell 时间作为当前时间与 keydown()< /代码> 时间。
  • 飞行时间:从您链接的文章的图中,我无法轻易理解它是如何定义的,但我会将其计算为您离开最后一个键时的差值 (keyup( )) 以及当您开始按下一个键 (keydown()) 时。因此,在 keyup() 中保存时间,例如 last_key_time,并在 keydown() 中将飞行时间计算为 current_time - last_key_time

I believe this approach would not be fruitful in a real-world environment, because whatever processing you do in Javascript is, in line of principle, easily modifiable by the user, by using a simple javascript debugger or programs like Firebug.

That said, you could measure the two metrics in this way:

  • dwell time = time between keydown() and keyup(). In your keydown() method save the current time and in the keyup() compute the twell time as the difference between the current time and the keydown() time.
  • flight time: from the figure of the article you linked I can't easily understand how it is defined, but I would compute it as the difference between when you left the last key (keyup()) and when you start pressing the next key (keydown()). So in keyup() save a time, for instance last_key_time, and in keydown() compute the flight time as current_time - last_key_time
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文