<s>
In	O
cryptography	O
,	O
SAFER	B-Algorithm
(	O
Secure	B-Algorithm
And	I-Algorithm
Fast	I-Algorithm
Encryption	I-Algorithm
Routine	I-Algorithm
)	O
is	O
the	O
name	O
of	O
a	O
family	O
of	O
block	O
ciphers	O
designed	O
primarily	O
by	O
James	O
Massey	O
(	O
one	O
of	O
the	O
designers	O
of	O
IDEA	B-Algorithm
)	O
on	O
behalf	O
of	O
Cylink	O
Corporation	O
.	O
</s>
<s>
The	O
early	O
SAFER	B-Algorithm
K	O
and	O
SAFER	B-Algorithm
SK	I-Algorithm
designs	O
share	O
the	O
same	O
encryption	O
function	O
,	O
but	O
differ	O
in	O
the	O
number	O
of	O
rounds	O
and	O
the	O
key	B-Algorithm
schedule	I-Algorithm
.	O
</s>
<s>
More	O
recent	O
versions	O
SAFER+	B-Algorithm
and	O
SAFER++	B-Algorithm
were	O
submitted	O
as	O
candidates	O
to	O
the	O
AES	O
process	O
and	O
the	O
NESSIE	O
project	O
respectively	O
.	O
</s>
<s>
All	O
of	O
the	O
algorithms	O
in	O
the	O
SAFER	B-Algorithm
family	O
are	O
unpatented	O
and	O
available	O
for	O
unrestricted	O
use	O
.	O
</s>
<s>
The	O
first	O
SAFER	B-Algorithm
cipher	O
was	O
SAFER	B-Algorithm
K-64	O
,	O
published	O
by	O
Massey	O
in	O
1993	O
,	O
with	O
a	O
64-bit	O
block	O
size	O
.	O
</s>
<s>
There	O
was	O
some	O
demand	O
for	O
a	O
version	O
with	O
a	O
larger	O
128-bit	O
key	O
,	O
and	O
the	O
following	O
year	O
Massey	O
published	O
such	O
a	O
variant	O
incorporating	O
new	O
key	B-Algorithm
schedule	I-Algorithm
designed	O
by	O
the	O
Singapore	O
Ministry	O
for	O
Home	O
affairs	O
:	O
SAFER	B-Algorithm
K-128	O
.	O
</s>
<s>
However	O
,	O
both	O
Lars	O
Knudsen	O
and	O
Sean	O
Murphy	O
found	O
minor	O
weaknesses	O
in	O
this	O
version	O
,	O
prompting	O
a	O
redesign	O
of	O
the	O
key	B-Algorithm
schedule	I-Algorithm
to	O
one	O
suggested	O
by	O
Knudsen	O
;	O
these	O
variants	O
were	O
named	O
SAFER	O
SK-64	O
and	O
SAFER	O
SK-128	O
respectively	O
the	O
"	O
SK	O
"	O
standing	O
for	O
"	O
Strengthened	O
Key	B-Algorithm
schedule	I-Algorithm
"	O
,	O
though	O
the	O
RSA	O
FAQ	O
reports	O
that	O
,	O
"	O
one	O
joke	O
has	O
it	O
that	O
SK	O
really	O
stands	O
for	O
'	O
Stop	O
Knudsen	O
 '	O
,	O
a	O
wise	O
precaution	O
in	O
the	O
design	O
of	O
any	O
block	O
cipher	O
"	O
.	O
</s>
<s>
In	O
the	O
first	O
key-mixing	O
stage	O
,	O
the	O
plaintext	O
block	O
is	O
divided	O
into	O
eight	O
8-bit	O
segments	O
,	O
and	O
subkeys	O
are	O
added	O
using	O
either	O
addition	O
modulo	O
256	O
(	O
denoted	O
by	O
a	O
"	O
+	O
"	O
in	O
a	O
square	O
)	O
or	O
XOR	B-Application
(	O
denoted	O
by	O
a	O
"	O
+	O
"	O
in	O
a	O
circle	O
)	O
.	O
</s>
<s>
The	O
substitution	O
layer	O
consists	O
of	O
two	O
S-boxes	B-Algorithm
,	O
each	O
the	O
inverse	O
of	O
each	O
other	O
,	O
derived	O
from	O
discrete	O
exponentiation	O
(	O
45x	O
)	O
and	O
logarithm	O
(	O
log45x	O
)	O
functions	O
.	O
</s>
<s>
After	O
a	O
second	O
key-mixing	O
stage	O
there	O
is	O
the	O
diffusion	O
layer	O
:	O
a	O
novel	O
cryptographic	O
component	O
termed	O
a	O
pseudo-Hadamard	B-Algorithm
transform	I-Algorithm
(	O
PHT	O
)	O
.	O
</s>
<s>
(	O
The	O
PHT	O
was	O
also	O
later	O
used	O
in	O
the	O
Twofish	B-Algorithm
cipher	O
.	O
)	O
</s>
<s>
There	O
are	O
two	O
more-recent	O
members	O
of	O
the	O
SAFER	B-Algorithm
family	O
that	O
have	O
made	O
changes	O
to	O
the	O
main	O
encryption	O
routine	O
,	O
designed	O
by	O
the	O
Armenian	O
cryptographers	O
Gurgen	O
Khachatrian	O
(	O
American	O
University	O
of	O
Armenia	O
)	O
and	O
Melsik	O
Kuregian	O
in	O
conjunction	O
with	O
Massey	O
.	O
</s>
<s>
SAFER+	B-Algorithm
(	O
Massey	O
et	O
al.	O
,	O
1998	O
)	O
was	O
submitted	O
as	O
a	O
candidate	O
for	O
the	O
Advanced	O
Encryption	O
Standard	O
and	O
has	O
a	O
block	O
size	O
of	O
128	O
bits	O
.	O
</s>
<s>
Bluetooth	B-Protocol
uses	O
custom	O
algorithms	O
based	O
on	O
SAFER+	B-Algorithm
for	O
key	O
derivation	O
(	O
called	O
E21	O
and	O
E22	O
)	O
and	O
authentication	O
as	O
message	B-Algorithm
authentication	I-Algorithm
codes	I-Algorithm
(	O
called	O
E1	O
)	O
.	O
</s>
<s>
Encryption	O
in	O
Bluetooth	B-Protocol
does	O
not	O
use	O
SAFER+	B-Algorithm
.	O
</s>
<s>
SAFER++	B-Algorithm
(	O
Massey	O
et	O
al.	O
,	O
2000	O
)	O
was	O
submitted	O
to	O
the	O
NESSIE	O
project	O
in	O
two	O
versions	O
,	O
one	O
with	O
64	O
bits	O
,	O
and	O
the	O
other	O
with	O
128	O
bits	O
.	O
</s>
