This question already has an answer here:
While reading some text on cryptography, I found that algorithm $A$, that the adversary (called Eve by convention) runs to break the cipher message, needs two parameters, candidate message ($y$) and length of message ($k$).
Now, this $k$ is being supplied in unary.
The reasons for that are being put forth in one text like this:
Technically, we will have to explicitly supply $k$ as part of the input. However, instead of giving them $k$ in binary, which is only log $k$ bits long, we will give $k$ in unary, which is indeed $k$ bits long. This is done to ensure that all our algorithms — which are polynomial in their input length — are allowed to run in time polynomial in the security parameter $k$. Thus, providing $k$ in unary is a convenient way to ensure that polynomial in $k$ time is allowed.
I understand above text, more or less. We need to ensure that all the inputs are $k$ length. So, the algorithm will run in polynomial time $k$. But my point is, why would the adversary bother? Is it not more convenient for Eve, if the input is shorter? (Sorry, if I misunderstood this.)
Another text mentions the same reasons as:
The main reason for this convention is to rule out the possibility that a function will be considered one-way merely because it drastically shrinks its input, and so the inverting algorithm just does not have enough time to print the desired output (i.e., the corresponding pre-image). (There some more text on log of input length.)
In addition to the previous queries, I fail to understand the point of `printing'.
Please explain the point, why input $k$ needs to be in unary?