Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase password security #1

Open
spieker opened this issue Apr 27, 2015 · 1 comment
Open

Increase password security #1

spieker opened this issue Apr 27, 2015 · 1 comment

Comments

@spieker
Copy link
Owner

spieker commented Apr 27, 2015

https://github.com/spieker/pink1/blob/master/app/models/user.rb#L19

Default rounds are 5000, I should increase it!

http://blog.codinghorror.com/your-password-is-too-damn-short/

Example: UnixCrypt::SHA512.build('Some secret password', nil, 86000)

@spieker
Copy link
Owner Author

spieker commented Apr 27, 2015

In order to prevent DoS, we should limit the maximum password length to 100.

puts Benchmark.measure { p = 'x'*6; 100.times { UnixCrypt::SHA512.build(p, nil, 86000) } }
# 37.130000   0.000000  37.130000 ( 37.156434)

puts Benchmark.measure { p = 'x'*100; 100.times { UnixCrypt::SHA512.build(p, nil, 86000) } }
55.580000   0.000000  55.580000 ( 55.613038)

This was run on a small Droplet at DigitalOcean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant