Building Encrypted Index Structures for Privacy-Preserving Joins

The Setup_JXT class implements a setup module for constructing two core encrypted index structures—TSet and XSet—used in privacy-enhancing database systems supporting secure equi-joins and keyword queries.

Core Fields

  • K_aes, K_token, K_x, K_y, K_h1, K_h2: Cryptographic keys for AES encryption, token derivation, auxiliary hashing, and Bloom filter seeding.

  • tableId: Numeric identifier for the dataset being processed.

  • nonJoinColCount, joinColCount: Counts of non-join (attribute) columns and join-key columns, respectively.

  • recordCount: Total number of rows in the input table.

  • queryPredicate: A string representing the query context or filtering constraint.

  • recordIds, attrValues, joinKeys: Arrays holding parsed identifiers, non-join attribute values, and join-key values from the dataset.

  • bloomFilter: A probabilistic data structure used to encode join-key presence efficiently in XSet.

  • tokenMap: A Map<BigInteger, List<EncryptedTuple>>, where each key is a deterministic token derived from an attribute-value pair, and each value is a list of encrypted tuple descriptors containing record IDs and ciphertexts.

Constructor Signature

public Setup_JXT(int tableId, int nonJoinCols, int joinCols, int rowCount, String predicate)

Initializes internal state using the provided metadata. No I/O occurs here; file reading and index construction are deefrred to construct().

construct() Workflow

Phase 1: Data Ingestion

  • Allocates storage arrays sized to rowCount.

  • Loads CSV data (e.g., data/table1/table1_k2_j1_10_condition.csv) with columns id, attr1, attr2, join_attr1.

  • Populates reverseIndex, a map from (attributeValue, columnIndex) → List<Integer> of matching record IDs, enabling efficient lookup during token generation.

Phase 2: Index Construction

  • XSet Generation: For each unique join-key value j, computes h1 = H(K_x || j) and h2 = H(K_y || j) using SHA-256. Then inserts h1 XOR h2 in to bloomFilter.

  • TSet Generation: For every non-join attribute column c and its distinct value v, derives a token t = H(K_token || c || v). For each record r where attr[c] == v, creates an EncryptedTuple containing:

    • r.id (plaintext ID),
    • AES(K_aes, r.id) (encrypted ID),
    • H(K_h1, r.id) (hash for verification). These tuples are appended to tokenMap.getOrDefault(t, new ArrayList<>()).

Accessor Methods

  • getTokenMap(): Returns the fully built tokenMap.

  • getBloomFilter(): Returns the finalized bloomFilter instance.

Persistence via Store(String label)

Serializes both tokenMap and bloomFilter into a binary file at data/EDB/JXT_ + label + .dat, using Java object serialization or custom binary encoding depending on implementation.

Usage Example

public class IndexBuilder {
    public static void main(String[] args) {
        Setup_JXT builder = new Setup_JXT(1, 2, 1, 10, "condition");
        builder.construct();
        builder.Store("demo_run");
    }
}

This invocation initializes the builder for a 10-row table with two descriptive attributes and one join key, constructs encrypted indexes reflecting that schema, and writes them to data/EDB/JXT_demo_run.dat.

Tags: Encryption privacy-preserving Database-Indexing bloom-filter secure-join

Posted on Sun, 25 Oct 2026 16:17:21 +0000 by buducom