The tools for hekit
consist of useful commands for finding HE parameters
based on user constraints. The following sections describe their details and usage.
- python >= 3.8
The command hekit gen-primes
generates a list of sorted primes in range [n,
m] where n and m are positive integers.
The gen-primes
command can be executed with the following options.
Option | Meaning |
---|---|
-h, help |
Show the help message. |
start |
start number. |
stop number |
stop number. |
To run the tool, simply provide start and stop arguments. For example:
hekit gen-primes 1 100
The command hekit algebras
given the plaintext prime p
and the required number of
p-boxes d
returns the available algebras.
The algebras
command can be executed with the following options.
Option | Meaning |
---|---|
-h, help |
Show the help message. |
-p |
Define plaintext prime. Default value is 2. |
-d |
Define number of coefficients in a slot. Default value is 1. |
--no-corrected |
Include corrected d orders. |
--no-header |
Do not print headers. |
The primes that can be used are only those provided in the ~/.hekit/primes.txt
file. If the file is not created by the user, it will be autogenerated with primes in range [2, 140 000]
To run the tool, simply provide a single prime or a range where primes may be, or a combination of the two. For example, searching for algebras where the prime is 2, those between 11 and 25 inclusive, and 31.
hekit algebras -p 2,11-25,31
Searching for algebras that give d
larger than 1 simply pass the flag and
argument in a similar manner to p
. For example, searching algebras with
the same p
, but with d
values of 2 and between 4 to 5, inclusive.
hekit algebras -p 2,11-25,31 -d 2,4-5
For more information run
hekit algebras -h
The table retuned by the searches have the following column headers shown below with their meanings,
Header | Meaning |
---|---|
p |
plaintext prime |
d |
number of coefficients in a slot (a.k.a. p-boxes) |
m |
order of the cyclotomic polynomial |
phi(m) |
the Euler totient of m which is the degree of the ciphertext and plaintext polynomial |
nslots |
the number of slots in a ciphertext and plaintext polynomial (phi(m) / d ) |