Math Alive

Table Of Contents

Lab 1: Cryptography

Part I:
Binary addition

Parity addition

Difference between binary & parity addition

Private key application

Part II:
Modular arithmetic

Modular multiplication

Worksheet

Modular arithmetic and Fermat

Fermat's little theorem

RSA cryptography
Modular Arithmetic

RSA cryptography (named for its inventors Rivest, Shamir, and Adelman) exploits properties and interrelations of humongous numbers, constructed as large powers of huge numbers. Through a neat mathematical trick called modular arithmetic, the computer avoids working with the huge numbers themselves. Let's first learn about modular arithmetic before tackling RSA itself.

The number X (mod Y) is the remainder when X is divided by Y. ( Remember X (mod Y) stands for X modulo Y.)

For example: 7 modulo 3 is 1
because: 7 = 2 * 3 +1,
so when you divide 7 by 3,
you get a remander of 1.
The "modulo Y" terminology can also be used in the following way:

Z=X (mod Y)

( This stands for Z equals X modulo Y, which means that Z and X have the same remainder when divided by Y.)
For example: 7 = 25 (mod 3)
because: 7 = 2 * 3 + 1
25 = 8 * 3 + 1
Lab 1 title page | On to modular multiplication

Last modified: Tue Feb 2 16:03:38 EST 1999