Abstract
A weak pseudorandom function (weak PRF) is one of the most important cryptographic primitives for its efficiency although it has lower security than a standard PRF. Recently, Boneh et al. (in: Theory of cryptography conference, Springer, pp 699–729, 2018) introduced two types of new weak PRF candidates, which are called a basic Mod-2/Mod-3 and alternative Mod-2/Mod-3 weak PRF. Both use the mixture of linear computations defined on different small moduli to satisfy conceptual simplicity, low complexity (depth-2 \(\mathsf{ACC^0}\)) and MPC friendliness. In fact, the new candidates are conjectured to be exponentially secure against any adversary that allows exponentially many samples, and a basic Mod-2/Mod-3 weak PRF is the only candidate that satisfies all the features above. However, none of the direct attacks which focus on basic and alternative Mod-2/Mod-3 weak PRFs use their own structures. In this paper, we investigate weak PRFs from two perspectives; attacks, fixes. We first propose direct attacks for an alternative Mod-2/Mod-3 weak PRF and a basic Mod-2/Mod-3 weak PRF when a circulant matrix is used as a secret key. For an alternative Mod-2/Mod-3 weak PRF, we prove that the adversary’s advantage is at least \(2^{-0.105n}\), where n is the size of the input space of the weak PRF. Similarly, we show that the advantage of our heuristic attack on the weak PRF with a circulant matrix key is larger than \(2^{-0.21n}\), which is contrary to the previous expectation that ‘structured secret key’ does not affect the security of a weak PRF. Thus, for an optimistic parameter choice \(n = 2\lambda \) for the security parameter \(\lambda \), parameters should be increased to preserve \(\lambda \)-bit security when an adversary obtains exponentially many samples. Next, we suggest a simple method for repairing two weak PRFs affected by our attack. Moreover, we provide the first direct algorithm for a basic Mod-2/Mod-3 weak PRF with a random secret key even though it does not capture the current parameters.



