Results 1 to 4 of 4

Thread: Recommended strategy for password-encoding?

  1. #1
    Join Date
    Jan 2008
    Posts
    248

    Default Recommended strategy for password-encoding?

    Given the frequent break-ins and some of the messages stating how md5 has been hacked, what is the recommended way for configuring password-encoding in Spring Security?

    Also, if you already have password-encoding set up with spring security, how would you migrate encoded password to a new strategy should you choose one?

    Marc

  2. #2
    Join Date
    Jan 2008
    Posts
    1,826

    Default

    Look into using SHA-256 which can be done using StandardPasswordEncoder.

    You cannot really migrate a users password since the hash is one way. However, you do a gradual migration as such. When a user successfully logs in you temporarily have the password. So once you verify the password, you could update the password using the new hashing algorithm (i.e. if valid rehash with new strategy). You would then need to specify which passwords had been migrated and which had not. You could do this by prefixing the password with the hash that was used (similar to how ldap does it).
    Rob Winch - @rob_winch
    Spring Security Lead
    Pivotal

  3. #3
    Join Date
    Jan 2008
    Posts
    248

    Default

    Thanks, that's useful info! Any info on the "default". Is it considered "safe" enough?

  4. #4

    Default

    Yes the default is going to be good enough. It does all your standard stuff, salting the password, iterating a hash hundreds time, all that good stuff. When starting out fresh with an app I tend to use a bcrypt hashing scheme, but in reality the if you have a hole in the security of your web app, I would wager every time that it won't be because of a broken hash scheme, it's going to be due to something else.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •