<s>
The	O
affine	B-Algorithm
cipher	I-Algorithm
is	O
a	O
type	O
of	O
monoalphabetic	O
substitution	O
cipher	O
,	O
where	O
each	O
letter	O
in	O
an	O
alphabet	O
is	O
mapped	O
to	O
its	O
numeric	O
equivalent	O
,	O
encrypted	O
using	O
a	O
simple	O
mathematical	O
function	O
,	O
and	O
converted	O
back	O
to	O
a	O
letter	O
.	O
</s>
<s>
Since	O
the	O
affine	B-Algorithm
cipher	I-Algorithm
is	O
still	O
a	O
monoalphabetic	O
substitution	O
cipher	O
,	O
it	O
inherits	O
the	O
weaknesses	O
of	O
that	O
class	O
of	O
ciphers	O
.	O
</s>
<s>
The	O
Caesar	O
cipher	O
is	O
an	O
Affine	B-Algorithm
cipher	I-Algorithm
with	O
since	O
the	O
encrypting	O
function	O
simply	O
reduces	O
to	O
a	O
linear	O
shift	O
.	O
</s>
<s>
)	O
,	O
there	O
are	O
a	O
total	O
of	O
286	O
non-trivial	O
affine	B-Algorithm
ciphers	I-Algorithm
,	O
not	O
counting	O
the	O
26	O
trivial	O
Caesar	O
ciphers	O
.	O
</s>
<s>
The	O
cipher	O
's	O
primary	O
weakness	O
comes	O
from	O
the	O
fact	O
that	O
if	O
the	O
cryptanalyst	O
can	O
discover	O
(	O
by	O
means	O
of	O
frequency	O
analysis	O
,	O
brute	B-Algorithm
force	I-Algorithm
,	O
guessing	O
or	O
otherwise	O
)	O
the	O
plaintext	O
of	O
two	O
ciphertext	O
characters	O
then	O
the	O
key	O
can	O
be	O
obtained	O
by	O
solving	O
a	O
simultaneous	O
equation	O
.	O
</s>
<s>
The	O
same	O
type	O
of	O
transformation	O
used	O
in	O
affine	B-Algorithm
ciphers	I-Algorithm
is	O
used	O
in	O
linear	B-Algorithm
congruential	I-Algorithm
generators	I-Algorithm
,	O
a	O
type	O
of	O
pseudorandom	B-Algorithm
number	I-Algorithm
generator	I-Algorithm
.	O
</s>
<s>
This	O
generator	O
is	O
not	O
a	O
cryptographically	B-Algorithm
secure	I-Algorithm
pseudorandom	I-Algorithm
number	I-Algorithm
generator	I-Algorithm
for	O
the	O
same	O
reason	O
that	O
the	O
affine	B-Algorithm
cipher	I-Algorithm
is	O
not	O
secure	O
.	O
</s>
<s>
In	O
this	O
encrypting	O
example	O
,	O
the	O
plaintext	O
to	O
be	O
encrypted	O
is	O
"	O
AFFINE	B-Algorithm
CIPHER	I-Algorithm
"	O
using	O
the	O
table	O
mentioned	O
above	O
for	O
the	O
numeric	O
values	O
of	O
each	O
letter	O
,	O
taking	O
to	O
be	O
5	O
,	O
to	O
be	O
8	O
,	O
and	O
to	O
be	O
26	O
since	O
there	O
are	O
26	O
characters	O
in	O
the	O
alphabet	O
being	O
used	O
.	O
</s>
<s>
The	O
table	O
below	O
shows	O
the	O
completed	O
table	O
for	O
encrypting	O
a	O
message	O
in	O
the	O
Affine	B-Algorithm
cipher	I-Algorithm
.	O
</s>
<s>
The	O
following	O
Python	B-Language
code	I-Language
can	O
be	O
used	O
to	O
encrypt	O
text	O
with	O
the	O
affine	B-Algorithm
cipher	I-Algorithm
:	O
</s>
