首页 \ 问答 \ 如何唯一标识一台计算机?(How to uniquely identify a computer?)

如何唯一标识一台计算机?(How to uniquely identify a computer?)

有没有办法'抢'一些个性化的ID,INFO,NAME,NUMBER,DATA等?

任何东西只是为了区分和识别同一IP上的两台或更多PC:除了$_SESSION之外的用户的计算机名称?

这些工作都不是:

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
php_uname('n');
php_uname();

Is there any way to 'grab' some personalized ID, INFO, NAME, NUMBER, DATA, etc.?

Anything just to differentiate and recognize two or more PC on the same IP: something like the Computer name of the user besides $_SESSION?

None of these work:

$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']);
php_uname('n');
php_uname();

原文:https://stackoverflow.com/questions/5048066
更新时间:2023-05-24 22:05

最满意答案

如果改变输入顺序改变哈希值,那实际上是件好事。 否则,你会遇到“bat”和“tab”都散列到相同值的问题。 对于像SHA-256这样的加密哈希,目标是使其不可能(具有非常大但不是无限量的资源)来找到产生相同哈希值的任何其他输入,并且“bat”和“tab”是两个不同的输入,如果它们具有相同的哈希值,那将是令人惊讶和不幸的。


It's actually a good thing if changing the order of input changes the hash value. Otherwise you'd run into issues where "bat" and "tab" both hashed to the same value, for example. For cryptographic hashes like SHA-256, the goal is to make it impossible (with a very large but not infinite amount of resources) to find any other input that produces the same hash value, and "bat" and "tab" are two different inputs, so it would be both surprising and unfortunate if they had the same hash value.

相关问答

更多
  • 我推荐免费的Crypto ++库。 这是HMAC的样本。 I would recommend the free Crypto++ library. Here's a sample for HMAC.
  • 新密钥将阻止旧版本的用户无缝更新。 这只是关于更改Google Play中发布的应用的签名密钥的冷酷真相。 建议的迁移方法是使用Dialog更新现有应用程序,该对话框为用户提供继续运行现有版本的机会,或者转到Play商店以安装新版本(在Play中必须显示为单独的应用程序)。 新应用程序应检查是否存在旧应用程序,并提醒用户将其卸载。 您可以将旧应用程序保留在商店中,这样您就不会丢失评分和评论,只需确保添加通知并链接到将新用户指向最新版本的说明。 当我试图理解时, 这篇文章对我很有帮助。 The new key ...
  • echo命令正在为您的字符串添加尾随换行符。 尝试: hashlib.sha256("hello\n").hexdigest() The echo commands are adding a trailing newline to your string. Try: hashlib.sha256("hello\n").hexdigest()
  • 目前,Indy 本身只实现了一些哈希算法,但不包括SHA-256(我为该功能创建了一个票证 )。 对于未在本机实现的算法,Indy允许您挂钩您选择的外部哈希实现,以提供实际的哈希功能。 您看到IsAvailable返回false,因为您还没有完成该连接。 只要为IdFIPS单元中的以下回调分配适当的包装函数,就可以使用所需的任何哈希实现: IsHashingIntfAvail UpdateHashInst FinalHashInst 而对于SHA-256,还有: GetSHA256HashInst IsS ...
  • 替代方案是Rfc2898DeriveBytes 。 使用起来更安全,特别是如果您需要超过20个字节的输出。 它当然与PasswordDeriveBytes不兼容。 对于超过20个字节的任何值,PasswordDeriveBytes都会被破坏。 不幸的是,PBKDF2也有一个缺点:它重复了散列大小上任何值的所有迭代。 在这种情况下,您可能希望将其与KBKDF配对。 因此,如果不恢复到其他库,您似乎无法做到这一点。 这就是Bouncy Castle可能会来的地方。 它具有PBKDF2功能,您可以使用HMAC进行 ...
  • 是将代码更改为MessageDigest.getInstance("SHA-256"); 应该没事。 Yes changing the code to MessageDigest.getInstance("SHA-256"); should be fine.
  • 所有这些网站都返回有效值。 站点4和5使用\n作为换行符。 编辑 我看到你编辑了你的问题,在代码示例中添加了Encoding.Default.GetBytes 。 这很有趣,因为您看到在计算哈希值之前有一些string to byte array conversion 。 换行( \n或\r\n )以及文本编码都是解释字符串以获取不同字节值的两种方法。 一旦你有与输入相同的字节,所有哈希结果将是相同的。 编辑2: 如果您直接处理字节,那么只需用这些字节计算哈希值。 不要尝试提供不同的哈希值; 哈希必须只返回 ...
  • 比特币相关的字节操作有点棘手,因为它们倾向于随意切换字节序。 首先,我们取最初的[]字节数组表示 00000001c570c4764aadb3f09895619f549000b8b51a789e7f58ea750000709700000000103ca064f8c76c390683f8203043e91466a7fcc40e6ebc428fbcc2d89b574a864db8345b1b00b5ac0000000000000080000000000000000000000000000000000000000 ...
  • 如果改变输入顺序改变哈希值,那实际上是件好事。 否则,你会遇到“bat”和“tab”都散列到相同值的问题。 对于像SHA-256这样的加密哈希,目标是使其不可能(具有非常大但不是无限量的资源)来找到产生相同哈希值的任何其他输入,并且“bat”和“tab”是两个不同的输入,如果它们具有相同的哈希值,那将是令人惊讶和不幸的。 It's actually a good thing if changing the order of input changes the hash value. Otherwise yo ...
  • md32_common.h是C的“穷人模板”。它定义了任何哈希算法的通用更新函数的结构。 每个算法都提供此常规结构的名称。 所以在md32_common.h中你会发现: int HASH_UPDATE (HASH_CTX *c, const void *data_, size_t len) 在sha / sha256.c中你会发现: #define HASH_UPDATE SHA256_Update 因此,当包含md32_common.h时,您将获得定义的SHA256_Updat ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)