Leuvenshtein: Efficient FHE-based Edit Distance Computation with Single Bootstrap per Cell

📅 2025-08-20
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
To address the low computational efficiency of Levenshtein distance computation under fully homomorphic encryption (FHE), this paper proposes an efficient ciphertext-based edit distance algorithm tailored for third-generation FHE frameworks such as TFHE. Our method fundamentally restructures the Wagner–Fisher dynamic programming procedure to comply with FHE constraints. Key contributions include: (1) reducing the number of programmable bootstrappings (PBS) per DP table cell from ~94 to just 1; (2) designing a ciphertext character equality comparison mechanism requiring only 2 PBS operations, augmented by lightweight preprocessing; and (3) optimizing the algorithm’s data flow for FHE efficiency. Experiments demonstrate that our approach achieves a 278× speedup over the state-of-the-art TFHE implementation and a 39× improvement over an optimized baseline Wagner–Fisher variant; with preprocessing enabled, performance further improves by 3×. These advances significantly enhance the practicality of privacy-preserving applications—including genomic sequence alignment and financial string analytics—under FHE.

Technology Category

Application Category

📝 Abstract
This paper presents a novel approach to calculating the Levenshtein (edit) distance within the framework of Fully Homomorphic Encryption (FHE), specifically targeting third-generation schemes like TFHE. Edit distance computations are essential in applications across finance and genomics, such as DNA sequence alignment. We introduce an optimised algorithm that significantly reduces the cost of edit distance calculations called Leuvenshtein. This algorithm specifically reduces the number of programmable bootstraps (PBS) needed per cell of the calculation, lowering it from approximately 94 operations -- required by the conventional Wagner-Fisher algorithm -- to just 1. Additionally, we propose an efficient method for performing equality checks on characters, reducing ASCII character comparisons to only 2 PBS operations. Finally, we explore the potential for further performance improvements by utilising preprocessing when one of the input strings is unencrypted. Our Leuvenshtein achieves up to $278 imes$ faster performance compared to the best available TFHE implementation and up to $39 imes$ faster than an optimised implementation of the Wagner-Fisher algorithm. Moreover, when offline preprocessing is possible due to the presence of one unencrypted input on the server side, an additional $3 imes$ speedup can be achieved.
Problem

Research questions and friction points this paper is trying to address.

Efficient FHE-based edit distance computation
Reducing bootstraps per cell from 94 to 1
Optimizing character equality checks with fewer PBS operations
Innovation

Methods, ideas, or system contributions that make the work stand out.

Single bootstrap per cell algorithm
Two PBS equality checks for characters
Preprocessing for unencrypted input strings
W
Wouter Legiest
COSIC, KU Leuven
Jan-Pieter D'Anvers
Jan-Pieter D'Anvers
Researcher, KU Leuven
Fully Homomorphic EncryptionPost-Quantum Cryptography
B
Bojan Spasic
Society for Worldwide Interbank Financial Telecommunication (Swift)
N
Nam-Luc Tran
Society for Worldwide Interbank Financial Telecommunication (Swift)
Ingrid Verbauwhede
Ingrid Verbauwhede
KU Leuven
hardware securityembedded securityelectronicscryptographydesign methods