Encrypt Command
encrypt cipher_file msgkey_file pubkey_file hvecontent_file
Description:
Generate cipher text with the public key generated in setup and a specific query input.
Generate a session message key, that can be used to decrypt any auxilary files if the query returns success.
Parameter Files:
When encrypt completes, this file will contain a serialized QED cipher text.
Use this file when calling the query command.
When encrypt completes, this file will contain a serialized QED Message Key. The QED Message Key will contain a 160-bit secret that can be used to generate a symmetric key and used to encrypt auxiliary files. This 160-bit secret can be recovered by the party running query if the query is satisfied. For more information on how to do this, please see QED Internals.
Each line of this file will specify the data for a specific sector of the query.
- For Comparison Query at sector n and integer value v to compare against:
C [v] [n]
E [str] [n]
S [str1] [str2] ... [n]
NOTE:
- Setup determins the number, order and type of query in each HVE sector
- Each query must end with an sector index; the index starts at 0
- Comparison type query takes only postive integer values
- Equality type query takes only string values
- Subset type query takes only string values
- Every sector must be populated
If you are not the party that runs the setup algorithm, you will need to get the following information:
Example of hvecontent_file:
(This example builds on the one given in setup section.)
C 5 0 E hello 1 S foo 2
The above three lines will populate the predefined query as follows:
- The first sector is a comparison query populated with the value 5. The query will return success only if the value provided in gentoken is smaller than 5.
- The second sector is an equality query populated with the value "hello". The query will return success only if the value provided in the gentoken is the same as "hello".
- The third sector is a subset query populated with the value "foo". The query will return success only if one of the values provided in the gentoken was the string "foo".
NOTE: The three lines in the hvecontent_file can be written in any order, as long as the sector index, i.e. the last integer value in each line, is kept the same. For example the following will also work:
S foo 2 C 5 0 E hello 1