Clarification of one-way property of hash functions

One-way property: computationally infeasible to find data mapping to specific hash

The definition above is a little vague, if we have h(x) = floor(log(x)), finding "some" x that gives a hash value is easy, however, deterministically finding the actual x value that has led to the output is impossible. Do such hash functions have the one-way property?

• The definition you quote is more than a little vague. You will find correct definitions in any good crypto textbook. – fkraiem Sep 17 '18 at 11:52
• You mean, Pre-image resistance : computationally infeasible to find the reverse image of a given hash value. – kelalaka Sep 17 '18 at 12:12

Your function is too easy. Given an hash value $h$, calculate $b^h$ and $b^{h+1}-1$, where b is the base of your logarithm.
Any value between $b^h$ and $b^{h+1}-1$ will be pre-image.
• Yes. Thus $x\to h(x)=\left\lfloor\log_b(x)\right\rfloor$ is not one way, because it is computationally feasible to find data mapping to a specific hash. The question's definition is correct, if a little imprecise. – fgrieu Sep 17 '18 at 12:19