<s>
In	O
classical	O
cryptography	O
,	O
the	O
running	B-Algorithm
key	I-Algorithm
cipher	I-Algorithm
is	O
a	O
type	O
of	O
polyalphabetic	B-Algorithm
substitution	I-Algorithm
cipher	I-Algorithm
in	O
which	O
a	O
text	O
,	O
typically	O
from	O
a	O
book	O
,	O
is	O
used	O
to	O
provide	O
a	O
very	O
long	O
keystream	B-Algorithm
.	O
</s>
<s>
The	O
text	O
used	O
is	O
The	O
C	O
Programming	O
Language	O
(	O
1978	O
edition	O
)	O
,	O
and	O
the	O
tabula	B-Algorithm
recta	I-Algorithm
is	O
the	O
tableau	O
.	O
</s>
<s>
Page	O
63	O
,	O
line	O
1	O
is	O
selected	O
as	O
the	O
running	B-Algorithm
key	I-Algorithm
:	O
</s>
<s>
The	O
running	B-Algorithm
key	I-Algorithm
is	O
then	O
written	O
under	O
the	O
plaintext	O
:	O
</s>
<s>
However	O
,	O
unlike	O
a	O
Vigenère	B-Algorithm
cipher	I-Algorithm
,	O
if	O
the	O
message	O
is	O
extended	O
,	O
the	O
key	O
is	O
not	O
repeated	O
;	O
the	O
key	O
text	O
itself	O
is	O
used	O
as	O
the	O
key	O
.	O
</s>
<s>
We	O
are	O
discovered	O
"	O
,	O
then	O
the	O
running	B-Algorithm
key	I-Algorithm
continues	O
as	O
before	O
:	O
</s>
<s>
To	O
determine	O
where	O
to	O
find	O
the	O
running	B-Algorithm
key	I-Algorithm
,	O
a	O
fake	O
block	O
of	O
five	O
ciphertext	O
characters	O
is	O
subsequently	O
added	O
,	O
with	O
three	O
denoting	O
the	O
page	O
number	O
,	O
and	O
two	O
the	O
line	O
number	O
,	O
using	O
A	O
=	O
0	O
,	O
B	O
=	O
1	O
etc	O
.	O
</s>
<s>
Modern	O
variants	O
of	O
the	O
running	B-Algorithm
key	I-Algorithm
cipher	I-Algorithm
often	O
replace	O
the	O
traditional	O
tabula	B-Algorithm
recta	I-Algorithm
with	O
bitwise	O
exclusive	O
or	O
,	O
operate	O
on	O
whole	O
bytes	B-Application
rather	O
than	O
alphabetic	O
letters	O
,	O
and	O
derive	O
their	O
running	B-Algorithm
keys	I-Algorithm
from	O
large	O
files	O
.	O
</s>
<s>
to	O
form	O
a	O
new	O
running	B-Algorithm
key	I-Algorithm
,	O
similarly	O
skip	O
rules	O
can	O
be	O
used	O
.	O
</s>
<s>
the	O
new	O
permuted	O
running	B-Algorithm
key	I-Algorithm
from	O
the	O
initial	O
key	O
text	O
.	O
</s>
<s>
via	O
public	B-Application
key	I-Application
encryption	I-Application
or	O
in	O
person	O
.	O
</s>
<s>
without	O
changing	O
the	O
running	B-Algorithm
key	I-Algorithm
book	O
.	O
)	O
</s>
<s>
(	O
at	O
least	O
)	O
one	O
of	O
each	O
for	O
every	O
ASCII	B-Protocol
character	I-Protocol
)	O
.	O
</s>
<s>
ASCII	B-Protocol
,	O
and	O
then	O
decrypting	O
the	O
characters	O
to	O
the	O
real	O
plaintext	O
using	O
the	O
running	B-Algorithm
key	I-Algorithm
.	O
</s>
<s>
The	O
"	O
Gromark	O
cipher	B-Application
"	O
(	O
"	O
Gronsfeld	O
cipher	B-Application
with	O
mixed	O
alphabet	O
and	O
running	B-Algorithm
key	I-Algorithm
"	O
)	O
uses	O
a	O
running	O
numerical	O
key	O
formed	O
by	O
adding	O
successive	O
pairs	O
of	O
digits	O
.	O
</s>
<s>
The	O
VIC	B-Algorithm
cipher	I-Algorithm
uses	O
a	O
similar	O
lagged	B-Algorithm
Fibonacci	I-Algorithm
generator	I-Algorithm
.	O
</s>
<s>
If	O
the	O
running	B-Algorithm
key	I-Algorithm
is	O
truly	O
random	O
,	O
never	O
reused	O
,	O
and	O
kept	O
secret	O
,	O
the	O
result	O
is	O
a	O
one-time	B-Algorithm
pad	I-Algorithm
,	O
a	O
method	O
that	O
provides	O
perfect	B-Algorithm
secrecy	I-Algorithm
(	O
reveals	O
no	O
information	O
about	O
the	O
plaintext	O
)	O
.	O
</s>
<s>
However	O
,	O
if	O
(	O
as	O
usual	O
)	O
the	O
running	B-Algorithm
key	I-Algorithm
is	O
a	O
block	O
of	O
text	O
in	O
a	O
natural	O
language	O
,	O
security	O
actually	O
becomes	O
fairly	O
poor	O
,	O
since	O
that	O
text	O
will	O
have	O
non-random	O
characteristics	O
which	O
can	O
be	O
used	O
to	O
aid	O
cryptanalysis	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
the	O
entropy	O
per	O
character	O
of	O
both	O
plaintext	O
and	O
running	B-Algorithm
key	I-Algorithm
is	O
low	O
,	O
and	O
the	O
combining	O
operation	O
is	O
easily	O
inverted	O
.	O
</s>
<s>
To	O
attack	O
the	O
cipher	B-Application
,	O
a	O
cryptanalyst	O
runs	O
guessed	O
probable	O
plaintexts	O
along	O
the	O
ciphertext	O
,	O
subtracting	O
them	O
out	O
from	O
each	O
possible	O
position	O
.	O
</s>
<s>
When	O
the	O
result	O
is	O
a	O
chunk	O
of	O
something	O
intelligible	O
,	O
there	O
is	O
a	O
high	O
probability	O
that	O
the	O
guessed	O
plain	O
text	O
is	O
correct	O
for	O
that	O
position	O
(	O
as	O
either	O
actual	O
plaintext	O
,	O
or	O
part	O
of	O
the	O
running	B-Algorithm
key	I-Algorithm
)	O
.	O
</s>
<s>
Eventually	O
it	O
is	O
likely	O
that	O
the	O
source	O
of	O
the	O
running	B-Algorithm
key	I-Algorithm
will	O
be	O
identified	O
,	O
and	O
the	O
jig	O
is	O
up	O
.	O
</s>
<s>
The	O
first	O
and	O
most	O
obvious	O
is	O
to	O
use	O
a	O
secret	O
mixed	O
alphabet	O
tableau	O
instead	O
of	O
a	O
tabula	B-Algorithm
recta	I-Algorithm
.	O
</s>
<s>
Pairs	O
of	O
plaintext	O
and	O
running	B-Algorithm
key	I-Algorithm
characters	O
are	O
far	O
more	O
likely	O
to	O
be	O
high	O
frequency	O
pairs	O
such	O
as	O
'	O
EE	O
 '	O
