# Evaluate hash function [closed]

I am trying to figure out how to evaluate the security of a hash function. If I have defined a candidate hash function: $$H(x) = α^x\text{ mod }p$$ how do I then evaluate it with respect to collision attacks, second preimage attacks, and preimage attacks? Hope someone can help

• Welcome to Cryptography.SE. Does the domain is restricted? What did you try up to now? Can you find $x$ and $y$ such that $a^x = x^y$ easily? Hint: Little Fermat! May 19, 2021 at 10:57
• Note that a hash is a particular kind of one-way function, optimized for computational applications. I assume you're trying to construct and evaluate OWFs in the general case? May 20, 2021 at 17:21
• I’m voting to close this question because a full description of how to analyze a hash function that is not secure is not needed. Please have a look at the SHA-3 competition to see what you're up against. Jun 1, 2021 at 22:12

If $$x=y \mod \phi(p)$$, then $$H(x)= H(y)$$. Then it doesn't seem collision resistant. For the same reason not second preimage attacks. $$H(x + \phi(p))= H(y)$$. (If $$p$$ is prime $$\phi(p)=p-1$$, thus it's easy to compute it).
About the preimage attack, it's completely equivalent to discrete logarithm in $$\mathbb{Z}^{\star}_p$$, then you have to be carrefull about the choice of $$p$$ (basically $$p-1$$ should have a huge factor).