Skip to main content
QUICK REVIEW

[Paper Review] SANNS: Scaling Up Secure Approximate k-Nearest Neighbors Search

Hao Chen, Ilaria Chillotti|arXiv (Cornell University)|Apr 3, 2019
Cryptography and Data SecurityComputer Science78 references12 citations
TL;DR

SANNS introduces a scalable system for secure k-nearest neighbors search (k-NNS) that protects both client queries and server datasets using homomorphic encryption, garbled circuits, and distributed oblivious RAM. It achieves up to 31× faster response times than prior work and scales to 10 million database entries—over two orders of magnitude beyond previous limits—via an optimized linear scan and a novel sublinear clustering-based algorithm with a new O(n + k²) comparator-based top-k selection protocol.

ABSTRACT

The $k$-Nearest Neighbor Search ($k$-NNS) is the backbone of several cloud-based services such as recommender systems, face recognition, and database search on text and images. In these services, the client sends the query to the cloud server and receives the response in which case the query and response are revealed to the service provider. Such data disclosures are unacceptable in several scenarios due to the sensitivity of data and/or privacy laws. In this paper, we introduce SANNS, a system for secure $k$-NNS that keeps client's query and the search result confidential. SANNS comprises two protocols: an optimized linear scan and a protocol based on a novel sublinear time clustering-based algorithm. We prove the security of both protocols in the standard semi-honest model. The protocols are built upon several state-of-the-art cryptographic primitives such as lattice-based additively homomorphic encryption, distributed oblivious RAM, and garbled circuits. We provide several contributions to each of these primitives which are applicable to other secure computation tasks. Both of our protocols rely on a new circuit for the approximate top-$k$ selection from $n$ numbers that is built from $O(n + k^2)$ comparators. We have implemented our proposed system and performed extensive experimental results on four datasets in two different computation environments, demonstrating more than $18-31 imes$ faster response time compared to optimally implemented protocols from the prior work. Moreover, SANNS is the first work that scales to the database of 10 million entries, pushing the limit by more than two orders of magnitude.

Motivation & Objective

  • To address the critical need for privacy-preserving k-NN search in sensitive domains like healthcare, biometrics, and finance, where both queries and datasets must remain confidential.
  • To design a secure k-NNS protocol that operates efficiently in the semi-honest threat model, ensuring no leakage beyond the output.
  • To scale secure k-NNS to large-scale datasets—specifically up to 10 million entries—pushing the boundary beyond prior systems.
  • To optimize performance through a combination of lattice-based homomorphic encryption, garbled circuits, and distributed oblivious RAM, with new circuit-level improvements.
  • To introduce a novel sublinear-time k-NNS algorithm based on clustering that maintains security while significantly reducing computation and communication.

Proposed method

  • SANNS employs two protocols: a secure linear scan using an optimized top-k selection circuit built from O(n + k²) comparators, and a sublinear clustering-based approach that reduces distance computations.
  • The system integrates lattice-based additively homomorphic encryption (AHE) for secure distance computation, garbled circuits for private comparison logic, and distributed oblivious RAM (DORAM) for secure random access to data.
  • A new circuit design for approximate top-k selection reduces the number of comparators from O(n log n) to O(n + k²), significantly improving efficiency in secure computation.
  • The clustering-based protocol uses k-means to partition the dataset into clusters, then identifies the k closest points only within the nearest clusters, reducing the search space.
  • All protocols are proven secure in the semi-honest model using simulation-based security, ensuring no leakage of inputs beyond the output.
  • The implementation includes optimizations to cryptographic primitives, such as efficient FSS-based DORAM and secure evaluation of distance functions.

Experimental results

Research questions

  • RQ1Can secure k-NN search be efficiently scaled to datasets of 10 million points while preserving privacy?
  • RQ2How can top-k selection be optimized in secure computation to reduce the number of comparators from O(n log n) to O(n + k²)?
  • RQ3Can a sublinear-time k-NNS algorithm be securely implemented using cryptographic primitives like homomorphic encryption and garbled circuits?
  • RQ4What is the performance overhead of secure k-NNS compared to plaintext k-NNS, and how can it be minimized through protocol and circuit design?
  • RQ5To what extent does approximation in the k-NNS result leak information about the dataset, and how can leakage be bounded?

Key findings

  • SANNS achieves up to 31× faster response time than optimally implemented prior work, with 18.5× speedup on fast networks and 31.0× on slow networks.
  • The system scales securely to 10 million database entries—over two orders of magnitude beyond the previous limit—demonstrating practical feasibility for large-scale applications.
  • The linear scan protocol achieves a 1.46× speedup on fast networks and 3.51× on slow networks, with 4.1× improvement in communication efficiency.
  • The clustering-based protocol reduces communication by 39× and achieves the highest performance gain, demonstrating the effectiveness of sublinear search in secure computation.
  • The new top-k selection circuit using O(n + k²) comparators reduces computational overhead compared to traditional O(n log n) approaches.
  • The system outperforms prior work even when using the original, unoptimized implementations of prior protocols, indicating that the speedup is not just due to implementation improvements but also algorithmic innovation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.