jcoglan
Joined 17 years ago
Joined 17 years ago
Having either in a gem is rare, but sensible if the gem wants to include a client to interact with the service it provides.
Point being, although hash functions might work most of the time, their general construction does not make them safe for this purpose. You can't say something is 'mostly secure' because it works 'most of the time'. The times is doesn't work will affect someone, and for them the system is not secure at all.
Plus, implementations with weird edge cases make for horrible debugging, especially when it comes to security.
Better to have resistance as baked into your crypto as you can, rather than relying on a firewall further up the stack. If the data itself is resilient, no implementation will be able to defeat it efficiently.
This is just one of the easier ways. It's effective and easy to code.