我需要找出一种方法,唯一地识别每台计算机访问我正在创建的网站。有人有什么建议吗?

因为我想解决方案工作在所有机器和所有浏览器(在合理的范围内),我试图使用javascript创建一个解决方案。

饼干可不行。

我需要基本上创建一个guid的能力,这是唯一的计算机和可重复的,假设没有硬件变化发生在计算机上。我正在考虑的方向是获得网卡的MAC和这种性质的其他信息,这将id访问网站的机器。


当前回答

我将从简单到复杂给出我的想法。 在上述所有情况下,您可以创建会话,问题本质上转换为匹配会话与请求。

A)(困难:简单)使用客户端硬件显式存储某种类型的会话id/哈希(有相当多的隐私/安全问题,所以确保你哈希任何你存储的东西),解决方案包括:

cookie存储 浏览器存储/webDB/(更奇特的浏览器解决方案) 有权限将东西存储在文件中的扩展名。

上面的问题是,如果用户不想的话,他可以清空他的缓存。

b)(难度中等)登录认证。 大多数现代web框架都提供了这样的解决方案,核心思想是让用户自愿地识别自己,这很简单,但在架构上增加了复杂性。

上述内容的复杂性增加,本质上是非公开内容。

c)(困难:困难-研发)基于元数据的识别,(浏览器ip/语言/浏览器/和其他隐私侵犯的东西,所以一定要让你的用户知道,否则你可能会被起诉) 非完美解决方案可能会变得更加复杂(用户以特定频率输入或使用特定模式的鼠标?你甚至可以应用ML解决方案)。 声称的解决方案

这是最强大的,因为用户甚至可以在没有明确要求的情况下识别他。这是对隐私的直接侵犯(参见GDPR),并不完美。IP可以改变。

其他回答

我觉得饼干可能就是你要找的东西;这是大多数网站唯一识别访问者的方式。

cookie和非cookie方法都有缺陷。但是如果你能原谅cookie方法的缺点,这里有一个想法。

如果你已经在你的网站上使用谷歌Analytics,那么你不需要自己编写代码来跟踪独特的用户。谷歌分析为您通过__utma cookie值,如谷歌的文档中所述。通过重用这个值,您不会创建额外的cookie有效负载,这对于页面请求具有效率优势。

您可以很容易地编写一些代码来访问该值,或者使用脚本的getUniqueId()函数。

这些人开发了一种指纹识别方法,可以非常准确地识别用户:

https://panopticlick.eff.org/static/browser-uniqueness.pdf

We investigate the degree to which modern web browsers are subject to “device fingerprinting” via the version and configuration information that they will transmit to websites upon request. We implemented one possible fingerprinting algorithm, and collected these fingerprints from a large sample of browsers that visited our test side, panopticlick.eff.org. We observe that the distribution of our finger- print contains at least 18.1 bits of entropy, meaning that if we pick a browser at random, at best we expect that only one in 286,777 other browsers will share its fingerprint. Among browsers that support Flash or Java, the situation is worse, with the average browser carrying at least 18.8 bits of identifying information. 94.2% of browsers with Flash or Java were unique in our sample.

通过观察回访用户,我们估计浏览器指纹随时间变化的速度。在我们的样本中,指纹变化很大 很快,但即使是一个简单的启发式通常也能猜出指纹是先前观察到的浏览器的“升级”版本 指纹,99.1%的猜测正确率和假阳性率只有 0.86%。

We discuss what privacy threat browser fingerprinting poses in practice, and what countermeasures may be appropriate to prevent it. There is a tradeoff between protection against fingerprintability and certain kinds of debuggability, which in current browsers is weighted heavily against privacy. Paradoxically, anti-fingerprinting privacy technologies can be self- defeating if they are not used by a sufficient number of people; we show that some privacy measures currently fall victim to this paradox, but others do not.

您可以使用fingerprintjs2

new Fingerprint2().get(function(result, components) {
  console.log(result) // a hash, representing your device fingerprint
  console.log(components) // an array of FP components
  //submit hash and JSON object to the server 
})

在此之后,您可以根据现有用户检查所有用户并检查JSON相似性,因此即使他们的指纹发生了突变,您仍然可以跟踪他们

你可能想尝试在evercookie中设置一个唯一的ID(它可以跨浏览器工作,见他们的常见问题): http://samy.pl/evercookie/

还有一家叫做ThreatMetrix的公司,被很多大公司用来解决这个问题: http://threatmetrix.com/our-solutions/solutions-by-product/trustdefender-id/ 它们相当昂贵,而且他们的其他一些产品也不太好,但他们的设备id运行良好。

最后,还有这个开源jquery实现的panopticlick的想法: https://github.com/carlo/jquery-browser-fingerprint 它现在看起来很不成熟,但可以扩展。

希望能有所帮助!