Similar content being viewed by others
Notes
For well-definedness, \(\mathbf{A}\cdot \mathbf{x}\) is interpreted as a binary vector.
In the original paper [13], they used a Toeplitz matrix or a block-circulant matrix as a secret key of weak PRF for its efficiency. However, in this paper, we only deal with the case that a secret key of weak PRF is a circulant matrix which is the same as block-circulant matrix in the original paper. Indeed, they said that block-circulant matrix can be represented by a single vector’.
Note that a new scheme still achieves the ad-hoc security, where it is secure against known attacks.
If we find roots of \(k(\ge 5)\)-xor problem, the advantage induced by them is drastically smaller than \(2^{-m}\) although time complexity of k-xor problem is reduced to \(O(2^{n/(k-1)})\).
In the original paper, the authors mentioned that a ‘block-circulant matrix’ can be represented by a single vector. Thus, a block-circulant matrix is the same as a circulant matrix in this paper.
We call \(\mathbf{a}\) a base vector.
References
Akavia A., Bogdanov A., Guo S., Kamath A., Rosen A.: Candidate weak pseudorandom functions in ac0\(\bigcirc \) mod2. In: Proceedings of the 5th Conference on Innovations in Theoretical Computer Science, pp. 251–260 (2014).
Alperin-Sheriff J., Apon D.: Weak is better: tightly secure short signatures from weak prfs. IACR Cryptol. ePrint Arch. (2017).
Ananth P., Brakerski Z., Segev G., Vaikuntanathan V.: From selective to adaptive security in functional encryption. In: Annual Cryptology Conference, pp. 657–677. Springer (2015).
Applebaum B.: Bootstrapping obfuscators via fast pseudorandom functions. In: International Conference on the Theory and Application of Cryptology and Information Security, pp. 162–172. Springer (2014).
Ball M., Holmgren J., Ishai Y., Liu T., Malkin T.: On the complexity of decomposable randomized encodings, or: How friendly can a garbling-friendly prf be? In: 11th Innovations in Theoretical Computer Science Conference (ITCS 2020). Schloss Dagstuhl-Leibniz-Zentrum für Informatik (2020).
Bellare M.: New proofs for nmac and hmac: security without collision resistance. J. Cryptol. 28(4), 844–878 (2015).
Bellare M., Canetti R., Krawczyk H.: Keying hash functions for message authentication. In: Annual International Cryptology Conference, pp. 1–15. Springer (1996).
Bernstein D.J.: Better price-performance ratios for generalized birthday attacks. (2007).
Bernstein D.J., Lange T., Niederhagen R., Peters C., Schwabe P.: Implementing wagner’s generalized birthday attack against the SHA-3 round-1 candidate FSB. IACR Cryptol. ePrint Arch. 2009, 292 (2009).
Blum A., Kalai A., Wasserman H.: Noise-tolerant learning, the parity problem, and the statistical query model. J. ACM (JACM) 50(4), 506–519 (2003).
Bogdanov A., Rosen A.: Pseudorandom functions: three decades later. In: Tutorials on the Foundations of Cryptography, pp. 79–158. Springer (2017).
Bogos S., Tramer F., Vaudenay S.: On solving lpn using bkw and variants. Cryptogr. Commun. 8(3), 331–369 (2016).
Boneh D., Ishai Y., Passelègue A., Sahai A., Wu D.J.: Exploring crypto dark matter. In: Theory of Cryptography Conference, pp. 699–729. Springer (2018).
Chen Y., Hhan M., Vaikuntanathan V., Wee H.: Matrix prfs: Constructions, attacks, and applications to obfuscation. In: Theory of Cryptography Conference, pp. 55–80. Springer (2019).
Chen Y., Vaikuntanathan V., Wee H.: GGH15 beyond permutation branching programs: proofs, attacks, and candidates. In: CRYPTO 2018, Part II, pp. 577–607 (2018).
Cheon J.H., Cho W., Kim J.H., Kim J.: Adventures in crypto dark matter: Attacks and fixes for weak pseudorandom functions. In Public Key Cryptography 2, 739–760 (2021).
Damgåard I., Nielsen J.B.: Expanding pseudorandom functions; or: From known-plaintext security to chosen-plaintext security. In: Annual International Cryptology Conference, pp. 449–464. Springer (2002).
Dinur I.: An algorithmic framework for the generalized birthday problem. Des. Codes Cryptogr. 87(8), 1897–1926 (2019).
Dinur I., Dunkelman O., Keller N., Shamir A.: Efficient dissection of bicomposite problems with cryptanalytic applications. J. Cryptol. 32(4), 1448–1490 (2019).
Dinur I., Goldfeder S., Halevi T., Ishai Y., Kelkar M., Sharma V., Zaverucha G.: Mpc-friendly symmetric cryptography from alternating moduli: candidates, protocols, and applications. Cryptol. ePrint Arch., Report 2021/885 (2021). To appear CRYPTO 2021.
Dodis Y., Kiltz E., Pietrzak K., Wichs D.: Message authentication, revisited. In: Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 355–374. Springer (2012).
Dodis Y., Steinberger J.: Message authentication codes from unpredictable block ciphers. In: Annual International Cryptology Conference, pp. 267–285. Springer (2009).
Goldreich O.: Two remarks concerning the goldwasser-micali-rivest signature scheme. In: Conference on the Theory and Application of Cryptographic Techniques, pp. 104–110. Springer (1986).
Goldreich O., Goldwasser S., Micali S.: How to construct random functions. J. ACM (JACM) 33(4), 792–807 (1986).
Lyubashevsky V., Masny D.: Man-in-the-middle secure authentication schemes from lpn and weak prfs. In: Annual Cryptology Conference, pp. 308–325. Springer (2013).
Maurer U., Sjödin J.: A fast and key-efficient reduction of chosen-ciphertext to known-plaintext security. In: Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 498–516. Springer (2007).
Micciancio D., Walter M.: On the bit security of cryptographic primitives. In: Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 3–28. Springer (2018).
Naya-Plasencia M., Schrottenloher A.: Optimal merging in quantum k-xor and k-xor-sum algorithms. In: Advances in Cryptology – EUROCRYPT 2020, pp. 311-340. Springer, Cham (2020).
Nikolić I., Sasaki Y.: Refinements of the k-tree algorithm for the generalized birthday problem. In: International Conference on the Theory and Application of Cryptology and Information Security, pp. 683–703. Springer (2015).
Pietrzak K.: A leakage-resilient mode of operation. In: Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 462–482. Springer (2009).
Schrottenloher A.: Improved quantum algorithms for the k-xor problem. IACR Cryptol. ePrint Arch. 2021, 407 (2021).
Wagner D.: A generalized birthday problem. In: Annual International Cryptology Conference, pp. 288–304. Springer (2002).
Acknowledgements
Jung Hee Cheon, Supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2016-6-00598, The mathematical structure of functional encryption and its analysis. Wonhee Cho, Supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2016-6-00598, The mathematical structure of functional encryption and its analysis. Jeong Han Kim, Partially supported by National Research Foundation of Korea (NRF) Grants funded by the Korean Government (MSIP) (NRF-2016R1A5A1008055 & 2017R1E1A1A0307070114) and by a KIAS Individual Grant(CG046002) at Korea Institute of Advanced Study. Jiseung Kim, Part of this work was done while the author was at KIAS.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by D. Stebila.
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This is the full version of a paper published in the proceedings of PKC 2021.
Appendices
Simple Non-Adaptive Attack
In this section, we provide a simple non-adaptive attack of a basic Mod-2/Mod-3 weak PRF, which runs in polynomial time n. The attack is motivated by rank attack [14, 15].
Assume that adversary has exponentially many samples \((\mathbf{z}_i,v_i)\). The goal is to determine whether \(v_i\) is uniformly sampled from \({{\mathbb {Z}}}_3\) or sampled from a Mod-2/Mod-3weak PRF.
Let s be an integer \(> \max \{m,n\}\). Then, our attack is:
-
1.
Find \(s^2\) pairs of vectors \(\{(\mathbf{x}_i,\mathbf{y}_j)\}_{i,j \in [s]}\) such that \(\mathbf{z}_{i,j} = \mathbf{x}_i+ \mathbf{y}_j\) for some \(\mathbf{z}_{i,j}\) in a list of samples.
-
2.
Construct a matrix \(\mathbf{M}= (v_{i,j})\), where \(v_{i,j}\) is a sample corresponding to a vector \(\mathbf{z}_{i,j}\).
-
3.
Compute a rank of \(\mathbf{M}\).
For an analysis, we borrow a polynomial representation of \({\mathcal {F}}_{\mathbf{A}}(\mathbf{x})\) in [13].
where a matrix \(\mathbf{A}=(a_{i,j}) \in \{0.1\}^{m \times n}\) and a vector \(\mathbf{x}=(x_i) \in \{ {0,1} \}^n\). Note that since \(a_{i,j}\) is 0 or 1, the following lemma is trivial.
Lemma A.1
Mod-2/Mod-3 weak PRF is interpreted as a product of matrices. More precisely, for a key \(\mathbf{A}= (a_{i,j}) \in \{ {0,1} \}^{m \times n}\) and a vector \(\mathbf{x}=(x_i) \in \{ {0,1} \}^n\),
where \(\mathbf{A}_i\) is the i-th column of \(\mathbf{A}\), and \(f_i (\mathbf{x}) = \prod _{j=1}^n (1+a_{i,j}x_j)\), and \(\mathsf{diag}(x_i\mathbf{A}_i)\) is a diagonal matrix whose j-th diagonal entry is the same as j-th component of a vector \(x_i\mathbf{A}_i\).
Based on the above lemma, we complete the non-adaptive attack. When \(v_{i,j}\)’s are truly random, a rank of \(\mathbf{M}\) is s with high probability. However, if it is of the form \(\mathsf{map}(\mathbf{A}\cdot ([\mathbf{x}_i+\mathbf{y}_j)]_2)\), then a matrix \(\mathbf{M}\) is divided into a product of two matrices using Lemma A.1.
Hence, a rank of \(\mathbf{M}\) is bounded by \(\min (m,n)\) with high probability. The attack runs in O(n) time and space.
The rank attack only succeeds when an adversary is possible to use an oracle access to input queries. However, in the setting of weak PRF, inputs are selected randomly from \(\{ {0,1} \}^n\), our attack does not work anymore.
Proofs of Theorems
In this section, we provide proofs of Lemma 4.11, Theorems 4.13 and 4.14.
m | 64 | 128 | 196 | 256 | 384 | 512 | 1024 |
\(d_m\) | − 0.53 | 0.18 | − 0.54 | − 0.57 | − 0.49 | 0.31 | − 0.38 |
Proof
(of Lemma 4.11) We easily obtain the following relations.
Therefore, it is enough to confirm that
If \((x_i,y_i)\) is one of (0, 0), (1, 0), and (0, 1), the above identity is trivial.
For the last case \((x_i,y_i) = (1,1)\), the right-hand side of an Eq. (6) is the identity matrix. Moreover, the left-hand side of the equation is the same as \((\mathbf{I}+ \mathsf{diag}(\mathbf{A}_i))^2\). Note that \(1^2 \equiv 2^2 \equiv 1 \bmod 3\), and every element of \(\mathbf{A}\) is binary, it must hold that \((\mathbf{I}+ \mathsf{diag}(\mathbf{A}_i))^2 \equiv \mathbf{I}\bmod 3\). Hence, the proof is completed. \(\square \)
Proof
(of Theorem 4.13) Let \(\{\mathbf{x}_i\}_{i=1}^3\) be vectors such that \(\sum _{i=1}^3 \mathbf{x}_i = \mathbf{0}\bmod 2\). Since a key \(\mathbf{A}\) is randomly chosen matrix, \(f_i(\mathbf{x}_k)\) and \(f_j(\mathbf{x}_k)\) are independent with distinct i, j for all k.
Also, without loss of generality, assume that \(\mathbf{x}_1, \mathbf{x}_2\) are mutually independent since \(\mathbf{x}_3\) can be regarded as \(\mathbf{x}_3 = [\mathbf{x}_1 + \mathbf{x}_2]_2\). Moreover, for sufficient large n, it could be assumed that \(f_i(\mathbf{x}_k)\) is uniformly drawn from \(\{1,2\}\) since for any j, k, \(\Pr [f_j(\mathbf{x}_k)=1] \approx 1/2+ 1/2^{n+1}\), and \(f_j(\mathbf{x}_k)\)’s are independent as stated above.
Then we easily confirm that
Let \(i_1,i_2,i_3\) be the number of i’s that satisfies \(f_i(\mathbf{x}_1)+f_i(\mathbf{x}_2)+f_i(\mathbf{x}_1)f_i(\mathbf{x}_2) \equiv 0,1,2 \bmod 3\), respectively. Then \(\sum _{i=1}^3 ({\mathcal {F}}_{\mathbf{A}}(\mathbf{x}_i)+n) \bmod 3\) is \(i_2+2i_3 \bmod 3\). In this case, \(i_2\) is zero. so, if \(i_3\) is a multiple of 3, then \(f_i(\mathbf{x}_1)+f_i(\mathbf{x}_2)+f_i(\mathbf{x}_1)f_i(\mathbf{x}_2) \bmod 3\) is zero.
According to an Eq. (4), we have that
where \(\zeta \) is 3-rd root of unity, \(\frac{-1+i\sqrt{3}}{2}\) and \(\delta \) is \(\frac{5+i\sqrt{3}}{2\sqrt{7}}\).
\(d_m\) is a value determined according to m. For the parameter m, which is commonly used, it has the following values.
Similarly, for \(k=4\), we can provide a proof by computing almost the same procedures.
Proof
(of Theorem 4.14) Let \(\{\mathbf{x}_i\}_{i=1}^4\) be vectors such that \(\sum _{i=1}^4 \mathbf{x}_i = \mathbf{0}\bmod 2\). Since a key \(\mathbf{A}\) is randomly chosen matrix, \(f_i(\mathbf{x}_k)\) and \(f_j(\mathbf{x}_k)\) are independent with distinct i, j for all k. Without loss of generality, assume that \(\mathbf{x}_1, \mathbf{x}_2, \mathbf{x}_3\) are mutually independent since \(\mathbf{x}_4\) can be regarded as \(\mathbf{x}_4 = [\mathbf{x}_1 + \mathbf{x}_2 +\mathbf{x}_3]_2\). Moreover, for sufficient large n, it could be assumed that \(f_i(\mathbf{x}_k)\) is uniformly drawn from \(\{1,2\}\) since for any j, k, \(\Pr [f_j(\mathbf{x}_k)=1] \approx 1/2+ 1/2^{n+1}\), and \(f_j(\mathbf{x}_k)\)’s are independent as stated above. Then, we observe that
Let \(i_1,i_2,i_3\) be the number of i’s that satisfies \(f_i(\mathbf{x}_1)+f_i(\mathbf{x}_2)+f_i(\mathbf{x}_1)f_i(\mathbf{x}_2)f_i(\mathbf{x}_3) \equiv 0,1,2 \bmod 3\), respectively. Then \(\sum _{i=1}^3 ({\mathcal {F}}_{\mathbf{A}}(\mathbf{x}_i)+n) \bmod 3\) is \(i_2+2i_3 \bmod 3\). \(i_2\) is \(m-i_1-i_3\). so, if \(m-i_1+i_3\) is a multiple of 3, then \(f_i(\mathbf{x}_1)+f_i(\mathbf{x}_2)+f_i(\mathbf{x}_1)f_i(\mathbf{x}_2)f_i(\mathbf{x}_3) \bmod 3\) is zero.
According to the similar analysis, it holds that
where \(\zeta \) is 3-th root of unity, \(\frac{-1+i\sqrt{3}}{2}\). \(\square \)
Rights and permissions
About this article
Cite this article
Cheon, J.H., Cho, W., Kim, J.H. et al. Adventures in crypto dark matter: attacks, fixes and analysis for weak pseudorandom functions. Des. Codes Cryptogr. 90, 1735–1760 (2022). https://doi.org/10.1007/s10623-022-01071-x
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10623-022-01071-x