The first problem is called <i>collision resistance</i>.  The second is called <i>second pre-image resistance</i>.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Cryptographic_hash_function#Properties" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Cryptographic_hash_function#Pr...</a>