Locality-Preserving Hashing for Shifts with Connections to Cryptography

Authors Elette Boyle, Itai Dinur, Niv Gilboa, Yuval Ishai, Nathan Keller, Ohad Klein

Thumbnail PDF


  • Filesize: 0.89 MB
  • 24 pages

Document Identifiers

Author Details

Elette Boyle
  • IDC Herzliya, Israel
  • NTT Research, Sunnyvale, USA
Itai Dinur
  • Ben-Gurion University, Be'er Sheva, Israel
Niv Gilboa
  • Ben-Gurion University, Be'er Sheva, Israel
Yuval Ishai
  • Technion, Haifa, Israel
Nathan Keller
  • Bar-Ilan University, Ramat Gan, Israel
Ohad Klein
  • Bar-Ilan University, Ramat Gan, Israel


We thank Piotr Indyk, Leo Reyzin, David Woodruff, and anonymous reviewers for helpful pointers and suggestions.

Cite AsGet BibTex

Elette Boyle, Itai Dinur, Niv Gilboa, Yuval Ishai, Nathan Keller, and Ohad Klein. Locality-Preserving Hashing for Shifts with Connections to Cryptography. In 13th Innovations in Theoretical Computer Science Conference (ITCS 2022). Leibniz International Proceedings in Informatics (LIPIcs), Volume 215, pp. 27:1-27:24, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2022)


Can we sense our location in an unfamiliar environment by taking a sublinear-size sample of our surroundings? Can we efficiently encrypt a message that only someone physically close to us can decrypt? To solve this kind of problems, we introduce and study a new type of hash functions for finding shifts in sublinear time. A function h:{0,1}ⁿ → ℤ_n is a (d,δ) locality-preserving hash function for shifts (LPHS) if: (1) h can be computed by (adaptively) querying d bits of its input, and (2) Pr[h(x) ≠ h(x ≪ 1) + 1] ≤ δ, where x is random and ≪ 1 denotes a cyclic shift by one bit to the left. We make the following contributions. - Near-optimal LPHS via Distributed Discrete Log. We establish a general two-way connection between LPHS and algorithms for distributed discrete logarithm in the generic group model. Using such an algorithm of Dinur et al. (Crypto 2018), we get LPHS with near-optimal error of δ = Õ(1/d²). This gives an unusual example for the usefulness of group-based cryptography in a post-quantum world. We extend the positive result to non-cyclic and worst-case variants of LPHS. - Multidimensional LPHS. We obtain positive and negative results for a multidimensional extension of LPHS, making progress towards an optimal 2-dimensional LPHS. - Applications. We demonstrate the usefulness of LPHS by presenting cryptographic and algorithmic applications. In particular, we apply multidimensional LPHS to obtain an efficient "packed" implementation of homomorphic secret sharing and a sublinear-time implementation of location-sensitive encryption whose decryption requires a significantly overlapping view.

Subject Classification

