alpertron logo

Dario Alpern's site Home Page
Ver sitio en castellano

 ELECTRONICS >> Intel Microprocessors (Spanish only)
 MATHEMATICS >> Calculators | Number Theory | Problems
 PROGRAMS >> Assembler 80386 (downloads) | Java | Games
 CONTACT >> Personal | Comments | Guestbook | Links | Donations

Discrete logarithm calculator

Get the source code!
You will also need the expression analyzer source code
and the ECM factorization source code

The discrete logarithm problem is to find the exponent in the expression BaseExponent = Power (mod Modulus).

This applet works for both prime and composite moduli. The only restriction is that the base and the modulus, and the power and the modulus must be relatively prime.

In this version of the discrete logarithm calculator only the Pohlig-Hellman algorithm is implemented, so the execution time is proportional to the square root of the largest prime factor of the modulus minus 1. The applet works in a reasonable amount of time if this factor is less than 1017.

I will add the index-calculus algorithm soon. This algorithm has subexponential running time.

You can also enter expressions that use the following operators and parentheses:

The pseudoprime tests used in functions B and N includes trial division by the 100 first primes and then up to 20 Rabin-Miller strong pseudoprime tests. So it has a very high probability to find a prime number.

The final value must have 1000 or less digits, intermediate results must have 2000 or less digits and in the case of divisions, the dividend must be multiple of the divisor.

If you find any error or if you have any comment please let me know by clicking here.