1,572 reputation
1613
bio website martinstoeckli.ch
location Switzerland
age 42
visits member for 2 years, 9 months
seen Dec 23 at 10:11

I belong to the lucky people, who can combine job and hobby, in my case writing software. Coming from the Delphi world, i'm working now mostly with CSharp and use PHP for my spare time project, an internet lost-and-found office.

// Don't tell people that they do wrong, explain the reasons and let them think for themselves.


Oct
15
comment comparing password hashing algorithms - PoC ideas?
The number of hashes calculated by oclHashcat with common hardware are very convincing. For plain SHA-256 this is more than 1 Giga hashes per second, compared with an english dictionary containing about 150000 words... well that makes a fraction of a millisecond.
Oct
11
comment Does using Bcrypt to encrypt credit card numbers satisfy PCI compliance?
@jpkrohling - You should think of the salt as a known value, it is not a secret. It will not make it harder to brute-force a single value, but can prevent an attacker to build a rainbow-table to get all numbers at once.
Oct
10
comment Does using Bcrypt to encrypt credit card numbers satisfy PCI compliance?
Usually if you have need to store a credit card number, you want to be able to decrypt it later, so you can use it again for payment. What reason do you have to store only a hash of the number, which is a one-way function and cannot be decrypted?
Sep
27
revised Secure authentication: partial client-side key stretching… please review/criticize my idea
deleted 5 characters in body
Sep
27
answered Secure authentication: partial client-side key stretching… please review/criticize my idea
Sep
4
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - You use a slow hash like BCrypt and a pepper, exactly for the case a hacker gets access to your database or server. If the hash function is slow, an attacker can calculate e.g. only 1 hash instead of 8 Giga hashes. The pepper requires the attacker to have privileges on the server, what is more difficult than just having read access to the database.
Sep
4
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - I updated my answer accordingly.
Sep
4
revised Do salts have to be random, or just unique and unknown?
To answer the updated question.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@demize - Well that's the actual question, does it really introduce a new attack vector and how? The userid would make the salt unique, the domainname would make it globally unique, and the password would make it unpredictable. It is possible to regenerate it, and when the password changes, it would result in a different salt.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@Griffin - There would be no need to store the plain text password, because when you verify the password all necessary information is available, the userid, the constant text and the just entered password.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@Griffin - I think the OP's question actually is: "Can storing a salt be avoided completely, derriving the salt from userid, constant text, and the password itself".
Sep
1
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - You cannot rehash the password when updating the email address. To create the new password-hash you need the email and the original password, but at this moment you know only the email and the hash of the original password.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - Ok i understand now, you don't want to store the salt at all, and therefore want to derrive the salt completely from other parameters. There is one problem though, it will make it impossible to change the parameters afterwards. When the user wants to update the email and you used it as salt, you cannot recalculate the password-hash with the new email, because you do not know the original password then. You would have to store the old email as well, what makes it no better than storing a salt.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - You already answered it well. The hash is used to make it impossible to retrieve the original password, so storing the password as salt in a retrievable form will undo the whole effort (you need it for verification). If you want to add a server side secret, a good method is, to encrypt the password-hash with a server side key, or to use a pepper. But don't mix up the two, let the salt be known (plaintext) and the server-side key be a secret.
Sep
1
comment Do salts have to be random, or just unique and unknown?
Calling a hash like sha-256 will not generate any entrophy at all. The number of possible inputs will fix the number of possible hash-values.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - To double the password would help nothing at all, this would be just another hash algorithm. It would not even add a server side secret (the algorithm), since the salt is normally stored plaintext. You could then build 1 rainbowtable to recover all passwords of your database.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@MisterMelancholy - It doesn't matter, whether a user has the same id on another site, a rainbow-table with those salts would contain "all" passwords with all of the choosen salts, thus working for every site. About the email, you cannot presume that the emails are hidden from the public, hashes are made or the case, when the database is already stolen, so the email addresses will be known as well. Using the email as salt, maybe combined with other data and hashed, is not the worst thing you can do, but using a random independend salt is always better.
Sep
1
comment Do salts have to be random, or just unique and unknown?
@IlmariKaronen - Just wrote a bit more clear what i meant (about the middle part), probably you didn't notice the edit. And of course key-stretching is a must today.
Sep
1
revised Do salts have to be random, or just unique and unknown?
deleted 107 characters in body
Sep
1
revised Do salts have to be random, or just unique and unknown?
added 5 characters in body