ACM Subject Classification
  • Theory of computation → Cryptographic primitives
  • Theory of computation → Sketching and sampling
  • Theory of computation → Nearest neighbor algorithms
  • Sublinear algorithms
  • metric embeddings
  • shift finding
  • discrete logarithm
  • homomorphic secret sharing


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. Adi Akavia, Hayim Shaul, Mor Weiss, and Zohar Yakhini. Linear-regression on packed encrypted data in the two-server model. In Proceedings of the 7th ACM Workshop on Encrypted Computing & Applied Homomorphic Cryptography, WAHC@CCS 2019, pages 21-32. ACM, 2019. Google Scholar
  2. Alexandr Andoni, Piotr Indyk, Dina Katabi, and Haitham Hassanieh. Shift finding in sub-linear time. In SODA 2013, pages 457-465, 2013. Google Scholar
  3. Tugkan Batu, Funda Ergün, Joe Kilian, Avner Magen, Sofya Raskhodnikova, Ronitt Rubinfeld, and Rahul Sami. A sublinear algorithm for weakly approximating edit distance. In STOC 2003, pages 316-324, 2003. Google Scholar
  4. Elette Boyle, Itai Dinur, Niv Gilboa, Yuval Ishai, Nathan Keller, and Ohad Klein. On the noise sensitivity of locality-preserving hashing for shifts. Manuscript in preparation, 2021. Google Scholar
  5. Elette Boyle, Niv Gilboa, and Yuval Ishai. Breaking the circuit size barrier for secure computation under DDH. In CRYPTO 2016, Part I, pages 509-539, 2016. Full version: IACR Cryptology ePrint Archive 2016: 585 (2016). Google Scholar
  6. Elette Boyle, Niv Gilboa, and Yuval Ishai. Group-based secure computation: Optimizing rounds, communication, and computation. In EUROCRYPT 2017, Part II, pages 163-193, 2017. Google Scholar
  7. Zvika Brakerski, Venkata Koppula, and Tamer Mour. NIZK from LPN and trapdoor hash via correlation intractability for approximable relations. In CRYPTO 2020, Part III, pages 738-767, 2020. Google Scholar
  8. Andrei Z. Broder, Moses Charikar, Alan M. Frieze, and Michael Mitzenmacher. Min-wise independent permutations. J. Comput. Syst. Sci., 60(3):630-659, 2000. Google Scholar
  9. Diptarka Chakraborty, Elazar Goldenberg, and Michal Koucký. Streaming algorithms for embedding and computing edit distance in the low distance regime. In STOC 2016, pages 712-725, 2016. Google Scholar
  10. Thomas M. Cover and B. Gopinath. Open Problems in Communication and Computation. Springer-Verlag, 1987. Google Scholar
  11. Itai Dinur, Nathan Keller, and Ohad Klein. An optimal distributed discrete log protocol with applications to homomorphic secret sharing. In CRYPTO 2018, Part III, pages 213-242, 2018. Google Scholar
  12. Yevgeniy Dodis, Rafail Ostrovsky, Leonid Reyzin, and Adam D. Smith. Fuzzy extractors: How to generate strong keys from biometrics and other noisy data. SIAM J. Comput., 38(1):97-139, 2008. Google Scholar
  13. Nico Döttling, Sanjam Garg, Yuval Ishai, Giulio Malavolta, Tamer Mour, and Rafail Ostrovsky. Trapdoor hash functions and their applications. In CRYPTO 2019, pages 3-32, 2019. Google Scholar
  14. Sanjam Garg, Mohammad Hajiabadi, and Rafail Ostrovsky. Efficient range-trapdoor functions and applications: Rate-1 OT and more. In TCC 2020, Proceedings, Part I, pages 88-116, 2020. Google Scholar
  15. Elazar Goldenberg, Robert Krauthgamer, and Barna Saha. Sublinear algorithms for gap edit distance. In David Zuckerman, editor, FOCS 2019, pages 1101-1120, 2019. Google Scholar
  16. Piotr Indyk, Rajeev Motwani, Prabhakar Raghavan, and Santosh S. Vempala. Locality-preserving hashing in multidimensional spaces. In STOC 1997, pages 618-625, 1997. Google Scholar
  17. Tomasz Kociumaka and Barna Saha. Sublinear-time algorithms for computing & embedding gap edit distance. In 61st IEEE Annual Symposium on Foundations of Computer Science, FOCS, pages 1168-1179. IEEE, 2020. Google Scholar
  18. Nathan Linial and Ori Sasson. Non-expansive hashing. In STOC 1996, pages 509-518, 1996. Google Scholar
  19. Henrik Ohlsson, Yonina C Eldar, Allen Y Yang, and S Shankar Sastry. Compressive shift retrieval. IEEE Transactions on Signal Processing, 62(16):4105-4113, 2014. Google Scholar
  20. Claudio Orlandi, Peter Scholl, and Sophia Yakoubov. The rise of Paillier: Homomorphic secret sharing and public-key silent OT. IACR Cryptol. ePrint Arch., 2021:262, 2021. To appear in Eurocrypt 2021. Google Scholar
  21. Stephen C. Pohlig and Martin E. Hellman. An improved algorithm for computing logarithms over GF(p) and its cryptographic significance (corresp.). IEEE Trans. Information Theory, 24(1):106-110, 1978. Google Scholar
  22. John M Pollard. Monte carlo methods for index computation mod p. Mathematics of computation, 32(143):918-924, 1978. Google Scholar
  23. Barna Saha. The Dyck language edit distance problem in near-linear time. In FOCS 2014, pages 611-620, 2014. Google Scholar
  24. Victor Shoup. Lower bounds for discrete logarithms and related problems. In EUROCRYPT 97, pages 256-266, 1997. Google Scholar
Questions / Remarks / Feedback

Feedback for Dagstuhl Publishing

Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail