<s>
ChaCha20-Poly1305	B-Algorithm
is	O
an	O
authenticated	B-Algorithm
encryption	I-Algorithm
with	O
additional	O
data	O
(	O
AEAD	O
)	O
algorithm	O
,	O
that	O
combines	O
the	O
ChaCha20	O
stream	O
cipher	O
with	O
the	O
Poly1305	B-Algorithm
message	O
authentication	O
code	O
.	O
</s>
<s>
It	O
has	O
fast	O
software	O
performance	O
,	O
and	O
without	O
hardware	O
acceleration	O
,	O
is	O
usually	O
faster	O
than	O
AES-GCM	B-Algorithm
.	O
</s>
<s>
The	O
two	O
building	O
blocks	O
of	O
the	O
construction	O
,	O
the	O
algorithms	O
Poly1305	B-Algorithm
and	O
ChaCha20	O
,	O
were	O
both	O
independently	O
designed	O
,	O
in	O
2005	O
and	O
2008	O
,	O
by	O
Daniel	O
J	O
.	O
Bernstein	O
.	O
</s>
<s>
In	O
2013	O
–	O
2014	O
,	O
a	O
variant	O
of	O
the	O
original	O
ChaCha20	O
algorithm	O
(	O
using	O
32-bit	O
counter	O
and	O
96-bit	O
nonce	O
)	O
and	O
a	O
variant	O
of	O
the	O
original	O
Poly1305	B-Algorithm
(	O
authenticating	O
2	O
strings	O
)	O
were	O
combined	O
in	O
an	O
IETF	O
draft	O
to	O
be	O
used	O
in	O
TLS	B-Protocol
and	O
DTLS	B-Protocol
,	O
and	O
chosen	O
by	O
Google	B-Application
,	O
for	O
security	O
and	O
performance	O
reasons	O
,	O
as	O
a	O
newly	O
supported	O
cipher	O
.	O
</s>
<s>
Shortly	O
after	O
Google	B-Application
's	I-Application
adoption	O
for	O
TLS	B-Protocol
,	O
ChaCha20	O
,	O
Poly1305	B-Algorithm
and	O
the	O
combined	O
AEAD	O
mode	O
are	O
added	O
to	O
OpenSSH	B-Language
via	O
thechacha20-poly1305@openssh.com	O
authenticated	B-Algorithm
encryption	I-Algorithm
cipher	O
but	O
kept	O
the	O
original	O
64-bit	O
counter	O
and	O
64-bit	O
nonce	O
for	O
the	O
ChaCha20	O
algorithm	O
.	O
</s>
<s>
In	O
2015	O
,	O
the	O
AEAD	O
algorithm	O
is	O
standardized	O
in	O
RFC	O
7539	O
and	O
RFC	O
7905	O
to	O
be	O
used	O
in	O
TLS	B-Protocol
1.2	O
and	O
DTLS	B-Protocol
1.2	O
and	O
in	O
RFC	O
7634	O
to	O
be	O
used	O
in	O
IPsec	B-Protocol
.	O
</s>
<s>
The	O
ChaCha20-Poly1305	B-Algorithm
algorithm	O
as	O
described	O
in	O
RFC	O
8439	O
takes	O
as	O
input	O
a	O
256-bit	O
key	O
and	O
a	O
96-bit	O
nonce	O
to	O
encrypt	O
a	O
plaintext	O
,	O
with	O
a	O
ciphertext	O
expansion	O
of	O
128-bit	O
(	O
the	O
tag	O
size	O
)	O
.	O
</s>
<s>
In	O
the	O
ChaCha20-Poly1305	B-Algorithm
construction	O
,	O
ChaCha20	O
is	O
used	O
in	O
counter	O
mode	O
to	O
derive	O
a	O
key	O
stream	O
that	O
is	O
XORed	O
with	O
the	O
plaintext	O
.	O
</s>
<s>
The	O
ciphertext	O
and	O
the	O
associated	O
data	O
is	O
then	O
authenticated	O
using	O
a	O
variant	O
of	O
Poly1305	B-Algorithm
that	O
first	O
encodes	O
the	O
two	O
strings	O
into	O
one	O
.	O
</s>
<s>
The	O
XChaCha20-Poly1305	O
construction	O
is	O
an	O
extended	O
192-bit	O
nonce	O
variant	O
of	O
the	O
ChaCha20-Poly1305	B-Algorithm
construction	O
,	O
using	O
XChaCha20	O
instead	O
of	O
ChaCha20	O
.	O
</s>
<s>
When	O
choosing	O
nonces	O
at	O
random	O
,	O
the	O
XChaCha20-Poly1305	O
construction	O
allows	O
for	O
better	O
security	O
than	O
the	O
original	O
construction	O
.	O
</s>
<s>
Salsa20-Poly1305	O
and	O
XSalsa20-Poly1305	O
are	O
variants	O
of	O
the	O
ChaCha20-Poly1305	B-Algorithm
and	O
XChaCha20-Poly1305	O
algorithms	O
,	O
using	O
Salsa20	B-Algorithm
and	O
XSalsa20	O
in	O
place	O
of	O
ChaCha20	O
and	O
XChaCha20	O
.	O
</s>
<s>
They	O
are	O
implemented	O
in	O
NaCl	B-Application
and	O
libsodium	O
but	O
not	O
standardized	O
.	O
</s>
<s>
ChaCha20-Poly1305	B-Algorithm
is	O
used	O
in	O
IPsec	B-Protocol
,	O
SSH	B-Protocol
,	O
TLS	B-Protocol
1.2	O
,	O
DTLS	B-Protocol
1.2	O
,	O
TLS	B-Protocol
1.3	O
,	O
QUIC	B-Protocol
,	O
WireGuard	B-Application
,	O
S/MIME	B-Protocol
4.0	I-Protocol
,	O
OTRv4	O
and	O
multiple	O
other	O
protocols	O
.	O
</s>
<s>
Among	O
others	O
,	O
it	O
is	O
implemented	O
in	O
OpenSSL	B-Language
,	O
OpenSSH	B-Language
and	O
libsodium	O
.	O
</s>
<s>
ChaCha20-Poly1305	B-Algorithm
usually	O
offers	O
better	O
performance	O
than	O
the	O
more	O
prevalent	O
AES-GCM	B-Algorithm
algorithm	O
on	O
systems	O
where	O
the	O
CPU(s )	O
does	O
not	O
feature	O
the	O
AES-NI	B-Algorithm
instruction	I-Algorithm
set	I-Algorithm
extension	O
.	O
</s>
<s>
As	O
a	O
result	O
,	O
ChaCha20-Poly1305	B-Algorithm
is	O
sometimes	O
preferred	O
over	O
AES-GCM	B-Algorithm
due	O
to	O
its	O
similar	O
levels	O
of	O
security	O
and	O
in	O
certain	O
use	O
cases	O
involving	O
mobile	B-Application
devices	I-Application
,	O
which	O
mostly	O
use	O
ARM-based	O
CPUs	O
.	O
</s>
<s>
The	O
ChaCha20-Poly1305	B-Algorithm
construction	O
is	O
proven	O
secure	O
in	O
the	O
standard	B-General_Concept
model	I-General_Concept
and	O
the	O
ideal	O
permutation	O
model	O
,	O
for	O
the	O
single	O
-	O
and	O
multi-user	O
setting	O
.	O
</s>
<s>
However	O
,	O
similarly	O
to	O
GCM	B-Algorithm
,	O
the	O
security	O
relies	O
on	O
choosing	O
a	O
unique	O
nonce	O
for	O
every	O
message	O
encrypted	O
.	O
</s>
<s>
Compared	O
to	O
AES-GCM	B-Algorithm
,	O
implementations	O
of	O
ChaCha20-Poly1305	B-Algorithm
are	O
less	O
vulnerable	O
to	O
timing	O
attacks	O
.	O
</s>
