# Pseudo random permutation for arbitrary size domains

Popular block ciphers like AES or Twofish are keyed pseudo random permutations on the domain $\{0,1,\dots,2^{k}-1\}$ with $k\in\{128,192,256\}$ or similar.

I'm interested in pseudo random permutations on domains whose size is not a power of two: Are there any fast (in the ballpark of AES) keyed pseudo random permutations that operate on $\{0,1,\dots,n\}$ with $n\in\mathbb{N}$ being an adjustable parameter?

• What you search is format-preserving encryption. It is generally slower than AES, though. Feb 11, 2014 at 22:25
• @PaŭloEbermann using FPE with AES-NI is comparable speeds with AES-NI. Feistel networks with 10 or so rounds with AES-NI hardly slows it down . Feb 12, 2014 at 6:38

Ciphers with Arbitrary Finite Domains by Black and Rogaway have some options like Prefix Ciphers, Generalized Feistel networks , Cycle walking etc.

Also Format preserving encryption has traits that you are looking for , but NIST standardized ones are patented by Voltage Inc.

In general Feistel networks + Cycle walking would give a good option for any arbitrary length (even or odd) domains .

This question has much better answer Is there a length-preserving encryption scheme?

• If I may extend the question of the OP the paper you cited states that their methods aren't suitable when the domain $X$ is such that $2^{30}<|X|<2^{60}$ and presents that gap as a open problem. Are you aware of subsequent research that solved ? Feb 13, 2014 at 22:43
• my last suggestion of , Feistel Networks + Cycle walking should help . please "PRP Luby Rack off revisited" by Naor and Reingold . Feb 13, 2014 at 23:49
• @AlexandreYamajako : $\:$ Perfect Block Ciphers With Small Blocks works in that gap. $\hspace{1.36 in}$
– user991
Feb 14, 2014 at 20:31