> Amazing. > > Thanks for sharing that. It's a great example. :-) You're very welcome! If it helps just one other developer avoid the same pitfall, then today is a very good day. :-) > Exactly, and this is why it's a good practice to use a seed when you > generate MD5s for passwords. Which is exactly what I suggested, and what they ended up implementing, thanks to the fact that I could provide them with the original plaintext PIN values for the existing records. Still, once I'd had a chance to look at the plaintext PINs, it was depressing to notice the frequency of 'easy' PIN values, such as '1111', '1234', '9999' etc. Even with a seed, those values would have been relatively easy to guess at with frequency analysis, and it goes beyond my meager hostile decryption skills to guess at whether that made deriving the seed any easier or not. I suggested implementing a class that randomly selected from somewhere between 5 to 10 possible seed values when hashing the PIN for storage, which would have meant simply using all 5 or 10 seeds when comparing the PIN for subsequent validation, to reduce the frequency of hash-to-easy-PIN repetition, but it hadn't been implemented by the time my consultancy ended and I'd be willing to bet a year's pay it, or any other method of providing some sort of buffering against frequency analysis, hasn't been since. Of course, there's a whole conversation to be had regarding the fact that if your db server has been compromised to the point where the contents of tables are exposed, then it's reasonable to at least speculate (depending on your server setup and method by which it was accessed) that perhaps your entire app has been compromised, and your seed values may now be known to the hostile entity as well. Still and all, there's absolutely no reason to make the job of compromising your data any easier on a hypothetical hacker than is within your level of competency as a developer. Adding a seed value to md5 hashes is a simple and effective method under most circumstances that even beginner to intermediate developers can employ. In other words, It Is A Very Good Thing. ;-) Regards, Murray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php