Hashing - Digital Signing and Trivial Stretching
Response to Question 2 :

algorithm 1 : change the algorithm into this, it will be easier to explain

hash1 = sha512(password + salt1); 
hash2 = sha512(password + salt2); 
for (i = 0; i &lt; 1000; i++) {
    hash1 = sha512(hash1); // &lt;-- Do NOT do this!
    hash2 = sha512(hash2); // &lt;-- Do NOT do this!
}


For 2 different inputs hash1 and hash2, if there is a collision on iteration 10 then the next 990 iterations will crunch the very same work and output the same hash1 and hash2. 

The more you hash, the more intermediate collisions you could create at iteration 12, 15, 20, 100, 101, 314 .... Every additional iteration increase the probability of collision. 

if Bob run this code (half of the previous loop)

hash1 = sha512(password + salt1); 
for (i = 0; i &lt; 1000; i++) {
    hash1 = sha512(hash1); // &lt;-- Do NOT do this!
}


And if Alice run this code (half of the previous loop)

hash2 = sha512(password + salt2); 
for (i = 0; i &lt; 1000; i++) {
    hash2 = sha512(hash2); // &lt;-- Do NOT do this!
}


As of previous comment, security decreases, because Bob and Alice could impersonate each other because of the increased collision probability. When the algorithms complete

P(hash1 == hash2) &gt; 1000 * P(sha512(password + salt2) == sha512(password + salt1) )


If there are more than Bob And Alice, John, Joe, Jack and Jeremy are running this loop, then the probability of collision is still increased by devastating effects of the "birthday paradox".

algorithm 2: something is different on each iteration, that is the big difference.

hash1 = sha512(password + salt1);
hash2 = sha512(password + salt2);
for (i = 0; i &lt; 1000; i++) {
    hash1 = sha512(hash + password + salt1);
    hash2 = sha512(hash + password + salt2);
}


If there is a collision at iteration i, then the next iteration i+1 is more than likely to produce a non-collision. Every iteration has provably the very low collision probabilities of sha512 when provided with different input. Split the algorithm between Bob and Alice, when the algorithm completes

P(hash1 == hash2) == P( sha512(password + salt2) == sha512(password + salt1) )


Note : It is possible to have different values of salt at each iteration, as suggested by the referenced page.