Abstract
A zero-knowledge proof (ZKP) allows a party to prove to another party that it knows some secret, such as the solution to a difficult puzzle, without revealing any information about it. We propose a physical zero-knowledge proof using only a deck of playing cards for solutions to a pencil puzzle called Moon-or-Sun. In this puzzle, one is given a grid of cells on which rooms, marked by thick black lines surrounding a connected set of cells, may contain a number of cells with a moon or a sun symbol. The goal is to find a loop passing through all rooms exactly once, and in each room either passes through all cells with a moon, or all cells with a sun symbol.
Finally, whenever the loop passes from one room to another, it must go through all cells with a moon if in the previous room it passed through all cells with a sun, and visa-versa. This last rule constitutes the main challenge for finding a physical zero-knowledge proof for this puzzle, as this must be verified without giving away through which borders the loop enters or leaves a given room. We design a card-based zero-knowledge proof of knowledge protocol for Moon-or-Sun solutions, together with an analysis of their properties. Our technique of verifying the alternation of a pattern along a non-disclosed path might be of independent interest for similar puzzles.
Keywords
- Physical Zero-knowledge Proof
- Pencil Puzzle
- Card-based Cryptography
- Moon-or-Sun
- Nikoli Puzzle
This is a preview of subscription content, access via your institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
- 2.
Remember that the value of a commitment on a cell indicates the presence of line passing through the cell.
- 3.
This means that rule 3 can be simultaneously verified for the target room.
References
Nikoli, Moon-or-Sun. https://www.nikoli.co.jp/en/puzzles/moon_or_sun/
Ben-Or, M., et al.: Everything provable is provable in zero-knowledge. In: Goldwasser, S. (ed.) CRYPTO 1988. LNCS, vol. 403, pp. 37–56. Springer, New York (1990). https://doi.org/10.1007/0-387-34799-2_4
Boer, B.: More efficient match-making and satisfiability the five card trick. In: Quisquater, J.-J., Vandewalle, J. (eds.) EUROCRYPT 1989. LNCS, vol. 434, pp. 208–217. Springer, Heidelberg (1990). https://doi.org/10.1007/3-540-46885-4_23
Bultel, X., Dreier, J., Dumas, J., Lafourcade, P.: Physical zero-knowledge proofs for Akari, Takuzu, Kakuro and KenKen. In: Fun with Algorithms. LIPIcs, vol. 49, pp. 8:1–8:20. Schloss Dagstuhl, Dagstuhl (2016)
Bultel, X., et al.: Physical zero-knowledge proof for Makaro. In: Izumi, T., Kuznetsov, P. (eds.) SSS 2018. LNCS, vol. 11201, pp. 111–125. Springer, Cham (2018). https://doi.org/10.1007/978-3-030-03232-6_8
Chien, Y.-F., Hon, W.-K.: Cryptographic and physical zero-knowledge proof: from Sudoku to Nonogram. In: Boldi, P., Gargano, L. (eds.) FUN 2010. LNCS, vol. 6099, pp. 102–112. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-13122-6_12
Dumas, J.-G., Lafourcade, P., Miyahara, D., Mizuki, T., Sasaki, T., Sone, H.: Interactive physical zero-knowledge proof for Norinori. In: Du, D.-Z., Duan, Z., Tian, C. (eds.) COCOON 2019. LNCS, vol. 11653, pp. 166–177. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-26176-4_14
Gradwohl, R., Naor, M., Pinkas, B., Rothblum, G.N.: Cryptographic and physical zero-knowledge proof systems for solutions of Sudoku puzzles. Theory Comput. Syst. 44(2), 245–268 (2009)
Isuzugawa, R., Miyahara, D., Mizuki, T.: Zero-knowledge proof protocol for cryptarithmetic using dihedral cards. In: Kostitsyna, I., Orponen, P. (eds.) UCNC 2021. LNCS, vol. 12984, pp. 51–67. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-87993-8_4
Iwamoto, C., Ide, T.: Moon-or-Sun, Nagareru, and Nurimeizu are NP-complete. IEICE Trans. Fundam. 105(9), 1187–1194 (2022)
Komano, Y., Mizuki, T.: Physical zero-knowledge proof protocol for Topswops. In: Su, C., Gritzalis, D., Piuri, V. (eds.) ISPEC 2022. LNCS, vol. 13620, pp. 537–553. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-21280-2_30
Komano, Y., Mizuki, T.: Card-based zero-knowledge proof protocol for pancake sorting. In: Bella, G., Doinea, M., Janicke, H. (eds.) SecITC 2022. LNCS, vol. 13809, pp. 222–239. Springer, Cham (2023). https://doi.org/10.1007/978-3-031-32636-3_13
Lafourcade, P., Miyahara, D., Mizuki, T., Robert, L., Sasaki, T., Sone, H.: How to construct physical zero-knowledge proofs for puzzles with a “single loop” condition. Theor. Comput. Sci. 888, 41–55 (2021)
Miyahara, D., Sasaki, T., Mizuki, T., Sone, H.: Card-based physical zero-knowledge proof for Kakuro. IEICE Trans. Fundam. 102-A(9), 1072–1078 (2019)
Miyahara, D., Ueda, I., Hayashi, Y., Mizuki, T., Sone, H.: Evaluating card-based protocols in terms of execution time. Int. J. Inf. Secur. 20, 729–740 (2021)
Mizuki, T., Asiedu, I.K., Sone, H.: Voting with a logarithmic number of cards. In: Mauri, G., Dennunzio, A., Manzoni, L., Porreca, A.E. (eds.) UCNC 2013. LNCS, vol. 7956, pp. 162–173. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-39074-6_16
Mizuki, T., Sone, H.: Six-card secure AND and four-card secure XOR. In: Deng, X., Hopcroft, J.E., Xue, J. (eds.) FAW 2009. LNCS, vol. 5598, pp. 358–369. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-02270-8_36
Robert, L., Miyahara, D., Lafourcade, P., Mizuki, T.: Card-based ZKP for connectivity: applications to Nurikabe, Hitori, and Heyawake. New Gener. Comput. 40, 149–171 (2022)
Robert, L., Miyahara, D., Lafourcade, P., Mizuki, T.: Card-based ZKP protocol for Nurimisaki. In: Devismes, S., Petit, F., Altisen, K., Luna, G.A.D., Anta, A.F. (eds.) SSS 2022. LNCS, vol. 13751, pp. 285–298. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-21017-4_19
Robert, L., Miyahara, D., Lafourcade, P., Mizuki, T.: Hide a liar: card-based ZKP protocol for Usowan. In: Du, D., Du, D., Wu, C., Xu, D. (eds.) TAMC 2022. LNCS, vol. 13571, pp. 201–217. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-20350-3_17
Robert, L., Miyahara, D., Lafourcade, P., Libralesso, L., Mizuki, T.: Physical zero-knowledge proof and NP-completeness proof of Suguru puzzle. Inf. Comput. 285, 1–14 (2022)
Robertson, N., Sanders, D.P., Seymour, P.D., Thomas, R.: Efficiently four-coloring planar graphs. In: Miller, G.L. (ed.) ACM Symposium on the Theory of Computing, pp. 571–575. ACM (1996)
Ruangwises, S.: An improved physical ZKP for Nonogram. In: Du, D.-Z., Du, D., Wu, C., Xu, D. (eds.) COCOA 2021. LNCS, vol. 13135, pp. 262–272. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-92681-6_22
Ruangwises, S., Itoh, T.: Physical zero-knowledge proof for Numberlink puzzle and k vertex-disjoint paths problem. New Gener. Comput. 39(1), 3–17 (2021)
Ruangwises, S., Itoh, T.: Physical ZKP for connected spanning subgraph: applications to bridges puzzle and other problems. In: Kostitsyna, I., Orponen, P. (eds.) UCNC 2021. LNCS, vol. 12984, pp. 149–163. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-87993-8_10
Ruangwises, S., Itoh, T.: Securely computing the n-variable equality function with 2n cards. Theor. Comput. Sci. 887, 99–110 (2021)
Ruangwises, S., Itoh, T.: How to physically verify a rectangle in a grid: a physical ZKP for Shikaku. In: Fraigniaud, P., Uno, Y. (eds.) Fun with Algorithms. LIPIcs, vol. 226, pp. 24:1–24:12. Schloss Dagstuhl (2022)
Ruangwises, S., Itoh, T.: Physical ZKP for Makaro using a standard deck of cards. In: Du, D., Du, D., Wu, C., Xu, D. (eds.) TAMC 2022. LNCS, vol. 13571, pp. 43–54. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-20350-3_5
Ruangwises, S., Itoh, T.: Two standard decks of playing cards are sufficient for a ZKP for Sudoku. New Gener. Comput. 40(1), 49–65 (2022)
Sasaki, T., Miyahara, D., Mizuki, T., Sone, H.: Efficient card-based zero-knowledge proof for Sudoku. Theor. Comput. Sci. 839, 135–142 (2020)
Shinagawa, K., et al.: Card-based protocols using regular polygon cards. IEICE Trans. Fundam. 100-A(9), 1900–1909 (2017)
Acknowledgements
We thank the anonymous referees, whose comments have helped us improve the presentation of the paper. The fourth author was supported in part by Kayamori Foundation of Informational Science Advancement and JSPS KAKENHI Grant Number JP23H00479. The third and fifth authors were partially supported by the French ANR project ANR-18-CE39-0019 (MobiS5). Other programs also fund to write this paper, namely the French government research program “Investissements d’Avenir” through the IDEX-ISITE initiative 16-IDEX-0001 (CAP 20-25) and the IMobS3 Laboratory of Excellence (ANR-10-LABX-16-01). Finally, the French ANR project DECRYPT (ANR-18-CE39-0007) and SEVERITAS (ANR-20-CE39-0009) also subsidize this work.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
A Full Description of XOR and Copy Protocols
A Full Description of XOR and Copy Protocols
XOR Protocol. Given commitments to \(a,b\in \{0,1\}\), the Mizuki–Sone XOR protocol [17] outputs a commitment to \(a\oplus b\):

