Theorem:
Let
and
be two integers. Let
,
the greatest common divisor of
and
. We can find integers
and
and such that
Proof:
By reordering if necessary, we can assume
and
since,
if
or
,
the statement is trivial.
if
then
and
if we can prove it under this assumption then the general case follows, using
and/or
.
Let
be
the smallest integer such that there are integers
and
and
.
We need to show
is
a common divisor of
and
. If not, assume it does not divide
(
does
not divide
essentially the same argument) , we have
with
And so
On the other hand, If
is
a common divisor of
and
then
divides
. Since
So
is the greatest common divisor.
Again assume
,
if
divides
we are done since
.
If not
let
with
.
If
divides
,
it must also divide
,
so let
, and
Suppose
does
not divide
then
with
.
If
divides
,
as before, it also divides
and
hence
.
By back substitution
Suppose
does
not divide
then
with
and
so on. The process must terminiate in a finite number of steps.
Corrollary:
In the setting above, again assuming
we
can select
such that
Proof: Exercise.
A Convention:
Below, sometime our calculations will be in
and
sometimes in the integers
. Hopefully, use of the phases " In
"
and " In
"
will clarify where the computations are taking place
and the conclusions that can be draw:
Some Examples:
In
the
equation
is
uniquely solvable for
and
therefore, in
, we can also define the operation
.
If
then, in
, the solution to the equation
is
In
in general the equation
is
not solvable, however:
If
and
are
relatively prime, as Integers then there is a unique
with
In
just
solve
, in particular
In
let
Exercise:
We are assuming that, in
let
"
makes sense in terms of existance and, uniqueness,
why?
and
,
as Integers, then in
the equation
is
uniquely solvable
Affine Encryption: Choose
with
,
as Integers
Encryption -
Decryption -
Focusing on the letters of the alphabet
(A,B,....,Z) and looking at
with
Advantages: It is easy to compute and slightly better than
the Caesar Cyper in that there are
choices for
and
choices
for
(not
or
).
That
is
possible codes.
Disadvantages: It is just a Substitution
Cypher!
Plan B: Encode the entire
character ASCII table, and look at
with
you would want to do this anyway. Still easy to compute and now there are
approximately
possible
codes. A bit harder but still subject to frequency analysis attacks.
Plan C: Use Affine Encryption to encode data in 4 byte
blocks say, using
You
could encode text 4 characters at a time.
Theorem: Suppose
are
pairwise relatively prime positive integers,
and
Suppose
are
integers. Then the system of simultaneous equations
has a unique solution
,
where
Proof: Let
and
, this is well defined
since
Exercise 1: Show
is a solution and is unique
Exercise 2:
Let
,
,
,
solve the simultaneous equations: