<s>
In	O
cryptography	O
,	O
padding	B-Algorithm
is	O
any	O
of	O
a	O
number	O
of	O
distinct	O
practices	O
which	O
all	O
include	O
adding	O
data	O
to	O
the	O
beginning	O
,	O
middle	O
,	O
or	O
end	O
of	O
a	O
message	O
prior	O
to	O
encryption	O
.	O
</s>
<s>
In	O
classical	B-Algorithm
cryptography	I-Algorithm
,	O
padding	B-Algorithm
may	O
include	O
adding	O
nonsense	O
phrases	O
to	O
a	O
message	O
to	O
obscure	O
the	O
fact	O
that	O
many	O
messages	O
end	O
in	O
predictable	O
ways	O
,	O
e.g.	O
</s>
<s>
The	O
primary	O
use	O
of	O
padding	B-Algorithm
with	O
classical	B-Algorithm
ciphers	I-Algorithm
is	O
to	O
prevent	O
the	O
cryptanalyst	O
from	O
using	O
that	O
predictability	O
to	O
find	O
known	O
plaintext	O
that	O
aids	O
in	O
breaking	O
the	O
encryption	O
.	O
</s>
<s>
Random	O
length	O
padding	B-Algorithm
also	O
prevents	O
an	O
attacker	O
from	O
knowing	O
the	O
exact	O
length	O
of	O
the	O
plaintext	O
message	O
.	O
</s>
<s>
A	O
famous	O
example	O
of	O
classical	O
padding	B-Algorithm
which	O
caused	O
a	O
great	O
misunderstanding	O
is	O
"	O
the	O
world	O
wonders	O
"	O
incident	O
,	O
which	O
nearly	O
caused	O
an	O
Allied	O
loss	O
at	O
the	O
WWII	O
Battle	O
off	O
Samar	O
,	O
part	O
of	O
the	O
larger	O
Battle	O
of	O
Leyte	O
Gulf	O
.	O
</s>
<s>
With	O
padding	B-Algorithm
(	O
bolded	O
)	O
and	O
metadata	O
added	O
,	O
the	O
message	O
became	O
:	O
</s>
<s>
Halsey	O
's	O
radio	O
operator	O
mistook	O
some	O
of	O
the	O
padding	B-Algorithm
for	O
the	O
message	O
,	O
so	O
Admiral	O
Halsey	O
ended	O
up	O
reading	O
the	O
following	O
message	O
:	O
</s>
<s>
Admiral	O
Halsey	O
interpreted	O
the	O
padding	B-Algorithm
phrase	O
"	O
the	O
world	O
wonders	O
"	O
as	O
a	O
sarcastic	O
reprimand	O
,	O
causing	O
him	O
to	O
have	O
an	O
emotional	O
outburst	O
and	O
then	O
lock	O
himself	O
in	O
his	O
bridge	O
and	O
sulk	O
for	O
an	O
hour	O
before	O
moving	O
his	O
forces	O
to	O
assist	O
at	O
the	O
Battle	O
off	O
Samar	O
.	O
</s>
<s>
Halsey	O
's	O
radio	O
operator	O
should	O
have	O
been	O
tipped	O
off	O
by	O
the	O
letters	O
RR	O
that	O
"	O
the	O
world	O
wonders	O
"	O
was	O
padding	B-Algorithm
;	O
all	O
other	O
radio	O
operators	O
who	O
received	O
Admiral	O
Nimitz	O
's	O
message	O
correctly	O
removed	O
both	O
padding	B-Algorithm
phrases	O
.	O
</s>
<s>
Many	O
classical	B-Algorithm
ciphers	I-Algorithm
arrange	O
the	O
plaintext	O
into	O
particular	O
patterns	O
(	O
e.g.	O
,	O
squares	O
,	O
rectangles	O
,	O
etc	O
.	O
)	O
</s>
<s>
Most	O
modern	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
process	O
messages	O
in	O
fixed-length	O
blocks	O
;	O
all	O
but	O
the	O
earliest	O
hash	B-Error_Name
functions	I-Error_Name
include	O
some	O
sort	O
of	O
padding	B-Algorithm
scheme	O
.	O
</s>
<s>
It	O
is	O
critical	O
for	O
cryptographic	B-Algorithm
hash	I-Algorithm
functions	I-Algorithm
to	O
employ	O
termination	O
schemes	O
that	O
prevent	O
a	O
hash	B-Error_Name
from	O
being	O
vulnerable	O
to	O
length	O
extension	O
attacks	O
.	O
</s>
<s>
Many	O
padding	B-Algorithm
schemes	O
are	O
based	O
on	O
appending	O
predictable	O
data	O
to	O
the	O
final	O
block	O
.	O
</s>
<s>
Cipher-block	O
chaining	O
(	O
CBC	O
)	O
mode	O
is	O
an	O
example	O
of	O
block	B-Algorithm
cipher	I-Algorithm
mode	I-Algorithm
of	I-Algorithm
operation	I-Algorithm
.	O
</s>
<s>
Some	O
block	B-Algorithm
cipher	I-Algorithm
modes	I-Algorithm
(	O
CBC	O
and	O
PCBC	O
essentially	O
)	O
for	O
symmetric-key	B-Algorithm
encryption	I-Algorithm
algorithms	I-Algorithm
require	O
plain	O
text	O
input	O
that	O
is	O
a	O
multiple	O
of	O
the	O
block	O
size	O
,	O
so	O
messages	O
may	O
have	O
to	O
be	O
padded	O
to	O
bring	O
them	O
to	O
this	O
length	O
.	O
</s>
<s>
There	O
is	O
currently	O
a	O
shift	O
to	O
use	O
streaming	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
instead	O
of	O
block	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
.	O
</s>
<s>
An	O
example	O
of	O
streaming	O
mode	O
encryption	O
is	O
the	O
counter	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
.	O
</s>
<s>
Streaming	O
modes	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
can	O
encrypt	O
and	O
decrypt	O
messages	O
of	O
any	O
size	O
and	O
therefore	O
do	O
not	O
require	O
padding	B-Algorithm
.	O
</s>
<s>
More	O
intricate	O
ways	O
of	O
ending	O
a	O
message	O
such	O
as	O
ciphertext	B-Algorithm
stealing	I-Algorithm
or	O
residual	B-Algorithm
block	I-Algorithm
termination	I-Algorithm
avoid	O
the	O
need	O
for	O
padding	B-Algorithm
.	O
</s>
<s>
A	O
disadvantage	O
of	O
padding	B-Algorithm
is	O
that	O
it	O
makes	O
the	O
plain	O
text	O
of	O
the	O
message	O
susceptible	O
to	O
padding	B-Application
oracle	I-Application
attacks	I-Application
.	O
</s>
<s>
Padding	B-Application
oracle	I-Application
attacks	I-Application
allow	O
the	O
attacker	O
to	O
gain	O
knowledge	O
of	O
the	O
plain	O
text	O
without	O
attacking	O
the	O
block	O
cipher	O
primitive	O
itself	O
.	O
</s>
<s>
Padding	B-Application
oracle	I-Application
attacks	I-Application
can	O
be	O
avoided	O
by	O
making	O
sure	O
that	O
an	O
attacker	O
cannot	O
gain	O
knowledge	O
about	O
the	O
removal	O
of	O
the	O
padding	B-Algorithm
bytes	B-Application
.	O
</s>
<s>
This	O
can	O
be	O
accomplished	O
by	O
verifying	O
a	O
message	B-Algorithm
authentication	I-Algorithm
code	I-Algorithm
(	O
MAC	O
)	O
or	O
digital	O
signature	O
before	O
removal	O
of	O
the	O
padding	B-Algorithm
bytes	B-Application
,	O
or	O
by	O
switching	O
to	O
a	O
streaming	O
mode	B-Algorithm
of	I-Algorithm
operation	I-Algorithm
.	O
</s>
<s>
Bit	O
padding	B-Algorithm
can	O
be	O
applied	O
to	O
messages	O
of	O
any	O
size	O
.	O
</s>
<s>
This	O
method	O
can	O
be	O
used	O
to	O
pad	O
messages	O
which	O
are	O
any	O
number	O
of	O
bits	O
long	O
,	O
not	O
necessarily	O
a	O
whole	O
number	O
of	O
bytes	B-Application
long	O
.	O
</s>
<s>
This	O
padding	B-Algorithm
is	O
the	O
first	O
step	O
of	O
a	O
two-step	O
padding	B-Algorithm
scheme	O
used	O
in	O
many	O
hash	B-Error_Name
functions	I-Error_Name
including	O
MD5	B-Algorithm
and	O
SHA	O
.	O
</s>
<s>
This	O
padding	B-Algorithm
scheme	O
is	O
defined	O
by	O
ISO/IEC	B-Algorithm
9797-1	I-Algorithm
as	O
Padding	B-Algorithm
Method	O
2	O
.	O
</s>
<s>
Byte	B-Application
padding	B-Algorithm
can	O
be	O
applied	O
to	O
messages	O
that	O
can	O
be	O
encoded	O
as	O
an	O
integral	O
number	O
of	O
bytes	B-Application
.	O
</s>
<s>
In	O
ANSI	O
X9.23	O
,	O
between	O
1	O
and	O
8	O
bytes	B-Application
are	O
always	O
added	O
as	O
padding	B-Algorithm
.	O
</s>
<s>
The	O
block	O
is	O
padded	O
with	O
random	O
bytes	B-Application
(	O
although	O
many	O
implementations	O
use	O
00	O
)	O
and	O
the	O
last	O
byte	B-Application
of	O
the	O
block	O
is	O
set	O
to	O
the	O
number	O
of	O
bytes	B-Application
added	O
.	O
</s>
<s>
ISO	O
10126	O
(	O
withdrawn	O
,	O
2007	O
)	O
specifies	O
that	O
the	O
padding	B-Algorithm
should	O
be	O
done	O
at	O
the	O
end	O
of	O
that	O
last	O
block	O
with	O
random	O
bytes	B-Application
,	O
and	O
the	O
padding	B-Algorithm
boundary	O
should	O
be	O
specified	O
by	O
the	O
last	O
byte	B-Application
.	O
</s>
<s>
Padding	B-Algorithm
is	O
in	O
whole	O
bytes	B-Application
.	O
</s>
<s>
The	O
value	O
of	O
each	O
added	O
byte	B-Application
is	O
the	O
number	O
of	O
bytes	B-Application
that	O
are	O
added	O
,	O
i.e.	O
</s>
<s>
bytes	B-Application
,	O
each	O
of	O
value	O
are	O
added	O
.	O
</s>
<s>
The	O
number	O
of	O
bytes	B-Application
added	O
will	O
depend	O
on	O
the	O
block	O
boundary	O
to	O
which	O
the	O
message	O
needs	O
to	O
be	O
extended	O
.	O
</s>
<s>
The	O
padding	B-Algorithm
will	O
be	O
one	O
of	O
:	O
</s>
<s>
This	O
padding	B-Algorithm
method	O
(	O
as	O
well	O
as	O
the	O
previous	O
two	O
)	O
is	O
well-defined	O
if	O
and	O
only	O
if	O
is	O
less	O
than	O
256	O
.	O
</s>
<s>
If	O
the	O
length	O
of	O
the	O
original	O
data	O
is	O
an	O
integer	O
multiple	O
of	O
the	O
block	O
size	O
,	O
then	O
an	O
extra	O
block	O
of	O
bytes	B-Application
with	O
value	O
is	O
added	O
.	O
</s>
<s>
This	O
is	O
necessary	O
so	O
the	O
deciphering	O
algorithm	O
can	O
determine	O
with	O
certainty	O
whether	O
the	O
last	O
byte	B-Application
of	O
the	O
last	O
block	O
is	O
a	O
pad	O
byte	B-Application
indicating	O
the	O
number	O
of	O
padding	B-Algorithm
bytes	B-Application
added	O
or	O
part	O
of	O
the	O
plaintext	O
message	O
.	O
</s>
<s>
Consider	O
a	O
plaintext	O
message	O
that	O
is	O
an	O
integer	O
multiple	O
of	O
bytes	B-Application
with	O
the	O
last	O
byte	B-Application
of	O
plaintext	O
being	O
01	O
.	O
</s>
<s>
With	O
no	O
additional	O
information	O
,	O
the	O
deciphering	O
algorithm	O
will	O
not	O
be	O
able	O
to	O
determine	O
whether	O
the	O
last	O
byte	B-Application
is	O
a	O
plaintext	O
byte	B-Application
or	O
a	O
pad	O
byte	B-Application
.	O
</s>
<s>
However	O
,	O
by	O
adding	O
bytes	B-Application
each	O
of	O
value	O
after	O
the	O
01	O
plaintext	O
byte	B-Application
,	O
the	O
deciphering	O
algorithm	O
can	O
always	O
treat	O
the	O
last	O
byte	B-Application
as	O
a	O
pad	O
byte	B-Application
and	O
strip	O
the	O
appropriate	O
number	O
of	O
pad	O
bytes	B-Application
off	O
the	O
end	O
of	O
the	O
ciphertext	O
;	O
said	O
number	O
of	O
bytes	B-Application
to	O
be	O
stripped	O
based	O
on	O
the	O
value	O
of	O
the	O
last	O
byte	B-Application
.	O
</s>
<s>
PKCS	O
#5	O
padding	B-Algorithm
is	O
identical	O
to	O
PKCS	O
#7	O
padding	B-Algorithm
,	O
except	O
that	O
it	O
has	O
only	O
been	O
defined	O
for	O
block	O
ciphers	O
that	O
use	O
a	O
64-bit	O
(	O
8-byte	O
)	O
block	O
size	O
.	O
</s>
<s>
ISO/IEC	O
7816-4:2005	O
is	O
identical	O
to	O
the	O
bit	O
padding	B-Algorithm
scheme	O
,	O
applied	O
to	O
a	O
plain	O
text	O
of	O
N	O
bytes	B-Application
.	O
</s>
<s>
This	O
means	O
in	O
practice	O
that	O
the	O
first	O
byte	B-Application
is	O
a	O
mandatory	O
byte	B-Application
valued	O
'	O
80	O
 '	O
