Cycle walking
In cryptography, cycle walking is a method for constructing a cipher on a finite message space, such as the integers from 0 to , from a block cipher whose domain is larger. A message is enciphered by repeatedly applying the block cipher, starting at the message, until one gets back to a point in the message space. The method works well if the message space is "dense" in the domain of the block cipher.[1] It is a common solution for format-preserving encryption and building permutations of a domain.[2]
The construction was analyzed under the name "cycle-walking cipher" by John Black and Phillip Rogaway in 2001.[3] They noted that the Hasty Pudding cipher of Richard Schroeppel and Hilarie Orman already used essentially the same method, internally iterating the cipher until a proper domain point is reached.[4]
Method
[edit]Fix an integer and let be the set . Let be the smallest power of 2 larger than or equal to , let , and let be an -bit block cipher under the key . The cycle-walking cipher on the set is constructed by computing and iterating if . The enciphering and deciphering algorithms are:[3]
The permutation can be viewed as a family of cycles: any point lies on some cycle, and repeated applications of can be viewed as a particle walking along the cycle, starting at . To encipher any point , walk along the cycle containing until some point is encountered. Then . This assumes that one can efficiently test for membership in . This is trivial when , but might not be for other sets.[3]
The map is well defined: given any point , if is applied enough times, a point in is reached, because walking on 's cycle must eventually arrive back at some point in , even if that point is itself. It is also invertible, since inverting is equivalent to walking backwards on 's cycle until finding some element in . Therefore is a permutation on .[3]
Though the method is described for the domain , it works in other domains too. For example, to encipher in the multiplicative group , where is a 1024-bit product of two primes, one can use cycle walking, iterating in the highly unlikely event that a point is in but not in .[5]
Example
[edit]Let . Then and so . Some known method is used to build a 20-bit block cipher on the set . Suppose the point is to be enciphered. Compute , which yields some number in , say 1040401. Since , iterate by computing , which is, say, 1729. Since , output 1729 as . Decipherment is simply the reverse of this procedure.[3]
Security
[edit]Black and Rogaway's security goal is described by two games. In the first game one chooses a random key and hands an adversary an oracle for . In the second game one chooses a random permutation on and hands the adversary an oracle for . The adversary should be unable to distinguish these two types of oracle without spending a huge amount of time, even though the domain is so small that the adversary might well ask for the value of the oracle at every point.[1] This is the notion of a pseudorandom permutation, adapted to finite message spaces.[4]
The question arises of how much security is lost in deriving the permutation . Black and Rogaway's answer is "nothing". They prove the following theorem. Fix and let . Let be an ideal block cipher on the set , where . Choose a key uniformly at random and construct using . Then is a uniform random permutation on .[3] The proof fixes a permutation on and shows that an equal number of keys give rise to . The construction thus retains all of the security of the underlying block cipher.[6]
The theorem is an information-theoretic result. Passing to the corresponding complexity-theoretic result is standard. Because no security is lost in the information-theoretic setting, and because is applied an expected two times or fewer, an adversary's maximal advantage in distinguishing from a random permutation of in expected time approximately upper-bounds an adversary's maximal advantage in distinguishing from a random permutation on in time .[6]
Efficiency
[edit]Black and Rogaway describe the cycle-walking cipher as "quite practical". If is just smaller than some power of 2, the number of points to walk through during any given encipherment is correspondingly small. In the worst case, however, is one larger than a power of 2, and with extremely bad luck about calls to the underlying block cipher might be needed to encipher just one point. But if the underlying block cipher is good, an expected two calls to it are needed to encipher and decipher any point, even in the worst case.[5]
See also
[edit]References
[edit]- 1 2 Black & Rogaway 2001, p. 1.
- ↑ Miracle & Yilek 2017, §1.
- 1 2 3 4 5 6 Black & Rogaway 2001, p. 5.
- 1 2 Black & Rogaway 2001, p. 3.
- 1 2 Black & Rogaway 2001, p. 8.
- 1 2 Black & Rogaway 2001, p. 6.
Sources
[edit]- Black, John; Rogaway, Phillip (12 February 2001). "Ciphers with Arbitrary Finite Domains". Cryptology ePrint Archive (2001/012).
- Miracle, Sarah; Yilek, Scott (2017). "Cycle Slicer: An Algorithm for Building Permutations on Special Domains". Advances in Cryptology – ASIACRYPT 2017. Lecture Notes in Computer Science. Vol. 10626. Springer. pp. 392–416. doi:10.1007/978-3-319-70700-6_14.
This article incorporates text by John Black and Phillip Rogaway available under the CC BY 4.0 license. The source's description, example and analysis have been condensed and reused, with light changes of wording.