Padding-Based Forgeries in The Mode XOCB: Jean Li Enardy
Padding-Based Forgeries in The Mode XOCB: Jean Li Enardy
Jean Liénardy*
Royal military Academy, Avenue de la renaissance 30, 1000, Bruxelles, Belgium
In this note, we identify a minor flaw in the design of the XOCB mode, presented at Euro-
crypt ’23. This vulnerability enables trivial tag forgeries and arises from the padding applied
to messages. We examine the security proof and pinpoint the presence of the flaw within it.
Furthermore, we propose a simple fix for this issue, drawing upon the features of OCB3, and
discuss the implications of this modification on the proof of security.
1 Introduction
Authenticated encryption with associated data (AEAD) is a key component in modern cryptogra-
phy, ensuring confidentiality and integrity of transmitted data. One widely-adopted AEAD mode
is the Offset Codebook mode (OCB3), developed by Rogaway [1, 2]. While OCB3 has been re-
markably efficient and enjoyed considerable success, its security is limited by the birthday-bound
constraint.
In this article, we discuss a new mode of operation for AEAD called XOCB, which is a general-
isation of OCB3 [3]. XOCB offers rate−1 computation as well as beyond-birthday-bound (BBB)
security under the standard pseudorandom assumption of the internal block cipher, provided
that the maximum block length is significantly smaller than the birthday bound.
However, our analysis reveals a weakness in the XOCB mode, undermining its security guar-
antees. In this article, we present a detailed description of the flaw and then discuss the proof
of security of XOCB. We finally propose a fix for the flaw.
1
0 < |Mm | ≤ n. The empty plaintext M = ε is treated differently. This special case results in
(M1 ) ← M (thus, with an effective value
Lm m = 1) with M1 = ε, |M1 | = 0.
The checksum is defined as Σ = i=1 Mi where the sum runs over the plaintext blocks. In
this equation,
(
M if |M | = 0 mod n,
M= n−(|M | mod n)−1
pad(M ) = M ∥10 else
Furthermore, according to the algorithm presented in Fig. 1 of [3] and the provided source code,
the empty message M = ε yields a checksum Σ = 0n .
3 Proof of security
n the paper [3], the XOCB mode is accompanied with a proof of security. This proof is constructed
using Patarin’s H technique [4] and mirror theory [5].
The proof of the security claim is based on three lemmas. In particular, the third lemma
(called Lemma 6) ensures that no “bad event” badC occurs due to collisions in the inputs of π,
an idealised blockcipher during the tag generation.
We are specifically interested in the badC3 event, which occurs (following [3] with α = 0) if
2
there exists a decryption query i and an encryption query j in the final transcript such that
(i) (i) (i) (j) (j) (j)
2m ∆1 ⊕ ∆3 = 2m ∆1 ⊕ ∆3 , (2)
(i) (i) (i) (j) (j) (j)
2m ∆1 ⊕ 2∆3 ⊕ Σ(i) = 2m ∆1 ⊕ 2∆3 ⊕ Σ(j) , (3)
(i) (j)
T (i) ⊕ 3∆3 ⊕ Γ(i) =T (j)
⊕ 3∆3 ⊕ Γ(j) . (4)
In this equation, the superscript indicates that
Lthe blocks (masks ∆1 and ∆3 , tags T , hash value
m
of the associated data Γ, and checksum Σ = k=1 Mk ) correspond to either query i or j.
(i) (j)
We focus on the case where N (i) = N (j) and A(i) = A(j) , resulting in ∆1/3 = ∆1/3 and
Γ(i) = Γ(j) . Under these conditions, the badC3 event requires:
(i) (i) (j) (j)
2m ∆1 = 2m ∆1 , Σ(i) = Σ(j) and T (i) = T (j) .
The first condition implies that the messages have the same length m(i) = m(j) . If the queried
(i) (j)
messages are different, there must exist a β ≤ m(j) such that Mβ ̸= Mβ . (The case β > m(j)
considered in [3] can be excluded due to the length condition).
(i)
We examine the first subcase where the last blocks β = m(i) differ, and |Mβ | < n is a partial
(i) (j) (i) (j)
block. In this scenario, we can have Σ(i) = Σ(j) by choosing Mβ ̸= Mβ such that Mβ = Mβ ,
thus contradicting the statement that this sub-event has a probability of 0. Another option is
(i) (j)
to take β = 1, Mβ = ε, and Mβ = 0n . Consequently, the probability of badC3 is higher than
anticipated, and the security claim is not met.
Our findings show that even “provably secure schemes” may contain errors in their proof of
security. Similar situations have occurred with OCB2 [6], GCM [7], recently with OCB3 [8],
and numerous other examples (see [6] for more instances). We believe this paper highlights once
again the value of thoroughness in crafting and reviewing security proofs to ensure the robustness
of cryptographic designs.
3
The presence of 2∆3 or 4∆3 , depending on the message length will be sufficient to prevent the
small weakness of section 2 and the randomness of the newly used value (4∆3 ) will most certainly
keep the security claims unchanged. However, a comprehensive re-evaluation of the security proof
is necessary to ensure that the modified mode maintains its security guarantees. The later is
beyond the scope of this note.
5 Conclusion
In this brief note, we have identified a flaw in the design of the recently proposed XOCB mode.
This weakness arises from an issue in the padding applied to messages during the tag generation
phase. We highlighted the error made in the security proof and suggested a fix for the mode,
drawing inspiration from the design of OCB3. We recommend carrying out a comprehensive
security analysis to ascertain the effectiveness of the proposed fix and assess its impact on the
overall security of the XOCB mode. This paper serves as a reminder of the importance of the
meticulous writing and examination of security proofs, as these are crucial to the reliability of
cryptographic schemes.
References
[1] T. Krovetz, P. Rogaway, The software performance of authenticated-encryption modes, in:
International Workshop on Fast Software Encryption, Springer, 2011, pp. 306–327.
[2] T. Krovetz, P. Rogaway, The Design and Evolution of OCB, Journal of Cryptology 34 (4)
(2021) 1–32.
[3] Z. Bao, S. Hwang, A. Inoue, B. Lee, J. Lee, K. Minematsu, XOCB: Beyond-Birthday-Bound
Secure Authenticated Encryption Mode with Rate-One Computation (Full Version), IACR
Cryptology ePrint Archive, Paper 2023/253 (2023), https://eprint.iacr.org/2023/253
[4] J. Patarin, The “coefficients H” technique. In Selected Areas in Cryptography: 15th Inter-
national Workshop, SAC 2008, Springer (2009), 328–345.
[5] J. Patarin, Mirror Theory and Cryptography. IACR Cryptology ePrint Archive, Report
2016/702 (2016), http://eprint.iacr.org/2016/702
[8] J. Liénardy, F. Lafitte, A weakness in OCB3 used with short nonces allowing for a break of
authenticity and confidentiality, in publication in Information Processing Letters (2023)