(	O
Hexadecimal	O
)	O
followed	O
,	O
if	O
needed	O
,	O
by	O
0	O
to	O
N−1	O
bytes	B-Application
set	O
to	O
'	O
00	O
 '	O
,	O
until	O
the	O
end	O
of	O
the	O
block	O
is	O
reached	O
.	O
</s>
<s>
All	O
the	O
bytes	B-Application
that	O
are	O
required	O
to	O
be	O
padded	O
are	O
padded	O
with	O
zero	O
.	O
</s>
<s>
The	O
zero	O
padding	B-Algorithm
scheme	O
has	O
not	O
been	O
standardized	O
for	O
encryption	O
,	O
although	O
it	O
is	O
specified	O
for	O
hashes	B-Error_Name
and	O
MACs	O
as	O
Padding	B-Algorithm
Method	O
1	O
in	O
ISO/IEC	O
10118-1	O
and	O
ISO/IEC	B-Algorithm
9797-1	I-Algorithm
.	O
</s>
<s>
Zero	O
padding	B-Algorithm
may	O
not	O
be	O
reversible	O
if	O
the	O
original	O
file	O
ends	O
with	O
one	O
or	O
more	O
zero	O
bytes	B-Application
,	O
making	O
it	O
impossible	O
to	O
distinguish	O
between	O
plaintext	O
data	O
bytes	B-Application
and	O
padding	B-Algorithm
bytes	B-Application
.	O
</s>
<s>
It	O
may	O
be	O
used	O
when	O
the	O
length	O
of	O
the	O
message	O
can	O
be	O
derived	O
out-of-band	B-Protocol
.	O
</s>
<s>
It	O
is	O
often	O
applied	O
to	O
binary	O
encoded	O
strings	O
(	O
null-terminated	B-Data_Structure
string	I-Data_Structure
)	O
as	O
the	O
null	O
character	O
can	O
usually	O
be	O
stripped	O
off	O
as	O
whitespace	O
.	O
</s>
<s>
Zero	O
padding	B-Algorithm
is	O
sometimes	O
also	O
referred	O
to	O
as	O
"	O
null	O
padding	B-Algorithm
"	O
or	O
"	O
zero	O
byte	B-Application
padding	B-Algorithm
"	O
.	O
</s>
<s>
Some	O
implementations	O
may	O
add	O
an	O
additional	O
block	O
of	O
zero	O
bytes	B-Application
if	O
the	O
plaintext	O
is	O
already	O
divisible	O
by	O
the	O
block	O
size	O
.	O
</s>
<s>
In	O
public	B-Application
key	I-Application
cryptography	I-Application
,	O
padding	B-Algorithm
is	O
the	O
process	O
of	O
preparing	O
a	O
message	O
for	O
encryption	O
or	O
signing	O
using	O
a	O
specification	O
or	O
scheme	O
such	O
as	O
PKCS	O
#1	O
v2.2	O
,	O
OAEP	B-Algorithm
,	O
PSS	B-Algorithm
,	O
PSSR	O
,	O
IEEE	O
P1363	O
EMSA2	O
and	O
EMSA5	O
.	O
</s>
<s>
A	O
modern	O
form	O
of	O
padding	B-Algorithm
for	O
asymmetric	O
primitives	O
is	O
OAEP	B-Algorithm
applied	O
to	O
the	O
RSA	B-Architecture
algorithm	I-Architecture
,	O
when	O
it	O
is	O
used	O
to	O
encrypt	O
a	O
limited	O
number	O
of	O
bytes	B-Application
.	O
</s>
<s>
The	O
operation	O
is	O
referred	O
to	O
as	O
"	O
padding	B-Algorithm
"	O
because	O
originally	O
,	O
random	O
material	O
was	O
simply	O
appended	O
to	O
the	O
message	O
to	O
make	O
it	O
long	O
enough	O
for	O
the	O
primitive	O
.	O
</s>
<s>
This	O
form	O
of	O
padding	B-Algorithm
is	O
not	O
secure	O
and	O
is	O
therefore	O
no	O
longer	O
applied	O
.	O
</s>
<s>
A	O
modern	O
padding	B-Algorithm
scheme	O
aims	O
to	O
ensure	O
that	O
the	O
attacker	O
cannot	O
manipulate	O
the	O
plaintext	O
to	O
exploit	O
the	O
mathematical	O
structure	O
of	O
the	O
primitive	O
and	O
will	O
usually	O
be	O
accompanied	O
by	O
a	O
proof	O
,	O
often	O
in	O
the	O
random	B-Application
oracle	I-Application
model	I-Application
,	O
that	O
breaking	O
the	O
padding	B-Algorithm
scheme	O
is	O
as	O
hard	O
as	O
solving	O
the	O
hard	O
problem	O
underlying	O
the	O
primitive	O
.	O
</s>
<s>
As	O
another	O
example	O
,	O
when	O
encrypting	O
Voice	B-Application
Over	I-Application
IP	I-Application
streams	O
that	O
use	O
variable	O
bit	O
rate	O
encoding	O
,	O
the	O
number	O
of	O
bits	O
per	O
unit	O
of	O
time	O
is	O
not	O
obscured	O
,	O
and	O
this	O
can	O
be	O
exploited	O
to	O
guess	O
spoken	O
phrases	O
.	O
</s>
<s>
The	O
side-channel	O
of	O
encrypted	O
content	O
length	O
was	O
used	O
to	O
extract	O
passwords	O
from	O
HTTPS	B-Protocol
communications	O
in	O
the	O
well-known	O
CRIME	O
and	O
BREACH	B-Protocol
attacks	O
.	O
</s>
<s>
Padding	B-Algorithm
an	O
encrypted	O
message	O
can	O
make	O
traffic	O
analysis	O
harder	O
by	O
obscuring	O
the	O
true	O
length	O
of	O
its	O
payload	O
.	O
</s>
<s>
A	O
random	O
number	O
of	O
additional	O
padding	B-Algorithm
bits	O
or	O
bytes	B-Application
may	O
be	O
appended	O
to	O
the	O
end	O
of	O
a	O
message	O
,	O
together	O
with	O
an	O
indication	O
at	O
the	O
end	O
how	O
much	O
padding	B-Algorithm
was	O
added	O
.	O
</s>
<s>
If	O
the	O
amount	O
of	O
padding	B-Algorithm
is	O
chosen	O
as	O
a	O
uniform	O
random	O
number	O
between	O
0	O
and	O
some	O
maximum	O
M	O
,	O
for	O
example	O
,	O
then	O
an	O
eavesdropper	O
will	O
be	O
unable	O
to	O
determine	O
the	O
message	O
's	O
length	O
precisely	O
within	O
that	O
range	O
.	O
</s>
<s>
If	O
the	O
maximum	O
padding	B-Algorithm
M	O
is	O
small	O
compared	O
to	O
the	O
message	O
's	O
total	O
size	O
,	O
then	O
this	O
padding	B-Algorithm
will	O
not	O
add	O
much	O
overhead	O
,	O
but	O
the	O
padding	B-Algorithm
will	O
obscure	O
only	O
the	O
least-significant	O
bits	O
of	O
the	O
object	O
's	O
total	O
length	O
,	O
leaving	O
the	O
approximate	O
length	O
of	O
large	O
objects	O
readily	O
observable	O
and	O
hence	O
still	O
potentially	O
uniquely	O
identifiable	O
by	O
their	O
length	O
.	O
</s>
<s>
If	O
the	O
maximum	O
padding	B-Algorithm
M	O
is	O
comparable	O
to	O
the	O
size	O
of	O
the	O
payload	O
,	O
in	O
contrast	O
,	O
an	O
eavesdropper	O
's	O
uncertainty	O
about	O
the	O
message	O
's	O
true	O
payload	O
size	O
is	O
much	O
larger	O
,	O
at	O
the	O
cost	O
that	O
padding	B-Algorithm
may	O
add	O
up	O
to	O
100%	O
overhead	O
(	O
blow-up	O
)	O
to	O
the	O
message	O
.	O
</s>
<s>
In	O
addition	O
,	O
in	O
common	O
scenarios	O
in	O
which	O
an	O
eavesdropper	O
has	O
the	O
opportunity	O
to	O
see	O
many	O
successive	O
messages	O
from	O
the	O
same	O
sender	O
,	O
and	O
those	O
messages	O
are	O
similar	O
in	O
ways	O
the	O
attacker	O
knows	O
or	O
can	O
guess	O
,	O
then	O
the	O
eavesdropper	O
can	O
use	O
statistical	O
techniques	O
to	O
decrease	O
and	O
eventually	O
even	O
eliminate	O
the	O
benefit	O
of	O
randomized	O
padding	B-Algorithm
.	O
</s>
<s>
A	O
deterministic	O
padding	B-Algorithm
scheme	O
always	O
pads	O
a	O
message	O
payload	O
of	O
a	O
given	O
length	O
to	O
form	O
an	O
encrypted	O
message	O
of	O
a	O
particular	O
corresponding	O
output	O
length	O
.	O
</s>
<s>
In	O
this	O
respect	O
,	O
deterministic	O
padding	B-Algorithm
schemes	O
have	O
the	O
advantage	O
of	O
not	O
leaking	O
any	O
additional	O
information	O
with	O
each	O
successive	O
message	O
of	O
the	O
same	O
payload	O
size	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
suppose	O
an	O
eavesdropper	O
can	O
benefit	O
from	O
learning	O
about	O
small	O
variations	O
in	O
payload	O
size	O
,	O
such	O
as	O
plus	O
or	O
minus	O
just	O
one	O
byte	B-Application
in	O
a	O
password-guessing	O
attack	O
for	O
example	O
.	O
</s>
<s>
If	O
the	O
message	O
sender	O
is	O
unlucky	O
enough	O
to	O
send	O
many	O
messages	O
whose	O
payload	O
lengths	O
vary	O
by	O
only	O
one	O
byte	B-Application
,	O
and	O
that	O
length	O
is	O
exactly	O
on	O
the	O
border	O
between	O
two	O
of	O
the	O
deterministic	O
padding	B-Algorithm
classes	O
,	O
then	O
these	O
plus-or-minus	O
one	O
payload	O
lengths	O
will	O
consistently	O
yield	O
different	O
padded	O
lengths	O
as	O
well	O
(	O
plus-or-minus	O
one	O
block	O
for	O
example	O
)	O
,	O
leaking	O
exactly	O
the	O
fine-grained	O
information	O
the	O
attacker	O
desires	O
.	O
</s>
<s>
Against	O
such	O
risks	O
,	O
randomized	O
padding	B-Algorithm
can	O
offer	O
more	O
protection	O
by	O
independently	O
obscuring	O
the	O
least-significant	O
bits	O
of	O
message	O
lengths	O
.	O
</s>
<s>
Common	O
deterministic	O
padding	B-Algorithm
methods	O
include	O
padding	B-Algorithm
to	O
a	O
constant	O
block	O
size	O
and	O
padding	B-Algorithm
to	O
the	O
next-larger	O
power	O
of	O
two	O
.	O
</s>
<s>
Like	O
randomized	O
padding	B-Algorithm
with	O
a	O
small	O
maximum	O
amountM	O
,	O
however	O
,	O
padding	B-Algorithm
deterministically	O
to	O
a	O
block	O
size	O
much	O
smaller	O
than	O
the	O
message	O
payload	O
obscures	O
only	O
the	O
least-significant	O
bits	O
of	O
the	O
messages	O
true	O
length	O
,	O
leaving	O
the	O
messages	O
's	O
true	O
approximate	O
length	O
largely	O
unprotected	O
.	O
</s>
<s>
Padding	B-Algorithm
messages	O
to	O
a	O
power	O
of	O
two	O
(	O
or	O
any	O
other	O
fixed	O
base	O
)	O
reduces	O
the	O
maximum	O
amount	O
of	O
information	O
that	O
the	O
message	O
can	O
leak	O
via	O
its	O
length	O
from	O
to	O
.	O
</s>
<s>
Padding	B-Algorithm
to	O
a	O
power	O
of	O
two	O
increases	O
message	O
size	O
overhead	O
by	O
up	O
to	O
100%	O
,	O
however	O
,	O
and	O
padding	B-Algorithm
to	O
powers	O
of	O
larger	O
integer	O
bases	O
increase	O
maximum	O
overhead	O
further	O
.	O
</s>
<s>
The	O
PADMÉ	O
scheme	O
,	O
proposed	O
for	O
padded	B-Algorithm
uniform	I-Algorithm
random	I-Algorithm
blobs	I-Algorithm
or	I-Algorithm
PURBs	I-Algorithm
,	O
deterministically	O
pads	O
messages	O
to	O
lengths	O
representable	O
as	O
a	O
floating	O
point	O
number	O
whose	O
mantissa	O
is	O
no	O
longer	O
(	O
i.e.	O
,	O
contains	O
no	O
more	O
significant	O
bits	O
)	O
than	O
its	O
exponent	O
.	O
</s>
<s>
This	O
length	O
constraint	O
ensures	O
that	O
a	O
message	O
leaks	O
at	O
most	O
bits	O
of	O
information	O
via	O
its	O
length	O
,	O
like	O
padding	B-Algorithm
to	O
a	O
power	O
of	O
two	O
,	O
but	O
incurs	O
much	O
less	O
overhead	O
of	O
at	O
most	O
12%	O
for	O
tiny	O
messages	O
and	O
decreasing	O
gradually	O
with	O
message	O
size	O
.	O
</s>