This protocol proceeds as follows.
-
1.
Rearrange the sequence:
.
-
2.
Apply a random bisection cut:
.
-
3.
Rearrange the sequence:
.
-
4.
Reveal the first and second cards in the sequence to obtain the output commitment as follows:
.
Copy Protocol. Given a commitment to \(a\in \{0,1\}\) along with two commitments to 0, the Mizuki–Sone copy protocol [17] outputs two commitments to a:

This protocol proceeds as follows.
-
1.
Rearrange the sequence as follows:
-
2.
Apply a random bisection cut to the sequence as follows:
-
3.
Rearrange the sequence as follows:
-
4.
Reveal the first and second cards in the sequence to obtain the output commitments as follows:
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Hand, S., Koch, A., Lafourcade, P., Miyahara, D., Robert, L. (2023). Check Alternating Patterns: A Physical Zero-Knowledge Proof for Moon-or-Sun. In: Shikata, J., Kuzuno, H. (eds) Advances in Information and Computer Security. IWSEC 2023. Lecture Notes in Computer Science, vol 14128. Springer, Cham. https://doi.org/10.1007/978-3-031-41326-1_14
Download citation
DOI: https://doi.org/10.1007/978-3-031-41326-1_14
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-41325-4
Online ISBN: 978-3-031-41326-1
eBook Packages: Computer ScienceComputer Science (R0)