dongshan1811 2013-08-17 23:39
浏览 23
已采纳

在crypt()中手动设置舍入不正常

I had setup a password system which had the system generate a random digit character and use that as the rounds number for crypting a password.

It worked fine until recently when logins stopped working. After a bit of debugging i realized that the cyrpt() function is not accepting the 4 digits anymore and instead only keeping the first 2 digits.

Example:

Generated Rounds Number:6355 Crypt output: $6$rounds=63$jOa4lXzFPo1W120PzaHk06JjQQ0C/PvmzB6SGdtniZ3hy2OeCQ9WDf2qlFEb9lHikGJcgp7vvI1wZxX4PcJWQ/

As you can see only the first 2 digits are being kept.

Does anyone have a solution to why this suddenly changed?

  • 写回答

1条回答 默认 最新

  • douzheng9221 2013-08-18 00:06
    关注

    First of all, there is no purpose for using a randomized number of rounds. This adds no additional security.

    Secondly, it sounds like you are using this to validate passwords of users logging into your site. If that is what you are doing, then using a one way hash rather than encryption is the most secure way.

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

报告相同问题?

悬赏问题

  • ¥15 基于单片机的靶位控制系统
  • ¥15 AT89C51控制8位八段数码管显示时钟。
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错