rather	O
than	O
,	O
say	O
,	O
'	O
QQ	O
 '	O
.	O
</s>
<s>
For	O
this	O
purpose	O
,	O
the	O
KGB	B-Application
advised	O
agents	O
to	O
use	O
documents	O
like	O
almanacs	O
and	O
trade	O
reports	O
,	O
which	O
often	O
contain	O
long	O
lists	O
of	O
random-looking	O
numbers	O
.	O
</s>
<s>
Because	O
both	O
ciphers	B-Application
classically	O
employed	O
novels	O
as	O
part	O
of	O
their	O
key	O
material	O
,	O
many	O
sources	O
confuse	O
the	O
book	B-Algorithm
cipher	I-Algorithm
and	O
the	O
running	B-Algorithm
key	I-Algorithm
cipher	I-Algorithm
.	O
</s>
<s>
The	O
running	B-Algorithm
key	I-Algorithm
cipher	I-Algorithm
is	O
a	O
polyalphabetic	B-Algorithm
substitution	I-Algorithm
,	O
the	O
book	B-Algorithm
cipher	I-Algorithm
is	O
a	O
homophonic	O
substitution	O
.	O
</s>
<s>
Perhaps	O
the	O
distinction	O
is	O
most	O
clearly	O
made	O
by	O
the	O
fact	O
that	O
a	O
running	O
cipher	B-Application
would	O
work	O
best	O
of	O
all	O
with	O
a	O
book	O
of	O
random	O
numbers	O
,	O
whereas	O
such	O
a	O
book	O
(	O
containing	O
no	O
text	O
)	O
would	O
be	O
useless	O
for	O
a	O
book	B-Algorithm
cipher	I-Algorithm
.	O
</s>
