This page generates arbitrarily many random practice problems for you!
Warning: These are the most basic computational problems. These are good for making sure you have your basic arithmetic and algorithms down. But they don’t (and can’t) test conceptual understanding, and test problems may NOT resemble these.
Modular arithmetic.
This box will generate a random addition and multiplication problem.
This box will show the answers.
Modular Exponentiation
This box will generate a modular exponentiation problem to do by successive squaring (repeated squaring).
This box will show the answer, together with the binary expansion of the exponent and the successive squares.
Towers of Exponents
This box will generate a problem of the form a^(b^c) mod m, where the exponent is far too large to write out. Use Euler’s theorem (or the multiplicative order of a) to reduce the exponent first.
This box will show the answer and the steps.
Baby-Step Giant-Step
This box will generate a discrete logarithm problem with a 3-digit prime modulus, so the two lists are small enough to write down. You may want to use Sage to do the multiplications.
This box will show the answer, using baby steps g^j for 0 ≤ j < m and giant steps h*(g^(-m))^i for 0 ≤ i < m, where m = ceiling(sqrt(p-1)).
Index Calculus
This box will generate a discrete logarithm problem and do the tedious part for you: it finds random powers g^k whose least residues factor over the factor base, and a few random h*g^k that do too. Your job is to turn the relations into linear equations modulo p-1, solve for the discrete logs of the factor base primes, and then find x. (Depending on luck, the relations may not determine everything uniquely; run the box again for a fresh set.)
This box will show the discrete logarithms of the factor base primes, and the answer.
Diffie-Hellman Key Exchange
This box will provide you a key exchange question, with a modulus small enough to do the exponentiations by hand.
This box will show the answer.
Complex Numbers
Miller-Rabin Primality Testing
These are not designed to be easy by hand, because the first successive squaring part might be annoying; you can use Sage to do the modular arithmetic for you.
RSA Factoring
This box produces RSA moduli that are good for testing your factoring methods on.
The following box will output the answer.
Elliptic curve addition.
This box will generate a random elliptic curve point addition problem.
This box will show the answer.
Elliptic Curve Diffie-Hellman Key Exchange
This box will provide you a key exchange question.
This box will show the answer.
Elliptic Curve Factoring
This box will generate an example where an elliptic curve computation will help you factor a number. It will typically ask you to multiply a point by 3 or 6. Think about how to do this efficiently! (For 6, don’t just add the point to itself 5 times.)
The following box will output the answer.
Single Qubit States
This box will provide the answer.
Continued Fractions
Lattice Reduction in 2D