Fast Privacy-Preserving Text Classification based on Secure Multiparty Computation

We propose a privacy-preserving Naive Bayes classifier and apply it to the problem of private text classification. In this setting, a party (Alice) holds a text message, while another party (Bob) holds a classifier. At the end of the protocol, Alice will only learn the result of the classifier applied to her text input and Bob learns nothing. Our solution is based on Secure Multiparty Computation (SMC). Our Rust implementation provides a fast and secure solution for the classification of unstructured text. Applying our solution to the case of spam detection (the solution is generic, and can be used in any other scenario in which the Naive Bayes classifier can be employed), we can classify an SMS as spam or ham in less than 340ms in the case where the dictionary size of Bob’s model includes all words (<inline-formula> <tex-math notation="LaTeX">$n = 5200$ </tex-math></inline-formula>) and Alice’s SMS has at most <inline-formula> <tex-math notation="LaTeX">$m = 160$ </tex-math></inline-formula> unigrams. In the case with <inline-formula> <tex-math notation="LaTeX">$n = 369$ </tex-math></inline-formula> and <inline-formula> <tex-math notation="LaTeX">$m = 8$ </tex-math></inline-formula> (the average of a spam SMS in the database), our solution takes only 21ms.

Paper

Similar papers

© 2026 NYSGPT2525 LLC