# Applying multiple hash functions to improve security? [duplicate]

I'm a total newb to cryptography but after reading what I've read about it, I had a simple idea and I wonder if it has any merit. What if you encrypted using a selection of hash algorithms applied sequentially instead of one, or multiple iterations of the same one? Which hash algorithms to apply and/or in what order could be chosen randomly and recorded in a salt which would be supplied along with any other salt. In fact it could increase complexity further by adding an additional random salt string in between each hash function. The authentication program would take the salt(s) and apply the same steps in the same order.

Like I said, I'm a complete beginner to crypto and maybe this is a crappy idea for one reason or another, or maybe it or something like it is already a known technique. At least naively it seems like it would be an easy way to make something tougher to crack.

• Look at crypto.stackexchange.com/q/959/706 and crypto.stackexchange.com/q/270/706. They somewhat related to your question. – mikeazo May 29 '12 at 11:33
• The question is ill-formulated. In particular, one does not encrypt with a hash function. However, the intuition is right: yes, security of cryptographic primitives can be improved by combining multiple ones, at the cost of performance and (sometime) size of hashes or/and keys (for algorithms with keys, which does not include hashes). In the case of hashes, this is discussed here and there. It also works for MACs and encryption. – fgrieu May 29 '12 at 15:34
• Multiple iterations of the same hash is often useful. However, Ha(Hb(Hc(Hd(message)))) is only as strong as the weakest in the chain. – Polynomial May 30 '12 at 8:38
• I've closed this for now as a duplicate of the other question, the discussion on there should help I hope :) If your question is different (and I'm just not seeing it), do feel free to edit/reply to me here and we can look at re-opening it. – user46 May 30 '12 at 8:49