Skip to main content

An IND-CCA2 Attack Against the 1st- and 2nd-Round Versions of NTS-KEM

  • Conference paper
  • First Online:
Innovative Security Solutions for Information Technology and Communications (SecITC 2020)

Part of the book series: Lecture Notes in Computer Science ((LNSC,volume 12596))

Abstract

This paper presents an IND-CCA2 attack against the 1st- and 2nd-round versions of NTS-KEM, i.e., the versions before the update in December 2019. Our attack works against the 1st- and 2nd-round specifications, with a number of decapsulation queries upper-bounded by \(n-k\) and an advantage lower-bounded by roughly \(0.5(n-k)t/n^2\), where n, k, and t stand for the code length, code dimension, and the designed decoding capacity, for all the three parameter sets of NTS-KEM. We found that the non-reference implementations are also vulnerable to our attack, even though there are bugs. There are also bugs in the reference implementations, but in a way invulnerable to our attack.

This work was supported by Taiwan Ministry of Science and Technology (MOST) Grant 109-2222-E-001-001-MY3. Permanent ID of this document: eb8cb246e2f1ea188ad29d70680e73f8. Date: 2020.12.8.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Albrecht, M., Cid, C., Paterson, K.G., Tjhai, C.J., Tomlinson, M.: NTS-KEM, first round submission (2017). https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/round-1/submissions/NTS_KEM.zip. Citations in this document: §1

  2. Albrecht, M., Cid, C., Paterson, K.G., Tjhai, C.J., Tomlinson, M.: NTS-KEM, second round submission (2019). https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/round-2/submissions/NTS-KEM-Round2.zip. Citations in this document: §1

  3. Albrecht, M., Cid, C., Paterson, K.G., Tjhai, C.J., Tomlinson, M.: NTS-KEM, updated second round submission (2019). https://nts-kem.io/. Citations in this document: §1

  4. Berlekamp, E.R.: Algebraic coding theory, McGraw-Hill. MR 38 #6873. Citations in this document: §3.5, §3.6 (1968)

    Google Scholar 

  5. Albrecht, M., et al.: Classic McEliece (2020). https://classic.mceliece.org/. Citations in this document: §1, §1.2

  6. Bertoni, G., Coron, J.-S. (eds.): CHES 2013. LNCS, vol. 8086. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-40349-1

  7. Cho, J.Y.: Implementation of code-based KEMs submitted to NIST on optical communication systems (2019). https://cbc2019.dii.univpm.it/program. Citations in this document: §1.1

  8. Cramer, R., Shoup, V.: Design and analysis of practical public-key encryption schemes secure against adaptive chosen ciphertext attack (2001). https://eprint.iacr.org/2001/108

  9. Dent, A.W.: A Designer’s Guide to KEMs. In: Paterson, K.G. (ed.) Cryptography and Coding 2003. LNCS, vol. 2898, pp. 133–151. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-40974-8_12

    Chapter  Google Scholar 

  10. Fujisaki, E., Okamoto, T.: Secure Integration of Asymmetric and Symmetric Encryption Schemes. In: Wiener, M. (ed.) CRYPTO 1999. LNCS, vol. 1666, pp. 537–554. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48405-1_34

    Chapter  Google Scholar 

  11. Fujisaki, E., Okamoto, T.: Secure integration of asymmetric and symmetric encryption schemes. J. Cryptol. 26, 80–101 (2013)

    Article  MathSciNet  Google Scholar 

  12. Helgert, H.: Decoding of alternant codes (Corresp.). IEEE Trans. Inf. Theory 23(4), 513–514 (1977) Citations in this document: §3.6

    Google Scholar 

  13. Maram, V.: On the security of NTS-KEM in the quantum random oracle model. In PQCRYPTO 2020 (to appear), p. 150 (2017). https://eprint.iacr.org/2020/150.pdf. Citations in this document: §1, §1, §1.1

  14. Massey, J.: Shift-register synthesis and BCH decoding. IEEE Trans. Inf. Theory 15, 122–127 (1969) Citations in this document: §3.5, §3.6, § C

    Google Scholar 

  15. McEliece, R.J: A public-key cryptosystem based on algebraic. Coding Thv, 4244, 114–116 (1978). http://ipnpr.jpl.nasa.gov/progress_report2/42-44/44N.PDF. Citations in this document: §2.5

  16. Paterson, K.G. (ed.): Cryptography and Coding 2003. LNCS, vol. 2898. Springer, Heidelberg (2003). https://doi.org/10.1007/b93924

  17. Preneel, B. (ed.): EUROCRYPT 2000. LNCS, vol. 1807. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-45539-6

  18. Shoup, V.: A Composition Theorem for Universal One-Way Hash Functions. In: Preneel, B. (ed.) EUROCRYPT 2000. LNCS, vol. 1807, pp. 445–452. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-45539-6_32

    Chapter  Google Scholar 

  19. Wiener, M. (ed.): CRYPTO 1999. LNCS, vol. 1666. Springer, Heidelberg (1999). https://doi.org/10.1007/3-540-48405-1

  20. Youzhi, X.: Implementation of Berlekamp-Massey algorithm without inversion. IEE Proc. I - Commun. Speech Vis. 138, 138–140 (1991) Citations in this document: §3.6, §3.6

    Google Scholar 

Download references

Acknowledgements

The author would like thank Daniel J. Bernstein and Tanja Lange for all their suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tung Chou .

