This is Jeroen Jacobs's TypePad Profile.
Join TypePad and start following Jeroen Jacobs's activity
Jeroen Jacobs
Recent Activity
Jeffrey: such a system already exists: smartcards
No need for storing passwords in a database anymore, and it's perfectly usable on the web in combination with SSL.
Speed Hashing
Hashes are a bit like fingerprints for data. A given hash uniquely represents a file, or any arbitrary collection of data. At least in theory. This is a 128-bit MD5 hash you're looking at above, so it can represent at most 2128 unique items, or 340 trillion trillion trillion. In reality the...
Sofa420: This looks like a waste of cpu cycles to me.
Salts have only one purpose: to make sure that the same password evaluates to a different hash. Therefore, it only secures against those famous dictionary-attacks (= rainbow tables).
The only thing that really matters for a salt, is that's unique.
In fact, your implementation might not be secure at all, if you also store that date in your database (as date/time of registration for example). This makes your salt predictable, and not really random, therefore defeating the purpose of a salt.
I think it's better to use a cryptographic number generator for this. Now if you are doing this in JavaScript, you don't really have one. Maybe you could use something like this (pseudocode) :
salt = hash(mouse_cursor_position+ screen_resolution + user_agent + ...)
a combination of this should be more random then taking the username and registration date as a salt. The extra hashing you do in your code, does nothing to prevent that.
Speed Hashing
Hashes are a bit like fingerprints for data. A given hash uniquely represents a file, or any arbitrary collection of data. At least in theory. This is a 128-bit MD5 hash you're looking at above, so it can represent at most 2128 unique items, or 340 trillion trillion trillion. In reality the...
Jeroen Jacobs is now following The Typepad Team
Apr 6, 2012
Subscribe to Jeroen Jacobs’s Recent Activity
