750.sealcrypto_r
Security and privacy - Homomorphically Encrypted (HE) query
Homomorphic Encryption (HE) is a form of encryption that permits users to perform computations on its encrypted data without first decrypting it.
Privacy preserving search is a common scenario to demonstrate the benefits of homomorphic encryption. Being able to perform a query while preserving the privacy and confidentiality of the parameters of the query has many applications across various industry segments spanning from genomics to finance.
This application implements a database lookup in which both the database and query are encrypted during the entire lookup. The secure query example implements a simple secure database query using the Brakerski/Fan-Vercauteren scheme (BFV) available in the open-source Microsoft library called SEAL, which stands for Simple Encrypted Arithmetic Library. SEAL facilitates building end-to-end homomorphically encrypted data storage and computation services, and is the foundation of this benchmark.
The application consists of 2 component classes and a main file.
The default options are set to allow the application to work well with the current dataset. It uses the following parameters by default:
The Input database is a key-value store pre-populated with provinces/states and their capital cities. There are three different input files used (refrate, train, and test) with varying number of entries to provide three different sizes for the benchmark. Each entry consists of key:value (state name : Capital name) with its first letter capitalized. The contents of the input file used in refrate (ecuador_province_capitals_refrate.csv) is the following:
Azuay,Cuenca
Bolivar,Guaranda
Canar,Azogues
Carchi,Tulcan
Chimborazo,Riobamba
Cotopaxi,Latacunga
El Oro,Machala
Esmeraldas,Esmeraldas
Galapagos,Puerto Baquerizo Moreno
Guayas,Guayaquil
Imbabura,Ibarra
Loja,Loja
Los Rios,Babahoyo
Manabi,Portoviejo
Morona Santiago,Macas
Napo,Tena
Orellana,Puerto Francisco de Orellana
Pastaza,Puyo
Pichincha,Quito
Santa Elena,Santa Elena
Santo Domingo de los Tsachilas,Santo Domingo
Sucumbios,Nueva Loja
Tungurahua,Ambato
Zamora Chinchipe,Zamora
Ecuador,Quito
For a successful execution, the output of the query is the expected value of the key that was inserted in the database. For example, in refrate, the input query is 'Galapagos' and the expected value that represents the capital of the Ecuatorian province is 'Puerto Baquerizo Moreno'
run_refrate:
SEAL BFV context initialized with following parameters
Polymodulus degree: 8192
Plain modulus: 17
Key length: 8
Number of database entries: 25
Encrypting database entries into Ciphertexts
Querying database for key: Galapagos
Decoded database entry: Puerto Baquerizo Moreno
C, C++
The benchmark is single-threaded.
None.
SEAL source can be found under: github.com/microsoft/SEAL. The SPEC CPU sources began with version: 4.0.0 (commit hash a0fc0b7) on Mar 17, 2022.
SEAL is distributed under the MIT License.
Secure Query is derived from the github repository faberga/he-toolkit (which appears to no
longer be available when checked March 2026). The SPEC CPU sources began 24 August 2022
using commit/ad7b83892f7d971da2fbd7c88b3507372ad7a0de from location
faberga/he-toolkit/tree/main/he-samples/examples/secure-query.
This database lookup example is a derived port of the BGV Country Lookup example code that ships with
HElib.
This country lookup example is derived from an earlier BGV database demo code originally written by Jack Crawford for a
lunch and learn session at IBM Research (Hursley) in 2019. The original demo code ships with HElib and can be found
here
Secure Query is distributed under the Apache License 2.0 license.
SPEC added a version of the Mersenne-Twister PRNG that is licensed by its authors (Makoto Matsumoto, Takuji Nishimura, and Mutsuo Saito) under a BSD license.
spec_random_distributions.h is sampled from the LLVM project, which is distributed under the Apache License v2.0 with LLVM Exceptions.
Copyright © 2026 Standard Performance Evaluation Corporation (SPEC®)