<s>
The	O
trifid	B-Algorithm
cipher	I-Algorithm
is	O
a	O
classical	B-Algorithm
cipher	I-Algorithm
invented	O
by	O
Félix	O
Delastelle	O
and	O
described	O
in	O
1902	O
.	O
</s>
<s>
Extending	O
the	O
principles	O
of	O
Delastelle	O
's	O
earlier	O
bifid	B-Algorithm
cipher	I-Algorithm
,	O
it	O
combines	O
the	O
techniques	O
of	O
fractionation	O
and	O
transposition	B-Algorithm
to	O
achieve	O
a	O
certain	O
amount	O
of	O
confusion	O
and	O
diffusion	O
:	O
each	O
letter	O
of	O
the	O
ciphertext	O
depends	O
on	O
three	O
letters	O
of	O
the	O
plaintext	O
and	O
up	O
to	O
three	O
letters	O
of	O
the	O
key	O
.	O
</s>
<s>
The	O
trifid	B-Algorithm
cipher	I-Algorithm
uses	O
a	O
table	O
to	O
fractionate	O
each	O
plaintext	O
letter	O
into	O
a	O
trigram	B-General_Concept
,	O
mixes	O
the	O
constituents	O
of	O
the	O
trigrams	B-General_Concept
,	O
and	O
then	O
applies	O
the	O
table	O
in	O
reverse	O
to	O
turn	O
these	O
mixed	O
trigrams	B-General_Concept
into	O
ciphertext	O
letters	O
.	O
</s>
<s>
Delastelle	O
notes	O
that	O
the	O
most	O
practical	O
system	O
uses	O
three	O
symbols	O
for	O
the	O
trigrams:In	O
order	O
to	O
split	O
letters	O
into	O
three	O
parts	O
,	O
it	O
is	O
necessary	O
to	O
represent	O
them	O
by	O
a	O
group	O
of	O
three	O
signs	O
or	O
numbers	O
.	O
</s>
<s>
Knowing	O
that	O
n	O
objects	O
,	O
combined	O
in	O
trigrams	B-General_Concept
in	O
all	O
possible	O
ways	O
,	O
give	O
n	O
×	O
n	O
×	O
n	O
=	O
n3	O
,	O
we	O
recognize	O
that	O
three	O
is	O
the	O
only	O
value	O
for	O
n	O
;	O
two	O
would	O
only	O
give	O
23	O
=	O
8	O
trigrams	B-General_Concept
,	O
while	O
four	O
would	O
give	O
43	O
=	O
64	O
,	O
but	O
three	O
give	O
33	O
=	O
27	O
.	O
</s>
<s>
To	O
each	O
letter	O
in	O
the	O
mixed	O
alphabet	O
we	O
assign	O
one	O
of	O
the	O
27	O
trigrams	B-General_Concept
(	O
111	O
,	O
112	O
,	O
…,	O
333	O
)	O
by	O
populating	O
a	O
3	O
×	O
3	O
×	O
3	O
cube	O
with	O
the	O
letters	O
of	O
the	O
mixed	O
alphabet	O
,	O
and	O
using	O
the	O
Cartesian	O
coordinates	O
of	O
each	O
letter	O
as	O
the	O
corresponding	O
trigram	B-General_Concept
.	O
</s>
<s>
From	O
this	O
cube	O
we	O
build	O
tables	O
for	O
enciphering	O
letters	O
as	O
trigrams	B-General_Concept
and	O
deciphering	O
trigrams	B-General_Concept
as	O
letters	O
:	O
</s>
<s>
He	O
describes	O
the	O
encryption	O
step	O
as	O
follows:We	O
start	O
by	O
writing	O
vertically	O
under	O
each	O
letter	O
,	O
the	O
numerical	O
trigram	B-General_Concept
that	O
corresponds	O
to	O
it	O
in	O
the	O
enciphering	O
alphabet	O
:	O
then	O
proceeding	O
horizontally	O
as	O
if	O
the	O
numbers	O
were	O
written	O
on	O
a	O
single	O
line	O
,	O
we	O
take	O
groups	O
of	O
three	O
numbers	O
,	O
look	O
them	O
up	O
in	O
the	O
deciphering	O
alphabet	O
,	O
and	O
write	O
the	O
result	O
under	O
each	O
column	O
.	O
</s>
<s>
In	O
this	O
table	O
the	O
periods	O
delimit	O
the	O
trigrams	B-General_Concept
as	O
they	O
are	O
read	O
horizontally	O
in	O
each	O
group	O
,	O
thus	O
in	O
the	O
first	O
group	O
we	O
have	O
111	O
=	O
F	O
,	O
123	O
=	O
M	O
,	O
231	O
=	O
J	O
,	O
and	O
so	O
on	O
.	O
</s>
