dou11655853 2015-08-10 12:18
浏览 67
已采纳

定时攻击如何工作以及为什么Symfony的字符串工具提示传递字符串进行比较的精确顺序

To compare the hashed password with the one provided by the user there is the util StringUtilprovided by the Symfony.

The documentation speaks about the "timing attacks": an attacker may have useful information about the complexity of the password observing the time needed to a website to compare the provided password with the one it stores.

The documentation says also that

To avoid timing attacks, the known string must be the first argument and the user-entered string the second.

Why does the order matter?

  • 写回答

1条回答 默认 最新

  • dongxianghui3709 2015-08-11 00:21
    关注

    Based on the current version of StringUtils, it actually doesn't matter. What does matter is the correct order of, e.g. password_verify().

    The documentation is likely referring to the 2014 and earlier version of StringUtils, which tried to avoid leaking the string length. During the discussion to harden this class against mbstring.func_overload configuration, it was decided that leaking length was unavoidable, the string length is usually public (i.e. for a MAC), and it's generally better to focus on stopping the leak of useful information.

    In that case, the order used to matter, but now it really doesn't.

    I'd call it an outdated documentation issue. I opened a ticked in symfony-docs to correct it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探