Kunerth's algorithm
Appearance
Adolf Kunerth's 1878 Modular Square Root Algorithm is detailed at [1][2]. A monograph on the Kindle also explains the algorithm and provides seven examples of it working[3]
The algorithm is notable since it doesn't require the factorization of the modulus, and only has one modular operation that is often easy if the cipher is a prime.
To find
do the following steps
- 1) find the modular square root of This step is quite easy, no matter how big the original modulus is if is a prime.
- 2) solve a quadratic equation associated with the modular square root of . Most of Kunerth's examples in his original paper solve this equation by having C be a natural square and thus setting z to zero.
- Expand out the following equation to obtain the quadratic
- if then
- ((B* z + r)^2 + N)/B==w^{2}</math>
- if then
- 3) Having solved the associated quadratic equation we now have the variables w and set v=r (if C in the quadratic is a natural square).
- 4) Solve for two more variables, alpha and beta by the following equation
- alpha == w (v + w beta )
- Please note that this is not a modular operation and that alpha and beta could have many paired answers.
- 5) Obtain a value for X via a factorization of the following polynomial.
- obtaining an answer like
- (-37 + 9 x) (1 + 25 x)
- 6) Obtain the modular square root by the equation. Remember to set X so that the term above is zero. Thus X would be 37/9 or -1/25.
The hard step is the solving of the quadratic equation, but if this can be done then the algorithm quickly finds the modular square root without much computation.
An Example
To obtain
first obtain
Then expand out the following polynomial
which is
Since, in this case the C term in the quadratic is a natural square then
- Set and (If z had a value then set )
- Solve for alpha and beta in the following equation involving W and V
- alpha == W (V + W* beta)
- getting the answer alpha=15 and beta = -2. (There may be many paired answers to this equation)
- Then factor the following polynomial
- obtaining
- Then obtain the modular square root via
- Verify that
In the case that has no answer then can be used instead.
- ^ Adolf Kunerth, "Academie Der Wissenschaften" vol 78(2), 1878, p 327-338(for quadratic equation algorithm), p 338-346 (for modular quadratic algorithm), available at Ernest Mayr Library, Harvard University
- ^ Leonard Eugene Dickson, "History of Numbers", vol 2, p382-384
- ^ Paul Cheffers "Adolf Kunerth's Modular Square Root Algorithm Explained: with Examples in Mathematica" a monograph on the Kindle available at the amazon website