Bach's algorithm
Bach's algorithm is a probabilistic polynomial time algorithm for generating random numbers along with their factorizations. It was published by Eric Bach in 1988. No algorithm is known that efficiently factors random numbers, so the straightforward method, namely generating a random number and then factoring it, is impractical.[1]
The algorithm performs, in expectation, O(log n) primality tests. A simpler, but less efficient algorithm (performing, in expectation, [math]\displaystyle{ O(\log^2 n) }[/math] primality tests), is due to Adam Kalai.[2][3]
Bach's algorithm may be used as part of certain methods for key generation in cryptography.[4]
Overview
Bach's algorithm produces a number [math]\displaystyle{ x }[/math] uniformly at random in the range [math]\displaystyle{ N/2 \lt x \le N }[/math] (for a given input [math]\displaystyle{ N }[/math]), along with its factorization. It does this by picking a prime number [math]\displaystyle{ p }[/math] and an exponent [math]\displaystyle{ a }[/math] such that [math]\displaystyle{ p^a \le N }[/math], according to a certain distribution. The algorithm then recursively generates a number [math]\displaystyle{ y }[/math] in the range [math]\displaystyle{ M/2 \lt y \le M }[/math], where [math]\displaystyle{ M = N/p^a }[/math], along with the factorization of [math]\displaystyle{ y }[/math]. It then sets [math]\displaystyle{ x = p^{a}y }[/math], and appends [math]\displaystyle{ p^a }[/math] to the factorization of [math]\displaystyle{ y }[/math] to produce the factorization of [math]\displaystyle{ x }[/math]. This gives [math]\displaystyle{ x }[/math] with logarithmic distribution over the desired range; rejection sampling is then used to get a uniform distribution.[1][5]
References
- ↑ 1.0 1.1 "How to generate factored random numbers". SIAM Journal on Computing 17 (2): 179–193. 1988. doi:10.1137/0217012.
- ↑ Kalai, Adam (2003). "Generating random factored numbers, easily". Journal of Cryptology 16 (4): 287–289. doi:10.1007/s00145-003-0051-5.
- ↑ Shoup, Victor (2008). A Computational Introduction to Number Theory and Algebra (Version 2 ed.). Cambridge, UK: Cambridge University Press. p. 305.
- ↑ Delfs, Hans; Knebl, Helmut (2015). Introduction to Cryptography: Principles and Applications (3rd ed.). Berlin: Springer Verlag. p. 226.
- ↑ Granville, Andrew; Granville, Jennifer (2019). "Constructing integers with the probabilistic model". Prime Suspects: The Anatomy of Integers and Permutations. Princeton University Press. pp. 207–208. ISBN 9780691188737. https://books.google.com/books?id=uPaKDwAAQBAJ&pg=PA207.
Further reading
- Bach, Eric. Analytic methods in the Analysis and Design of Number-Theoretic Algorithms, MIT Press, 1984. Chapter 2, "Generation of Random Factorizations", part of which is available online here.
Original source: https://en.wikipedia.org/wiki/Bach's algorithm.
Read more |