2
$\begingroup$

I have two secret numbers $A$ and $B$. Both are uniformly-distributed 32-bit numbers.

I need a deterministic function $f(x)$ such that $f(A) = B$. $f(x)$ must not leak any information about $A$ or $B$.

Naively, what if $f(x) = x + C$, where $C = B - A$. What information is leaked, if any, in this case, and what would be a better $f(x)$?

$\endgroup$
3
  • $\begingroup$ How many times are you planning on invoking a given $ f(x) $ for different $ x $? Also, be aware that 32-bit numbers are typically small enough to brute-force, so the security here is not very substantial. $\endgroup$
    – bk2204
    Commented Dec 1, 2023 at 20:25
  • 2
    $\begingroup$ Does $f$ need to be pseudorandom? If you don't want "information to leak" then you have to be specific about what the adversary is allowed to do/see. Also note that you can "translate" any function $f$ into $f'(x) = f(x) + B - f(A)$ so that $f'(A)= B$. $\endgroup$
    – Mikero
    Commented Dec 1, 2023 at 20:43
  • $\begingroup$ Your naive example leaks at least $B-A$ by evaluating $f$ on $x=0$. $\endgroup$
    – lamontap
    Commented Dec 1, 2023 at 20:51

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.