2
$\begingroup$

I need an efficient, invertible random permutation of $n$-bit strings, defined by a $128$-bit key. $n$ can be any positive integer from $6$ to $128$. I have no requirements on the security of the permutation; only that it is random (i.e. that outputs for different keys are uncorrelated).


Many standard algorithms exist for $n$ of $32$, $64$, and $128$ bits. I wondered if the Sponge Construction of Keccak could be used to transform such permutations into $n$-bit permutations. I understand the sponge construction generates a function of variable input length and arbitrary output length. However, it is not clear that if I use it to generate a function to turn one $n$-bit string into another $n$-bit string, that that function will encode a random permutation. Does it?

$\endgroup$
  • 1
    $\begingroup$ See "Format Preserving Encryption" for standard ways of doing precisely what you're looking for $\endgroup$ – poncho Jan 17 at 21:44
  • 1
    $\begingroup$ Please consider answering your own question if you have found the answer $\endgroup$ – AleksanderRas Jan 18 at 8:48
1
$\begingroup$

Format Preserving Encryption is the name for a standard way of doing what you are asking. It does a keyed mapping from a (potentially small) domain to itself. It does more than you are asking (it tries to be secure; you specified that you didn't need that), however there should not be an issue with this.

You have already found it yourself, however if you were to ask me which FPE primitive to use, I would have suggested FF1.

(I'm putting this as an answer so you can accept it)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.