Read a modular inverse from a Bezout coefficient. This is toy arithmetic only, not deployable security.

Example

Read a modular inverse from a Bezout coefficient.

highlighted = computed this step

Step 1 — Set up

Set up the exact toy cryptography values.

a, m(3, 40)\begin{array}{c|c}\text{a, m}&\text{(3, 40)}\end{array}

Step 2 — Coefficient

Compute the highlighted cryptography value.

coefficient of a-13\begin{array}{c|c}\text{coefficient of a}&\hlmath{\text{-13}}\end{array}

Step 3 — Reduce

Compute the highlighted cryptography value.

coefficient mod m27\begin{array}{c|c}\text{coefficient mod m}&\hlmath{\text{27}}\end{array}
cryptography The values in this lesson are deliberately tiny so every modular arithmetic step can be checked exactly.