HOME

TheInfoList



OR:

Bach's algorithm is a probabilistic
polynomial time In theoretical computer science, the time complexity is the computational complexity that describes the amount of computer time it takes to run an algorithm. Time complexity is commonly estimated by counting the number of elementary operations p ...
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
for generating random numbers along with their
factorization In mathematics, factorization (or factorisation, see American and British English spelling differences#-ise, -ize (-isation, -ization), English spelling differences) or factoring consists of writing a number or another mathematical object as a p ...
s. 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. The algorithm performs, in expectation,
primality tests A primality test is an algorithm for determining whether an input number is prime number, prime. Among other fields of mathematics, it is used for cryptography. Unlike integer factorization, primality tests do not generally give prime factors, only ...
. A simpler but less-efficient algorithm (performing, in expectation, primality tests), is due to Adam Kalai. Bach's algorithm may be used as part of certain methods for
key generation Key generation is the process of generating keys in cryptography. A key is used to encrypt and decrypt whatever data is being encrypted/decrypted. A device or program used to generate keys is called a key generator or keygen. Generation in crypt ...
in cryptography.


Overview

Bach's algorithm produces a number x uniformly at random in the range N/2 < x \le N (for a given input N), along with its factorization. It does this by picking a
prime number A prime number (or a prime) is a natural number greater than 1 that is not a Product (mathematics), product of two smaller natural numbers. A natural number greater than 1 that is not prime is called a composite number. For example, 5 is prime ...
p and an exponent a such that p^a \le N, according to a certain distribution. The algorithm then recursively generates a number y in the range M/2 < y \le M, where M = N/p^a, along with the factorization of y. It then sets x = p^y, and appends p^a to the factorization of y to produce the factorization of x. This gives x with logarithmic distribution over the desired range;
rejection sampling In numerical analysis and computational statistics, rejection sampling is a basic technique used to generate observations from a distribution. It is also commonly called the acceptance-rejection method or "accept-reject algorithm" and is a type o ...
is then used to get a uniform distribution.


References


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 onlin
here
Cryptographic algorithms Random number generation {{algorithm-stub