Table 3: Distributed KNN prediction time for K = 3, 5, 7.
S.N.
No. of Edge
Nodes (n)
NuFHE
(Time)
OpenFHE
(Time)
NuFHE
(Time)
OpenFHE
(Time)
NuFHE
(Time)
OpenFHE
(Time)
K=3 K=5 K=7
1 1 11.06hr 7.31hr 11.12hr 7.38hr 11.16hr 7.54hr
2 2 5.54hr 3.66hr 5.55hr 3.71hr 5.57hr 3.77hr
3 3 3.67hr 2.43hr 3.70hr 2.48hr 3.72hr 2.50hr
4 6 1.84hr 1.20hr 1.85hr 1.23hr 1.87hr 1.25hr
on a distributed edge network. The experimentation
was conducted using varying numbers of edge nodes
and different standard neighbor values (K), specifi-
cally 3, 5, and 7. The comparison results for NuFHE
and OpenFHE framework for distributed encrypted
KNN computation are presented in Table3. It is ob-
served that NuFHE with its supported parallel pro-
cessing power works better when more than 20 cores
are present in the selected platform. However, in
our Raspberry Pi board only 4 cores are present and
OpenFHE with the improved bootstrapping works
better in this scenario.
5 CONCLUSION AND FUTURE
WORK
In this work, we have distributed the encrypted com-
putations for KNN among up to six edge devices.
The prediction process takes around 1.2 hours. Al-
though some may argue that the encrypted ML pro-
cessing time is slower than plaintext prediction time
and therefore not practical for real-world applications,
it is important to note that our end-to-end encrypted
framework is suitable for applications where real-time
ML prediction may not be a requirement and out-
comes are acceptable within a few hours. In our future
work, we plan to incorporate other standard ML algo-
rithms in this encrypted ML processing framework on
the edge cluster.
REFERENCES
NuFHE. [Online] https://github.com/nucypher/nufhe.
OpenFHE. [Online] https://www.openfhe.org/.
TFHE. [Online] https://tfhe.github.io/tfhe/.
Chatterjee, A. and Sengupta, I. (2015). Searching and sort-
ing of fully homomorphic encrypted data on cloud.
IACR Cryptol. ePrint Arch., 2015:981.
Chatterjee, A. and Sengupta, I. (2018). Translating algo-
rithms to handle fully homomorphic encrypted data
on the cloud. IEEE Transactions on Cloud Comput-
ing, 6(1):287–300.
Chien, H.-J., Khalili, H., Hass, A., and Sehatbakhsh, N.
(2023). Enc2: Privacy-preserving inference for tiny
iots via encoding and encryption. In Proceedings of
the 29th Annual International Conference on Mobile
Computing and Networking, pages 1–16.
Gouert, C., Mouris, D., and Tsoutsos, N. (2023). Sok: New
insights into fully homomorphic encryption libraries
via standardized benchmarks. Proceedings on privacy
enhancing technologies.
Micciancio, D. and Polyakov, Y. (2021). Bootstrapping in
fhew-like cryptosystems. In Proceedings of the 9th on
Workshop on Encrypted Computing & Applied Homo-
morphic Cryptography, WAHC ’21, page 17–28, New
York, NY, USA. Association for Computing Machin-
ery.
Natarajan, D. and Dai, W. (2021). Seal-embedded: A
homomorphic encryption library for the internet of
things. IACR Transactions on Cryptographic Hard-
ware and Embedded Systems, pages 756–779.
Reddy, B. and Chatterjee, A. (2019). Encrypted Classifica-
tion Using Secure K-Nearest Neighbour Computation,
pages 176–194.
Rizvi, S., Orr, R., Cox, A., Ashokkumar, P., and Rizvi,
M. R. (2020). Identifying the attack surface for iot
network. Internet of Things, 9:100162.
Shrestha, R. and Kim, S. (2019). Integration of iot with
blockchain and homomorphic encryption: Challeng-
ing issues and opportunities. In Advances in comput-
ers, volume 115, pages 293–331. Elsevier.
Singh, S., Sulthana, R., Shewale, T., Chamola, V., Bensli-
mane, A., and Sikdar, B. (2021). Machine-learning-
assisted security and privacy provisioning for edge
computing: A survey. IEEE Internet of Things Jour-
nal, 9(1):236–260.
Sinha, S., Saha, S., Alam, M., Agarwal, V., Chatterjee,
A., Mishra, A., Khazanchi, D., and Mukhopadhyay,
D. (2022). Exploring bitslicing architectures for en-
abling fhe-assisted machine learning. IEEE Trans-
actions on Computer-Aided Design of Integrated Cir-
cuits and Systems, 41(11):4004–4015.
Xiao, Y., Jia, Y., Liu, C., Cheng, X., Yu, J., and Lv, W.
(2019). Edge computing security: State of the art and
challenges. Proceedings of the IEEE, 107(8):1608–
1631.
Encrypted KNN Implementation on Distributed Edge Device Network
685