Editor information

Editors and Affiliations

Appendices

A Paterson’s Message

We have added a re-encapsulation step during decapsulation, in order to fix a subtle issue in the ROM security proof for NTS-KEM. This issue was identified by Varun Maram from ETH Zurich. This change necessitates the inclusion of the public key as part of the private key and increases the running time of decapsulation. Fortuitously, this change facilitates a QROM proof for NTS-KEM which we plan to make public soon.

[In more detail: our proof did not fully address the possibility that certain adversarially generated ciphertexts not output by encapsulation might decapsulate correctly. This is due to possible behaviour of the decoder, including the Berlekamp-Massey algorithm, when operating beyond its natural decoding capacity. Adding the re-encapsulation step ensures that only correctly generated ciphertexts lead to valid decapsulations; other ciphertexts are implicitly rejected. Our new security proof still tightly relates breaking IND-CCA security of (the new version of) NTS-KEM to breaking one-wayness of the McEliece scheme with the same parameters. We also stress that we are not aware of any concrete attack arising from the issue identified in our proof. Since re-encapsulation makes use of the public key, we now include the public key as part of the private key; an alternative whose cost can be amortised over many invocations of decapsulation is to regenerate the public key from the private key when needed.]”

B NTS-KEM’s Berlekamp-Massey Algorithm

figure b

C Attacking the Reference Implementations

We found the following bugs in the code for Algorithm 1 in the reference implementations.

  • In each of the 2t iterations, R is updated in the same way as the pseudocode in Sect. 4.3.

  • \(\sigma ^*(x)\) is computed as \(x^{\text {Deg}(\sigma (x))} \sigma (x^{-1})\).

We also found that after obtaining \((\sigma ^*(x), \xi )\), the reference implementations compute the error vector e as follows.

  • Set \(e = 0 \in \mathbb {F}_{2}^n\).

  • Set \(e_i = 1\) for all i such that \(\sigma ^*(\alpha _i)=0\) and \(\alpha _i \ne 0\).

  • Set \(e_{\text {pos}(0)}=1\) if \(\xi =1\).

Note that this is different from what is described in Sect. 3.5.

Our attack relies on forcing the decoding algorithm to take an input vector which is the sum of a codeword and an error vector \(e'\) with \(|e'|=t-1\) and \(e'_{\text {pos}(0)}=0\). In this case, according to Theorem 1, Algorithm 1 computes

$$ \sigma (x) = \sigma _0 \prod _{e'_i = 1} (1 - \alpha _i x), $$

so the reference implementations compute

$$ \sigma ^*(x) = \sigma _0 \prod _{e'_i=1}(x - \alpha _i). $$

How about the value of \(\xi \)? It turns out that Algorithm 1 computes \(\sigma (x)\) in the first \(2t-2\) iteration; See [14] for discussions on the number of iterations required to compute the linear feedback shift register. This forces d to be 0 in the last 2 iterations, so we have \(R \ge 2\). As \(\text {Deg}(\sigma ) = t-1 \ge t-R/2\), the reference implementations computes \(\xi =0\). Therefore, the decoding algorithm returns the weight-(\(t-1\)) vector \(e'\), and the decapsulation oracle returns \(\perp \) or \(H_\ell (z, 1_a, c_b, c'_c)\) instead of the session key.

D Implementations

To demonstrate that our attack works against the non-reference implementations, We modified ntskem_test.c in the non-reference implementations included in the 1st-round and 2nd-round submission packages. The content of the modified file is available in Appendix F. The modified testkem_nts function keeps generating ciphertext-session-key pairs. For each ciphertext, it is checked whether flipping any of the last \(n-k\) bits will result in a ciphertext that decapsulates to the same session key. If this happens, a message

figure c

will be printed. One can replace the original ntskem_test.c by the modified one and compile each non-reference implementation using make. Then by running the executables ntskem-*-test, the user can see that the message usually shows after trying a several hundreds of ciphertext-session-key pairs.

To demonstrate that our attack works against the specifications, we fixed the bugs in berlekamp_massey.c and nts_kem.c in the reference implementations included in the 1st-round and 2nd-round submission packages. The content of the modified berlekamp_massey.c is available in Appendix E. The modified berlekamp_massey function updates R and computes \(\sigma ^*\) in the correct way. For nts_kem.c, we only change the code segment

figure d

in the nts_kem_decapsulate function into the following.

figure e

The modification changes the way the error vector e is computed from \(\sigma ^*\) and \(\xi \) to the way specified in Sect. 3.5 (which is equivalent to what is specified in NTS-KEM’s specifications). The user can replace ntskem_test.c by the modified one replace berlekamp_massey.c by the modified one, apply the same change to nts_kem.c, do make and execute ntskem-*-test. Then the user will again see that the message usually shows after trying a several hundreds of ciphertext-session-key pairs.

E The modified berlekamp_massey.c

figure f
figure g

F The modified ntskem_test.c

figure h
figure i

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Chou, T. (2021). An IND-CCA2 Attack Against the 1st- and 2nd-Round Versions of NTS-KEM. In: Maimut, D., Oprina, AG., Sauveron, D. (eds) Innovative Security Solutions for Information Technology and Communications. SecITC 2020. Lecture Notes in Computer Science(), vol 12596. Springer, Cham. https://doi.org/10.1007/978-3-030-69255-1_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-69255-1_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-69254-4

  • Online ISBN: 978-3-030-69255-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics