How secure would it be if you applied custom algorithms (that you obviously wouldn't reveal to the public) to a hashed password? Like splitting up a hashed string, shuffling it around, possibly even do something else with it to further shuffle it. Then shuffle it back and compare the user's input to the original hash.

Then the next question, all of this shuffling is code, in a class, in a file. Can this not be reverse-engineered or somehow retrieved in some way?

  • 1
  • Everywhere i read "It's bad" , "Dont invent your own" , "Use algorithms that are proven to be solid", but what i am suggesting is using a known proven to be solid algorithm, and change the string that comes out of that in a custom algorithm. I think i also read people saying it won't matter. I'd like to understand that IF adding a custom algorithm on top of a solid one adds no extra security, why? Because i honestly don't understand – stefan Jun 5 at 11:10
  • You forgot to cite "Why is security through obscurity not a good option" - because this is the main point. If the security of your algorithm relies on having a specific secret implementation then it is bad. If you just add obscurity on top of something good then it is not a problem - see also Security BY obscurity is horrible. Is security AND obscurity good?. But while it looks from the comment that your intention was to ask the latter one, your actual question was not clear about this and thus got interpreted in a different way. – Steffen Ullrich Jun 5 at 11:27
  • @stefan Adding your own custom implementation on top of a known secure one could break the secure one. For example if you didn't know much about security you could hash your passwords using bcrypt and then decide to hash those hashes using MD5. You would think, hey I'm hashing it with BOTH bcrypt and MD5, it's doubly secure! But in reality you just made every single hash trivial to crack. And without a deep understanding of cryptography it can be hard to tell what could weaken security rather than strengthen it. – trallgorm Jun 5 at 14:19
  • 1
    @dandavis disregard what I said, I was actually completely wrong in my comment. After reading up on it it may reduce entropy but it will not be trivial to crack by any means. Thanks for the catch. – trallgorm Jun 6 at 20:48