密码拉伸 - 一种方法来减轻CPU的洪水 [英] Password stretching - a way to mitigate CPU flood

查看:175
本文介绍了密码拉伸 - 一种方法来减轻CPU的洪水的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在使用的密码,绵延在所有我的网站的所有用户帐户密码。在db我存储与最后的散列沿迭代计数和随机分配的盐。我使用SHA512作为哈希算法。我使用C#.NET 3.5中的的4.0(双架构库)这一点。

I'm now using password stretching for all user account passwords throughout all my websites. In the db I store an iteration count and randomly assigned salt along with the final hash. I'm using SHA512 as the hash algorithm. I'm using C# in .Net 3.5 and 4.0 (dual framework library) for this.

有关账户,只有不断得到随机分配的密码(之类的东西Web服务API用户等),我把迭代次数降低到一个范围,使得密码检查时间不超过1秒左右。多年来,根据这些网站是否不沾(!),我会看与CPU功率校准提高这些范围。

For accounts that only ever get randomly assigned passwords (things like web service API users etc) I keep the iteration count down to a range such that a password check takes no more than 1 second or so. Over the years, according to whether or not these websites stick(!), I will look at increasing these ranges in alignment with CPU power.

有关户口所在用户可能是选择自己的密码,我已经拍成了迭代次数等等,而迭代都进行了登录可以花费大约5秒钟。

For accounts where the user might be choosing the password themselves, I have cranked up the iteration count so a login can take around 5 seconds while the iterations are carried out.

所以我很高兴与我的密码的安全性; 但现在我有一个问题! - 我可以淹没100%使用8核CPU,持续5秒,如果我得到的8个不同的人来一次登录

So I'm happy with the security of my passwords; but now I have another problem - I can flood an 8 core cpu with 100% usage for 5 seconds if I get 8 different people to login at once!

我目前的解决办法是有一个迭代的阈值:如果拉伸操作超过这个,我推到由单个线程处理的队列。因此,它最多使用一半的计算机处理器可以进一步扩展这一点。

My current solution to this is to have an iteration threshold: If a stretch operation exceeds this, I push it on to a queue that is handled by a single thread. I could extend this further so that it uses at most half the processors in the machine.

有没有什么更好的我能做什么?你有没有实现这个模式的密码存储和登录 - ?你做了什么。

Is there anything better I can do? Have you implemented this pattern for password storage and logon - what did you do?

推荐答案

密码拉伸的想法是有攻击者做繁重的工作:

The idea of password stretching is to have the attacker do the heavy work:

当客户想登录,服务器提出了挑战。客户机执行的资源密集的计算和发送到服务器的响应。服务器应该能够确定响应是否与非常少的资源有效。

When a client wants to log in, the server presents a challenge. The client performs the resource-intensive calculations and sends a response to the server. The server should be able to determine whether the response is valid or not with very few resources.

由于它是在做重活客户端和客户端需要一个新的挑战对于每次尝试登录,暴力破解所有可能的密码组合变成(希望)也为攻击昂贵的。

Because it's the client that's doing the heavy work and the client requires a new challenge for each attempt to log in, brute-forcing all possible password combinations becomes (hopefully) too expensive for an attacker.

有一个看的盐渍挑战响应认证机制(SCRAM)

这篇关于密码拉伸 - 一种方法来减轻CPU的洪水的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