We propose here interactive versions for some of the exercises present in the book relying on Sage, a free open-source mathematics software system which combines the power of many existing open-source packages into a common Python-based interface.

In particular, Sage offers a free and competitive open source alternative to Magma, Maple, Mathematica and Matlab.

You’ll find in the table below source code for Sage that you might want to use either on your local installation, or on the public Sage server

DescriptionSource CodeSage Worksheet
1.3 - Caesar encryption 1.3
1.7 - Conditional probabilities 1.7
1.14 - Extended Euclidean Algorithm 1.14
1.15 - Modular computations 1.15
1.27 - Variable change for elliptic curves 1.27
1.42 - Attack on linear congruential generators 1.42
2.16 - DCT matrix 2.16
3.14 - Diffie-Hellman key exchange 3.14
3.16 - RSA encryption 3.16
4.6 - ISBN code of the book 4.6
4.43 - Interleaving 4.43