Preprint
Article

This version is not peer-reviewed.

DFB-PPGSQ: Dynamic Forward/Backward-Private Graph Similarity Matching Query over Encrypted Sensor Graph Databases

Submitted:

22 June 2026

Posted:

22 June 2026

You are already at the latest version

Abstract
Sensor-network, Internet of Things, industrial-monitoring, and cyber-physical security graphs are increasingly outsourced to clouds, where similarity search should be supported without exposing graph content, query graphs, update contents, or database evolution. Existing privacy-preserving graph similarity schemes mainly target static encrypted databases and therefore handle insertions, deletions, label updates, and long-running index maintenance poorly. This paper proposes DFB-PPGSQ, a dynamic forward/backward-private graph similarity matching scheme that moves branch-based lower-bound filtering into a structured-encryption framework. DFB-PPGSQ uses epoch-local feature tokens, per-record occurrence handles, one-time update labels, update buffers, deletion tombstones, and shuffle-based branch-tree re-randomization to preserve pruning efficiency while bounding temporal leakage. We formalize the system model, leakage functions, algorithms, and security interpretation, and implement a reproducible Python prototype with HMAC-SHA256 token generation and multi-profile dynamic sensor-topology workloads. Across five random seeds, DFB-PPGSQ keeps query latency close to the static branch-tree baseline (46.60 ms versus 44.72 ms at 4000 graphs), avoids immediate full-rebuild updates (0.091 ms insertion and 0.092 ms label update), and keeps metadata-assisted cross-epoch token linkage below 5.6% attack success after refresh in additional industrial and campus IoT stress workloads.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  

1. Introduction

Graph is a natural data structure for describing entities and their internal relationships. In sensor networks, vertices can represent deployed sensors and edges can describe communication links. In industrial IoT, vertices can denote controllers, actuators, events, or data streams, and edges can express operational dependency. In cyber-physical security, a graph may capture provenance paths, alert correlations, or lateral-movement traces. Such graph data are valuable. They are also sensitive. Sensors applications are often resource constrained and security sensitive, so privacy mechanisms must be lightweight enough for practical IoT deployments [1].
Cloud computing provides an attractive platform for storing and querying large graph databases. A client can outsource the graph database and obtain scalable computation. However, the cloud and the client usually belong to different trust domains. The cloud can be honest in executing protocols, but curious about graph structures, labels, queries, and query results. Therefore, graph data are often encrypted before outsourcing. A meaningful encrypted graph service should still support useful operations. Graph similarity matching query is one of them.
Graph similarity matching retrieves data graphs whose distance to a query graph is no larger than a user-specified threshold. It is more tolerant than exact graph matching. This tolerance is necessary in practical sensing and monitoring applications, because data collection is noisy, device states are incomplete, labels can change over time, and inter-sensor dependencies may drift in dynamic environments [2]. A strict exact match may miss useful results. A similarity query can recover them.
Recent privacy-preserving graph similarity matching query schemes have made important progress. PGSim and PrigSim protect graph similarity search over encrypted data by combining graph filters and secure query processing [3,4]. The recent PPGSQ scheme improves efficiency by adopting a branch-based lower bound of edit distance and a branch-tree index [5]. The idea is elegant. A branch captures a center vertex, its incident edge labels, and neighboring vertex labels. Since a single graph edit operation affects a limited number of branches, branch-based filtering gives a tighter lower bound than a global label filter. It can prune more mismatched data graphs.
However, current PPGSQ-style systems are primarily static. This is a narrow assumption for real cloud graph services. A sensor-cloud database changes continuously. New devices join. Old devices disappear. Labels are corrected. An abnormal event is reclassified. A communication edge is removed. The database evolves.
This dynamic setting changes the security problem. If encrypted branch tags remain stable, the cloud can link updates to previous queries. If deleted graphs leave stale index traces, future queries may reveal information about removed objects. If label updates are implemented as delete-and-insert operations without privacy control, the cloud may infer which branch features changed. In long-running services, even small leakages accumulate. The problem is not only efficiency. It is temporal privacy.
This paper asks the following question:
Can we support efficient graph similarity matching over encrypted graph databases while allowing insertions, deletions, label updates, and periodic index re-randomization with forward and backward privacy?
We answer this question by proposing DFB-PPGSQ. The scheme keeps the useful branch-based filtering principle, but redesigns the encrypted index as a dynamic structured-encryption object. The index evolves across epochs. Update tokens are one-time and unlinkable across time. Deleted records are represented by bounded tombstone information and are removed or re-randomized during epoch compaction. The branch-tree index is preserved for efficient pruning, but its labels and counters are refreshed by epoch keys.
The main contributions of this paper are summarized as follows.
  • We formulate dynamic forward/backward-private PPGSQ. We extend the static graph similarity matching query model to support graph insertion, graph deletion, vertex/edge label update, and periodic re-randomization. We define the syntax, threat model, leakage functions, and privacy goals for dynamic encrypted graph similarity services.
  • We design a dynamic branch-based encrypted index. DFB-PPGSQ constructs epoch-local feature tokens, per-record occurrence handles, encrypted branch-count vectors, update buffers, deletion tombstones, and a re-randomizable branch-tree index. The construction supports efficient filtering without forcing the cloud to traverse the whole database after each update.
  • We integrate forward and backward privacy with graph filtering. Search tokens generated before an update cannot be used to identify future inserted or updated branch features. Future queries reveal only bounded information about deleted graphs. Periodic re-randomization further reduces long-term linkability of branch identifiers and tree nodes.
  • We provide a reproducible prototype evaluation. We implement the protocol-relevant operations of DFB-PPGSQ in Python, including branch extraction, HMAC-based token generation, update buffering, tombstone filtering, epoch refresh, and generated dynamic sensor-topology workloads. The evaluation compares DFB-PPGSQ with static scan, static branch-tree, feature-only dynamic SSE, rebuild-after-update, and no-re-randomization baselines.
The remainder of this paper is organized as follows. Section 2 reviews related work. Section 3 presents the system model, threat model, notation, and security definitions. Section 4 introduces preliminaries. Section 5 gives the detailed construction of DFB-PPGSQ. Section 6 analyzes security. Section 7 presents the prototype implementation and experimental results. Section 8 concludes this paper.

3. Problem Formulation

3.1. System Model

The system model contains two primary entities: the client and the cloud. It can also include authorized users in a multi-user deployment, but this paper focuses on the single-client setting first.

Client.

The client owns a dynamic graph database. It extracts graph features, generates cryptographic keys, encrypts graph records, constructs secure indexes, and issues update/query tokens. The client is trusted. It may be a sensor data owner, an IoT service operator, or a security monitoring platform.

Cloud.

The cloud stores encrypted graphs and secure indexes. It receives update tokens and query tokens from the client. It executes update, filtering, pruning, and candidate retrieval procedures on encrypted data. The cloud returns encrypted candidate graphs to the client.
Figure 1 summarizes the system-level interaction. The trusted client keeps plaintext graphs, master keys, and workload semantics locally. It uploads only encrypted graph records and protected index material. Later, it sends update tokens, query tokens, and epoch re-randomization material to the cloud. The cloud is honest-but-curious. It stores the encrypted graph database, the branch-tree index, the update buffer, the tombstone set, and the re-randomization state. It performs token-authorized filtering and returns encrypted candidates for local decryption and optional refinement.
The dynamic graph database at logical time t is denoted by
G t = { G 1 t , G 2 t , , G N t t } .
Each graph G = ( V , E , L V , L E ) contains a vertex set V, an edge set E, a vertex-label function L V , and an edge-label function L E . A query graph is denoted by Q. The query threshold is denoted by τ . The query result consists of encrypted graphs whose graph edit distance to Q is no larger than τ .
DFB-PPGSQ supports the following operations:
  • Insert: add a new graph G to the encrypted database;
  • Delete: remove an existing graph G i from the active database;
  • UpdateLabel: modify one or more vertex labels or edge labels in an active graph;
  • Search: retrieve encrypted candidate graphs that satisfy the similarity threshold;
  • ReRand: re-randomize feature tokens, occurrence handles, tree nodes, counters, and active-record handles at an epoch boundary.

3.2. Threat Model

The cloud is honest-but-curious. It follows the protocol, but it attempts to infer information from encrypted graphs, secure indexes, update tokens, query tokens, search traces, access patterns, result sizes, tree traversal paths, and timing metadata. This is the same broad server model used by many searchable-encryption systems.
The client is trusted. It generates keys correctly and does not leak plaintext graph data. Network channels between the client and authorized users can be protected by standard authenticated encryption. Denial-of-service attacks, malicious result omission, collusion between users, and side-channel leakage from implementation details are outside the main model.
The cloud may possess auxiliary knowledge. It may know public graph distributions, common sensor labels, partial plaintext graphs, or historical workload statistics. This knowledge makes leakage control more important.

3.3. Notation

Table 2 lists the main symbols used in this paper.

3.4. Scheme Definition

A DFB-PPGSQ scheme consists of the following polynomial-time algorithms:
Π = ( KeyGen , Setup , UpdateToken , ApplyUpdate , TrapGen , Query , ReRand ) .

KeyGen ( 1 λ ) K .

Given the security parameter, the client generates master keys for encryption, pseudo-random functions, pseudo-random permutations, order or comparison modules, and epoch evolution.

Setup ( K , G 0 ) ( EDB 0 , I 0 , st 0 ) .

The client encrypts the initial graph database, extracts branch multisets, builds the initial secure branch-tree index, and initializes client state.

UpdateToken ( K , st , op ) Δ .

For an insertion, deletion, or label update, the client generates an update token Δ . The token contains only encrypted feature handles and masked metadata needed by the cloud.

ApplyUpdate ( EDB , I , U , D , Δ ) ( EDB , I , U , D ) .

The cloud applies the update token. It inserts encrypted records into the update buffer, marks deleted records, or updates encrypted label-derived branch features.

TrapGen ( K , st , Q , τ ) T Q .

The client extracts the branch multiset of the query graph and generates a query token for the current epoch and active update buffers.

Query ( EDB , I , U , D , T Q ) R .

The cloud computes encrypted branch lower bounds, prunes candidate graphs using the branch-tree index, checks active-record states, and returns encrypted candidates.

ReRand ( K , st , e ) Ω e .

At an epoch boundary, the client generates a shuffled refresh package. The cloud replaces the old branch tree, active-record handles, and update buffers with the new package, but it does not receive an old-handle to new-handle correspondence table.

3.5. Privacy Goals

DFB-PPGSQ aims to achieve content privacy, query privacy, forward privacy, backward privacy, and bounded re-randomization leakage.

Content privacy.

The cloud should not learn plaintext graph structures, vertex labels, edge labels, query graphs, or update contents beyond the defined leakage functions.

Query privacy.

The cloud should not learn the plaintext query graph. It may learn bounded query leakage, such as result size and a protected traversal trace, depending on the selected security-performance configuration.

Forward privacy.

Search tokens issued before an insertion or label update should not enable the cloud to identify whether the newly inserted or newly updated branch features match previous queries. In other words, future updates are protected from past searches.

Backward privacy.

After a graph is deleted, future search tokens should not reveal information about that deleted graph beyond bounded deletion leakage. The strongest form hides the deleted graph from future results and search traces after compaction. A practical form allows temporary tombstone leakage within the current epoch and removes it at re-randomization.

Re-randomization privacy.

Across epochs, refreshed feature tokens, occurrence handles, tree-node handles, and active-record handles should not be linkable by the cloud except through explicitly leaked size buckets, update timing, and migration counts.

4. Preliminaries

4.1. Branch-Based Lower Bound of Edit Distance

A branch is a local graph feature centered at a vertex. It contains the center vertex label, the labels of incident edges, and the labels of neighboring vertices. The branch multiset of graph G is denoted by B ( G ) .
For a branch b and a vertex label , the branch and vertex multiplicities of G are written as
C B ( G , b ) = | { b B ( G ) : b = b } | , C V ( G , ) = | { v V ( G ) : L V ( v ) = } | .
Let B G , Q = B ( G ) B ( Q ) and L G , Q = L V ( G ) L V ( Q ) be the union domains induced by a data graph and a query graph. The branch and vertex residuals are
Δ B ( G , Q ) = b B G , Q | C B ( G , b ) C B ( Q , b ) | ,
Δ V ( G , Q ) = L G , Q | C V ( G , ) C V ( Q , ) | .
Following the branch-based filtering principle, a computable lower-bound score is
LBED ( G , Q ) = max Δ B ( G , Q ) 2 , Δ V ( G , Q ) 2 .
If LBED ( G , Q ) > τ , G cannot be a valid answer and can be pruned before exact refinement. This score is not used as a final graph edit-distance estimator. It is used as a safe filtering signal.
This filtering principle is central to PPGSQ-style systems. DFB-PPGSQ retains it. The new challenge is to maintain branch features under dynamic encrypted updates without exposing temporal correlations.

4.2. Structured Encryption

Structured encryption allows a client to outsource encrypted data structures while enabling controlled server-side operations [33]. A leakage function specifies what the server may learn during setup, update, and query. Security is defined by simulation: whatever the real server observes should be simulatable from the allowed leakage.
DFB-PPGSQ treats the encrypted branch index as a structured-encryption object. Branch identifiers are produced by pseudo-random functions. Counters are masked or encrypted. Tree nodes are re-randomized across epochs. Update tokens are generated from evolving keys.
The construction separates two token namespaces. In epoch e, the query-matchable feature token of branch b is
θ b e = F K F e ( canon ( b ) ) ,
where canon ( b ) is a canonical encoding of the branch. This token is deterministic only inside one epoch and is the object that query tokens can match. For storage, the client additionally derives a per-record occurrence handle
η b , i , c e = F K O e ( θ b e h i e c r i ) , h i e = F K D e ( id i e ) ,
where r i is a graph-local nonce and c is an occurrence counter. The occurrence handle hides repeated occurrences and record membership; it is never used as the query key. This separation keeps feature matching well-defined while preventing the graph-local nonce from breaking query-token equality. The protected count stored at bucket j = H K H e ( b ) mod m is
C ˜ G e [ j ] = C G e [ j ] + F K C e ( id G j ) ( mod p ) .
Only query-authorized masks can be cancelled or compared. Thus, the cloud obtains enough information to run the filtering predicate, but it does not receive plaintext branches or stable cross-epoch identifiers.

4.3. Forward and Backward Privacy

Forward privacy prevents a server from linking future inserted data to previous search tokens. A common method is to use key evolution or one-time update labels. In DFB-PPGSQ, the update key for epoch e is derived through a one-way key chain,
K U e , u = F K U e ( upd u ) , K U e + 1 = F K R ( K U e e ) ,
where u is a monotone update counter and K R is the re-randomization master key. The server cannot derive the label of a future update from a past search token.
Backward privacy controls leakage from deleted data. If a document, graph, or branch feature is deleted, later searches should not reveal it. Strong backward privacy can be expensive. DFB-PPGSQ therefore offers an epochal design: within the current epoch, a deletion may leak a tombstone handle and active-state check; after re-randomization, stale handles are removed from the active searchable structure. Formally, for a deleted graph set D e , query output is filtered by
R e ( Q , τ ) = { G i : LBED ( G i , Q ) τ h i e D e } .
At re-randomization, only G i D e is migrated to I e + 1 .

4.4. Periodic Re-Randomization

Periodic re-randomization refreshes encrypted identifiers and index nodes at epoch boundaries. It breaks long-term equality links. It also provides a natural moment for compaction: deleted entries can be removed, update buffers can be merged, and counters can be regenerated. In the stronger refresh mode used by DFB-PPGSQ, the client prepares the next-epoch active summaries and uploads them in a fresh random order:
Ω e = π e h i e + 1 , { θ b e + 1 , η b , i , c e + 1 } b B ( G i ) , C ˜ G i e + 1 : h i e M e ,
where π e is a random permutation over active records. The cloud learns migration-size buckets, refreshed tree shape, and bucketed record sizes, but it does not receive a pairwise map from h i e to h i e + 1 or from θ b e to θ b e + 1 beyond the leakage function.
The epoch length controls a tradeoff. A short epoch reduces temporal leakage but increases maintenance cost. A long epoch reduces maintenance cost but permits more accumulated leakage. Section 7 includes this tradeoff as an experimental variable.

5. The Proposed DFB-PPGSQ Scheme

5.1. Overview

DFB-PPGSQ follows the filtering-and-refinement philosophy. The client extracts branch features from data graphs and query graphs. The cloud uses an encrypted branch-tree index to filter candidates. The client decrypts returned candidates and, when exactness is required, performs final graph edit-distance refinement locally.
At epoch e, the outsourced state is
State e = ( EDB e , I e , U e , D e , meta e ) ,
where EDB e stores encrypted graph records, I e is the compact encrypted branch-tree index, U e is the recent-update buffer, D e is the tombstone set, and meta e contains non-secret size and epoch metadata allowed by the leakage function. The active encrypted graph handles satisfy the invariant
Act e = Leaves ( I e ) Handles ( U e ) D e .
The search procedure returns only handles in Act e .
The design is deliberately modular. A deployment can select a lightweight configuration for low-power sensor backends, or a stronger configuration with homomorphic counters and oblivious compaction for sensitive environments. The four dynamic mechanisms are:
  • epoch-local feature tokens and per-record occurrence handles for compact active data in I e ;
  • one-time update labels for recent insertions and label updates in U e ;
  • epoch-specific deletion handles in D e ;
  • re-randomization material Ω e for epoch migration.
Figure 2. Algorithmic workflow of DFB-PPGSQ. Setup derives epoch keys, feature tokens, occurrence handles, and protected counters. Dynamic operations produce one-time update labels and modify U e or D e . Search evaluates the pruning predicate LB N ( Q ) τ . Candidate results are filtered by active handles, returned as R e ( Q , τ ) , and periodically refreshed through shuffled epoch- e + 1 state.
Figure 2. Algorithmic workflow of DFB-PPGSQ. Setup derives epoch keys, feature tokens, occurrence handles, and protected counters. Dynamic operations produce one-time update labels and modify U e or D e . Search evaluates the pruning predicate LB N ( Q ) τ . Candidate results are filtered by active handles, returned as R e ( Q , τ ) , and periodically refreshed through shuffled epoch- e + 1 state.
Preprints 219630 g002

5.2. Branch Extraction, Token Generation, and Setup

For a graph G = ( V , E , L V , L E ) , the branch centered at v V is represented as
b v = L V ( v ) , { { ( L E ( v , u ) , L V ( u ) ) : ( v , u ) E } } ,
where { { · } } denotes a multiset. The graph branch multiset is
B ( G ) = { { b v : v V } } .
For each branch b B ( G i ) , the client generates an epoch-specific feature token and a per-record occurrence handle:
θ b e = F K F e ( canon ( b ) ) , η b , i , c b e = F K O e ( θ b e h i e c b r i ) ,
where F is a secure pseudo-random function, K F e is the feature-token key, K O e is the occurrence-handle key, h i e is the active graph handle, r i is a graph-local nonce, and c b is a local occurrence counter. Queries match θ b e values. The nonce appears only in η b , i , c b e , so it randomizes stored occurrences without preventing query matching.
The client also prepares a protected branch-count vector. A branch position is derived by
j e ( b ) = H K H e ( b ) mod m , x G e [ j ] = b B ( G ) 1 [ j e ( b ) = j ] ,
and the protected count is
x ˜ G e [ j ] = x G e [ j ] + M K C e ( id G , j ) ( mod p ) .
For a tree node ν containing graph handles S ν , the aggregate plaintext count vector is
x ν e [ j ] = max G i S ν x G i e [ j ] ,
and the stored value is masked in the same way. The maximum aggregate makes the node a safe filter: if a query cannot match the aggregate, it cannot match any child graph under the same lower-bound rule.
Algorithm 1 shows that setup is not only an encryption step. It also fixes the epoch keys, graph nonces, masked branch counts, and node aggregates used by later pruning. The server sees protected handles and vector lengths, while the client keeps the semantic map from plaintext branches to epoch-local feature tokens.
Algorithm 1 Setup
Input: master key K, initial graph database G 0 = { G 1 , , G N } , vector length m, modulus p
Output: encrypted database EDB 0 , branch-tree index I 0 , client state st 0
1:
Derive epoch keys ( K F 0 , K O 0 , K H 0 , K C 0 , K U 0 , K D 0 ) F K ( setup 0 )
2:
Initialize EDB 0 , S 0 , U 0 , D 0
3:
for each graph G i G 0  do
4:
    sample graph nonce r i { 0 , 1 } λ and handle h i 0 F K D 0 ( id i 0 )
5:
    compute branch multiset B ( G i ) and count vector x G i 0
6:
    for each occurrence ( b , c b ) B ( G i )  do
7:
        generate feature token θ b 0 F K F 0 ( canon ( b ) )
8:
        generate occurrence handle η b , i , c b 0 F K O 0 ( θ b 0 h i 0 c b r i )
9:
    end for
10:
    mask counts x ˜ G i 0 [ j ] x G i 0 [ j ] + M K C 0 ( id i , j ) mod p
11:
    append Enc K ( G i ) to EDB 0 and ( h i 0 , { ( θ b 0 , η b , i , c b 0 ) } , x ˜ G i 0 ) to S 0
12:
end for
13:
build I 0 BuildTree ( S 0 ) with node aggregates x ˜ ν 0
14:
set st 0 ( K , 0 , { r i } i = 1 N , ctr = 0 )
15:
return ( EDB 0 , I 0 , st 0 )

5.3. Dynamic Branch-Tree Index

The branch-tree index groups graphs by encrypted branch-summary ranges. Each internal node stores a protected aggregate summary of its children, and each leaf stores encrypted graph handles and compact branch-count summaries. For a query branch-count vector x Q e and a node aggregate x ν e , the node lower bound is modeled as
LBED e ( Q , ν ) = 1 2 j = 1 m max { 0 , x Q e [ j ] x ν e [ j ] } + γ · max { 0 , | V Q | V ν max } ,
where V ν max is the maximum vertex count of graphs under node ν , and γ [ 0 , 1 ] controls the vertex-count penalty. A node is safely pruned when
LBED e ( Q , ν ) > τ .
For any child graph G i under ν , the aggregate construction gives x G i e [ j ] x ν e [ j ] , so
LBED e ( Q , ν ) LBED e ( Q , G i ) .
Thus, the pruning rule cannot discard a graph whose exact branch lower bound is at most τ .

5.4. Forward-Private Insertion

When inserting a graph G new , the client extracts B ( G new ) , derives feature tokens θ b e , generates a fresh graph nonce r new , and creates one-time update labels with a monotonically increasing counter u:
U b , u e = F K U e ( θ b e u ) .
The counter is never reused. The update record is
Δ ins = ins , h new e , Enc K ( G new ) , { U b , u e } b B ( G new ) , x ˜ new e .
The cloud appends this record to U e . Since U b , u e is derived from an update key and a future counter, an old query token cannot be used to test whether a future inserted graph contains a branch matching that old query. A later query authorizes only the current update-counter interval needed to test buffered records.

5.5. Backward-Private Deletion

When deleting graph G i , the client issues an epochal deletion handle
h i e = F K D e ( id i e ) .
The deletion token is
Δ del = ( del , h i e ) , D e D e { h i e } .
During the same epoch, deletion leaks only the tombstone handle and the fact that a candidate may be suppressed by D e . At re-randomization, deleted records are not migrated into I e + 1 ; after that point, they no longer participate in future search traces.

5.6. Label Update

A label update modifies vertex labels or edge labels in a graph. It changes only the branches whose center or one-hop neighborhood intersects the edited element. If δ is an edit operation on G i , define the affected branch set as
Aff ( G i , δ ) = B ( G i ) B ( G i δ ) ,
where is multiset symmetric difference. The update decomposes into old-branch removals and new-branch insertions:
Aff = Aff B ( G i ) , Aff + = Aff B ( G i δ ) .
For each b Aff + , the client creates a fresh one-time update label U b , u e ; for each b Aff , the client creates a removal tag tied to the active handle. The protected delta vector is
Δ x ˜ i e [ j ] = x G i δ e [ j ] x G i e [ j ] + M K C e ( id i , j , u ) ( mod p ) .
Algorithm 2 is the unified dynamic-update interface. Insertions and positive label deltas use fresh update labels; deletions use epochal tombstones; label changes are represented as local branch deltas. This keeps ordinary updates small and postpones tree rebuilding to epoch maintenance.
Algorithm 2 Dynamic Update
Input: operation op , epoch e, client state st e , outsourced state ( EDB e , I e , U e , D e )
Output: updated outsourced state and client state
1:
if op = Insert ( G ) then
2:
    sample graph nonce r G and compute B ( G ) , x ˜ G e , and active handle h G e
3:
    generate feature tokens { θ b e } b B ( G ) and one-time update labels { U b , u e } b B ( G ) with fresh counter values
4:
     Δ ( ins , h G e , Enc K ( G ) , { U b , u e } , x ˜ G e )
5:
    append Δ to U e and Enc K ( G ) to EDB e
6:
else if op = Delete ( id ) then
7:
    compute h id e F K D e ( id e )
8:
    append h id e to D e
9:
else if op = UpdateLabel ( id , δ ) then
10:
    compute Aff and Aff + for G id δ
11:
    generate removal tags for Aff and one-time update labels for Aff +
12:
    compute masked delta vector Δ x ˜ id e
13:
    append ( upd , h id e , Aff , Aff + , Δ x ˜ id e ) to U e
14:
end if
15:
update local counters in st e
16:
return ( EDB e , I e , U e , D e , st e )

5.7. Query Processing

Given query graph Q and threshold τ , the client extracts B ( Q ) and generates a query token
T Q e = { θ q e } q B ( Q ) , { ω q , u e } q B ( Q ) , u U e , x ˜ Q e , τ , auth e ,
where ω q , u e = F K U e ( θ q e u ) authorizes comparisons with buffered update labels for the current update-counter interval U e . Thus, θ q e searches the compact branch tree I e , while ω q , u e searches one-time labels in U e . The cloud computes two candidate sets:
Cand I = { h i e I e : LBED e ( Q , G i ) τ } ,
Cand U = { h i e U e : LBED e ( Q , G i ) τ } .
The active candidate set is
Cand e ( Q , τ ) = Cand I Cand U D e .
The cloud never sees Q or plaintext graph labels. It observes the declared traversal pattern, update-buffer checks, and result size. If the application requires less traversal leakage, the same query interface can be combined with padded traversal or oblivious access, at additional cost.
Algorithm 4 is the node-level primitive used inside Algorithm 3. Its early termination rule implements
k m : j = 1 k j ( Q , ν ) > τ LBED e ( Q , ν ) > τ ,
where j ( Q , ν ) is the accumulated deficit contribution at coordinate j. Once this condition holds, the remaining coordinates cannot reduce the lower bound, so the subtree can be pruned.
Algorithm 3 Search
Input: query graph Q, threshold τ , epoch e, state ( I e , U e , D e )
Output: encrypted candidate set R e ( Q , τ )
1:
Client computes B ( Q ) , x ˜ Q e , and query token T Q e
2:
Server initializes Cand I and queue Q { root ( I e ) }
3:
while Q do
4:
    pop node ν from Q
5:
    compute dist ν LBED e ( Q , ν ) using authorized protected summaries
6:
    if  dist ν τ and ν is internal then
7:
        push all children of ν into Q
8:
    else if  dist ν τ and ν is a leaf then
9:
        test graph-level summaries in ν and append passing handles to Cand I
10:
    end if
11:
end while
12:
compute Cand U by testing buffered insertions and label-update deltas in U e
13:
filter tombstones: Cand e ( Cand I Cand U ) D e
14:
return encrypted graph records R e ( Q , τ ) { EDB e [ h ] : h Cand e }
Algorithm 4 Query in One Internal Node
Input: query token T Q = { θ q , T v , τ } and encrypted internal node I
Output: lower-bound score dist for node pruning
1:
Initialize dist = 0 , residual branch counts R b = N q i , and residual vertex counts R v = N v i
2:
for each query branch feature token θ q i  do
3:
    if  NB [ θ q i ] 0  then
4:
         t = min { NB [ θ q i ] , N q i }
5:
         R b R b t
6:
        decrease the corresponding vertex residuals induced by θ q i
7:
    end if
8:
end for
9:
for each query vertex token T v i  do
10:
    if  NV [ T v i ] 0 and N v i 0  then
11:
         t = min { NV [ T v i ] , N v i }
12:
         N v i N v i t and NV [ T v i ] NV [ T v i ] t
13:
         dist dist + 0.5 t
14:
        if  dist > τ  then
15:
           return  dist
16:
        end if
17:
    else if  NV [ T v i ] = 0 and N v i 0  then
18:
         dist dist + N v i
19:
        if  dist > τ  then
20:
           return  dist
21:
        end if
22:
    end if
23:
end for
24:
return dist

5.8. Periodic Re-Randomization

At the end of epoch e, the client starts ReRand . It derives new epoch keys
( K F e + 1 , K O e + 1 , K H e + 1 , K C e + 1 , K U e + 1 , K D e + 1 ) = F K ( epoch e + 1 ) .
Let the active migration set be
M e = { h i e : h i e Leaves ( I e ) Handles ( U e ) , h i e D e } .
For every active graph, the client computes new feature tokens, occurrence handles, active handles, and masked counters under epoch e + 1 keys. The refresh package is
Ω e = π e { ( h i e + 1 , { ( θ b e + 1 , η b , i , c b e + 1 ) } b B ( G i ) , x ˜ i e + 1 ) : h i e M e } ,
where π e is sampled by the client. The cloud installs this package as a replacement state and therefore observes the number of active records and bucketed sizes, but not a pairwise old-to-new handle map.
Re-randomization can be full or incremental. Full re-randomization rebuilds the whole active index from a shuffled client refresh package. Incremental re-randomization uploads a fixed budget of refreshed records per time window, with a fresh permutation inside each batch. In both cases, deleted records are excluded from M e , which is the mechanism that gives the construction its epochal backward-privacy effect. The incremental mode leaks batch sizes and batch timing; the full mode leaks the epoch refresh size but avoids pairwise migration linkage.
Algorithm 5 Re-Randomization
Input: epoch e, index I e , update buffer U e , tombstones D e , client state st e
Output: refreshed index I e + 1 and cleared buffers
1:
Client derives ( K F e + 1 , K O e + 1 , K H e + 1 , K C e + 1 , K U e + 1 , K D e + 1 )
2:
Client determines active logical ids represented by M e and excludes D e
3:
Initialize local refresh list S e + 1
4:
for each active graph id id i in random order π e  do
5:
    compute h i e + 1 F K D e + 1 ( id i e + 1 )
6:
    refresh feature tokens θ b e + 1 F K F e + 1 ( canon ( b ) )
7:
    refresh occurrence handles η b , i , c b e + 1 F K O e + 1 ( θ b e + 1 h i e + 1 c b r i )
8:
    recompute or remask x ˜ i e + 1
9:
    append ( h i e + 1 , { ( θ b e + 1 , η b , i , c b e + 1 ) } , x ˜ i e + 1 ) to S e + 1
10:
end for
11:
Server receives Ω e = S e + 1 and builds or installs I e + 1 BuildTree ( S e + 1 )
12:
set U e + 1 , D e + 1 , and securely discard stale epoch material
13:
update client state st e + 1
14:
return ( I e + 1 , U e + 1 , D e + 1 , st e + 1 )

6. Security Analysis

6.1. Threat Model and Leakage Profile

We model the cloud as an honest-but-curious probabilistic polynomial-time adversary. It follows Setup , ApplyUpdate , Query , and ReRand , but tries to infer graph contents, query branches, update contents, and temporal relations among operations. The client is trusted and keeps the master key K, epoch keys, graph nonces, logical-id map, and local counters secret. The encrypted graph database is protected by an IND-CPA secure symmetric encryption scheme, and all token-generation functions are modeled as pseudo-random functions.
The security goal is leakage-based structured-encryption security. Let
O = ( setup , op 1 , , op T )
be an adaptive operation sequence selected by the adversary, where each op t is an insertion, deletion, label update, query, or epoch refresh. The real server view is
View A Π ( λ , O ) = EDB e , I e , U e , D e , { Δ t } t T , { T Q t e t } t T , { path e t ( Q t ) , R e t ( Q t , τ t ) } t T .
The simulator is allowed to see only a leakage function
L = L setup , L upd , L qry , L rr .
Definition 1 
(Leakage functions). For an initial database G 0 , update op t , query ( Q t , τ t ) , and epoch refresh from e to e + 1 , DFB-PPGSQ exposes the following leakage:
L setup ( G 0 ) = N , { | G i | } i = 1 N , { | B ( G i ) | } i = 1 N , m , p , shape ( I 0 ) , { | S ν | } ν I 0 ,
L upd ( op t , e ) = t , e , type ( op t ) , bucket ( | Δ t | ) , bucket ( | Aff ( op t ) | ) , 1 [ op t = del ] ,
L qry ( Q t , τ t , e ) = t , e , τ t , path e ( Q t ) , updscan e ( Q t ) , | Cand e ( Q t , τ t ) | , | R e ( Q t , τ t ) | ,
and
L rr ( e ) = e , | M e | , | D e | , | U e | , shape ( I e + 1 ) , bucketmultiset ( { | EDB [ h ] | : h M e } ) , bucket ( T rr ) .
Here N is the number of outsourced graphs, m and p are public counter parameters, S ν is the handle set under node ν, Aff is the affected branch-delta set for a label update, path e ( Q t ) is the tree traversal trace, and updscan e ( Q t ) is the set of update-buffer records tested by the query token.
The leakage definition is intentionally explicit. DFB-PPGSQ does not claim oblivious access, result-size hiding, or fully hidden update timing. Instead, it prevents the cloud from learning plaintext graph labels, plaintext branch equality across protected epochs, and token-level relations beyond the declared size, timing, traversal, and migration metadata.

6.2. Real-Ideal Security Definition

Definition 2 
(Adaptive leakage security). Let Real A Π ( λ ) be the experiment in which adversary A adaptively interacts with the real DFB-PPGSQ protocol and receives the real server view. Let Ideal A , S L ( λ ) be the experiment in which A interacts with a simulator S that receives only L ( O ) for the same operation sequence. DFB-PPGSQ is adaptively secure with respect to L if, for every PPT adversary A , there exists a PPT simulator S such that
Adv Π , L se ( A , S , λ ) = Pr [ A ( View real ) = 1 ] Pr [ A ( View ideal ) = 1 ] negl ( λ ) .
The simulator uses L setup to sample ciphertext strings, protected handles, vector lengths, and a tree with the leaked shape. It uses L upd to sample update records with the correct operation class and size bucket. It uses L qry to reproduce the same visited-node pattern, update-buffer scan size, candidate size, and returned ciphertext count. It uses L rr to sample shuffled epoch-refresh messages and the new tree shape without using a pairwise old-to-new handle or branch map.

6.3. Token and Ciphertext Indistinguishability

Lemma 1 
(Pseudo-random token simulation). Let F be a secure pseudo-random function. For any polynomial number of inputs
x r { canon ( b ) , θ b e h i e c b r i , θ b e u , id i e , epoch e } ,
the token family { F K ( x r ) } r is computationally indistinguishable from random strings of the same length, preserving only equality that is intentionally leaked by same-epoch feature tokens or authorized update probes. More precisely, for every PPT distinguisher D ,
Pr [ D ( { F K ( x r ) } r ) = 1 ] Pr [ D ( { U r } r ) = 1 ] Adv F prf ( B , λ ) ,
where { U r } r are independent uniform strings and B is a standard PRF adversary constructed from D .
Proof. 
The proof is the standard PRF hybrid. Replace the oracle used to answer each token request with a truly random function. Feature-token equality for the same branch inside one epoch is intentionally retained because it is needed for matching; occurrence handles, update labels, deletion handles, and epoch identifiers use non-reused namespaces. If D distinguishes real tokens from random labels under these retained equality constraints, then D directly yields a PRF distinguisher B with the same distinguishing gap. Thus, the difference is bounded by Adv F prf ( B , λ ) .    □
Lemma 2 
(Encrypted-record simulation). If the graph encryption scheme is IND-CPA secure, then encrypted graph records in EDB e can be simulated from record-size leakage. For any PPT adversary A ,
Pr [ A ( { Enc K ( G i ) } i ) = 1 ] Pr [ A ( { Enc K ( 0 | G i | ) } i ) = 1 ] Adv Enc ind cpa ( B , λ ) .
Proof. 
The simulator encrypts zero strings of the same size buckets as the real graph encodings. Any adversary that distinguishes these simulated ciphertexts from real graph ciphertexts breaks IND-CPA security through the usual many-message hybrid.    □

6.4. Main Security Theorem

Theorem 1 
(Structured-encryption security of DFB-PPGSQ). Assume that F is a secure pseudo-random function, M K C e is a pseudo-random mask family over Z p , graph encryption is IND-CPA secure, and nonces/counters are non-reused within their namespaces. Then DFB-PPGSQ is adaptively secure with respect to the leakage function L in Definition 1:
Adv Π , L se ( A , S , λ ) Adv Enc ind cpa + q F Adv F prf + q M Adv M prf + negl ( λ ) ,
where q F and q M are polynomially bounded numbers of token and mask queries.
Proof. 
We use a sequence of hybrids. In H 0 , the adversary receives the real server view. In H 1 , every encrypted graph record Enc K ( G i ) is replaced by an encryption of a zero string with the same leaked size. By Lemma 2, H 0 and H 1 are indistinguishable under IND-CPA security.
In H 2 , all feature tokens, occurrence handles, update labels, deletion handles, query labels, and epoch keys are replaced by random strings that preserve equality only when equality is allowed by L in the same epoch or by a query-authorized update probe. Lemma 1 bounds the distinguishing advantage between H 1 and H 2 by the PRF advantage.
In H 3 , protected count values
x ˜ G e [ j ] = x G e [ j ] + M K C e ( id G , j ) ( mod p )
and node aggregates are replaced by random elements of Z p that are consistent with the leaked vector length, modulus, and comparison outcomes. Since M K C e is pseudo-random, the adversary sees only masked values and the declared pruning outcomes. Thus, H 2 and H 3 are indistinguishable up to Adv M prf .
In H 4 , the simulator generates the entire server view using L . It samples ciphertexts with leaked sizes, random handles and tokens with leaked equality patterns, a tree with shape shape ( I e ) , query traversal paths path e ( Q ) , update scans updscan e ( Q ) , result counts, and shuffled epoch-refresh sizes. By construction, H 3 and H 4 have the same distribution. Therefore, the real and ideal experiments are computationally indistinguishable except for the stated cryptographic advantages.    □

6.5. Forward Privacy

Theorem 2 
(Forward privacy). Let t be a time before an insertion or positive label-update delta at time t > t . Under the PRF assumption and non-reused update counters, any token view observed before t is independent of the plaintext branch set inserted at t except for L upd . Formally, for every branch predicate P and PPT adversary A ,
Pr [ A ( View < t , Δ t ) = P ( B new ) ] Pr [ A ( View < t , Δ ^ t ) = P ( B new ) ] Adv F prf + negl ( λ ) ,
where Δ ^ t is a simulated update record with the same leakage but random update labels.
Proof. 
For each inserted branch b B new , the server receives
U b , u e = F K U e ( θ b e u ) ,
where u has not appeared before. Tokens issued before t did not contain the future counter probe ω b , u e = F K U e ( θ b e u ) . Hence, there is no efficiently testable relation between an old search token and U b , u e unless a future query intentionally authorizes that update-counter interval. Replacing U b , u e with a random string changes the adversary’s view only by the PRF advantage. The remaining visible information is update time, type, epoch, and size bucket, which is exactly L upd .    □

6.6. Backward Privacy

Theorem 3 
(Epochal backward privacy). Let graph handle h i e be deleted during epoch e, and let the next refresh produce epoch e + 1 . If deleted handles are excluded from M e , then future search views in epochs e > e are independent of G i beyond deletion and migration leakage:
h i e D e h i e + 1 Leaves ( I e + 1 ) Handles ( U e + 1 ) ,
and for every future query ( Q , τ ) ,
Pr [ h i e + 1 Cand e + 1 ( Q , τ ) ] = 0 .
Proof. 
During epoch e, the deletion operation adds
Δ del = ( del , h i e ) , D e D e { h i e } .
Same-epoch queries may reveal that a candidate is suppressed by a tombstone; this is included in the deletion leakage. At ReRand , the migration set is
M e = Leaves ( I e ) Handles ( U e ) D e .
Thus h i e M e , and no new active handle h i e + 1 , occurrence handle η b , i , c b e + 1 , or protected count vector x ˜ i e + 1 is generated for the deleted graph. Future queries operate only on I e + 1 and U e + 1 . Therefore, the deleted graph cannot be returned or tested as an active record after refresh. Any attempt to link future query tokens to stale deleted-graph tokens reduces to distinguishing independently generated epoch- e + 1 PRF outputs from random strings, plus the explicitly leaked refresh-size metadata.    □

6.7. Query and Result Privacy

Proposition 1 
(Query-view simulation). For a query ( Q , τ ) in epoch e, the server view
View qry ( Q , τ , e ) = T Q e , path e ( Q ) , updscan e ( Q ) , Cand e ( Q , τ ) , R e ( Q , τ )
is simulatable from L qry ( Q , τ , e ) and cryptographic sizes.
Proof. 
The simulator samples pseudo-random query labels for T Q e , creates a traversal trace with the leaked path length and node identifiers, samples update-buffer checks according to updscan e ( Q ) , and returns the leaked number of ciphertext records. The plaintext branch labels in Q are used only inside PRF inputs and masked count vectors. By Lemmas 1 and 2, replacing these objects with simulated labels and ciphertexts is computationally indistinguishable. The non-hidden parts are exactly traversal pattern, update-buffer checks, candidate count, and result size.    □

6.8. Re-Randomization Security

Proposition 2 
(Cross-epoch unlinkability). For any active branch occurrence ( b , i , c ) refreshed from epoch e to e + 1 , the occurrence-handle pair
η b , i , c e , η b , i , c e + 1 = F K O e ( θ b e h i e c r i ) , F K O e + 1 ( θ b e + 1 h i e + 1 c r i )
is computationally unlinkable across epochs, except through L rr and workload metadata. The cloud does not receive the pair ( h i e , h i e + 1 ) during full shuffle refresh. For any PPT linking adversary A ,
Adv link ( A ) 2 Adv F prf + Pr [ MetaColl ] + negl ( λ ) ,
where MetaColl denotes a uniqueness event in leaked metadata such as record-size buckets, refresh batch timing, or repeated result-size patterns.
Proof. 
Epoch keys are derived as independent PRF outputs:
K O e = F K ( epoch e O ) , K O e + 1 = F K ( epoch e + 1 O ) .
Replacing epoch-e occurrence handles with random labels and then replacing epoch- ( e + 1 ) occurrence handles with independent random labels changes the adversary’s view only by the PRF advantage. Independent random labels do not encode branch or record equality across epochs. Because the refresh package is shuffled, a successful link must use non-token information such as bucketed record size, batch timing, or repeated query-result metadata. These correlations are captured by Pr [ MetaColl ] and the declared re-randomization leakage.    □

6.9. Comparison with Static PPGSQ-Style Indexing

In a static PPGSQ-style index, a branch occurrence keeps a stable encrypted identifier. Abstractly, if the same branch occurrence appears in two time windows, the server may observe
η b , i , c e = η b , i , c e + 1 or path e ( Q ) path e + 1 ( Q ) ,
which enables longitudinal profiling. Inserted branches can be tested against old query identifiers if update labels reuse the same branch namespace, and deleted branches may remain observable through stale index nodes until a full rebuild is performed.
DFB-PPGSQ changes these equalities into epoch-local relations:
Pr [ η b , i , c e = η b , i , c e + 1 ] 2 λ , Act e + 1 = Act e Ins e Upd e D e .
Thus, active records are re-tokenized, update records use one-time labels, deleted records are removed from the next searchable state, and the cloud does not receive a pairwise old-to-new refresh map. The price is visible update timing, buffer scans, bucketed refresh sizes, and epoch-maintenance leakage; the gain is that temporal branch and handle equality are no longer stable server-side identifiers.

7. Experimental Evaluation

This section reports a reproducible prototype evaluation of DFB-PPGSQ. The goal is to test whether the proposed dynamic mechanisms preserve the main branch-filtering advantage of PPGSQ-style search while avoiding full index rebuild after ordinary updates. It implements protocol-relevant operations in Python: branch extraction, HMAC-SHA256 token generation, feature-token matching, one-time update labels, branch-count lower-bound filtering, feature-only dynamic SSE lookup, update buffering, tombstone filtering, and shuffle-based epoch re-randomization.

7.1. Prototype Implementation and Workloads

The evaluation was executed on Windows 11 with Python 3.14.2 on an Intel64 Family 6 Model 189 processor. Every plotted point reports the mean over five independent random seeds, and the error bars show the standard deviation across these seeds. The generated workload models a dynamic sensor-topology graph database. Each default mesh graph contains 8–22 vertices. Vertices are assigned sensor or device labels such as temperature, pressure, gateway, camera, and alarm. Edges encode communication, control, backup, or event relations. A ring backbone keeps each graph connected, and additional sparse edges emulate redundant sensor links or event dependencies. To strengthen the Sensors-oriented evaluation, we also add industrial CPS and campus IoT stress profiles with larger graphs and richer device vocabularies, motivated by the dynamic dependency and security requirements observed in sensor-network studies [1,2].
Table 3. Prototype workload and reproducibility settings.
Table 3. Prototype workload and reproducibility settings.
Component Setting Range / Value Purpose
Graph database size generated sensor-topology graphs 250, 500, 1000, 2000, 4000 graphs query scalability
Graph structure connected sparse graph 8–22 vertices; ring backbone plus random extra edges sensor-network topology model
Stress profiles mesh, industrial CPS, campus IoT 1500–4000 graphs; mean 15–56 vertices robustness to heterogeneous sensor networks
Dynamic operations insert, delete, label update, epoch refresh five random seeds: 1701–1705 update and maintenance cost
Query threshold graph edit-distance threshold proxy τ { 1 , 2 , 3 , 4 , 5 , 6 } pruning sensitivity
Epoch length refresh interval 50, 100, 250, 500, 1000 updates privacy-efficiency tradeoff
The dynamic workload is denoted by
W = { op 1 , op 2 , , op T } ,
where op t { Insert , Delete , UpdateLabel , Search , ReRand } . A workload profile is represented as
π = ( p ins , p del , p lab , p qry , E ) ,
where E is the epoch length. Insertions generate new sensor-topology graphs, deletions insert epoch-specific tombstone handles, and label updates perturb local vertex or edge labels and therefore regenerate only the affected branches. Queries are generated by perturbing existing graphs by one to three local label changes.

7.2. Baselines

The comparison includes both graph-similarity baselines and dynamic encrypted-search baselines. Table 4 summarizes their roles. Static PPGSQ1 performs full branch lower-bound scanning. Static PPGSQ2 uses the same size and branch-count filtering principle as a branch-tree baseline but does not include dynamic privacy. DSSE-branch represents a feature-only dynamic searchable-encryption service that retrieves graphs sharing authorized sensor labels but does not maintain a graph-similarity branch tree. Dynamic rebuild rebuilds the whole protected index after each update. The no-re-randomization baseline keeps stable branch identifiers and is used only for linkability testing.

7.3. Metrics

For a query set Q , average query latency is
T ¯ q = 1 | Q | Q Q T q ( Q ) .
For an update stream U , average update latency is
T ¯ u = 1 | U | op U T u ( op ) .
The pruning ratio for query Q is
PR ( Q ) = 1 | Cand ( Q ) | | G | .
The false-positive candidate ratio after local refinement is
FPR ( Q ) = | Cand ( Q ) R ( Q ) | | Cand ( Q ) | ,
where R ( Q ) is the exact result set under the graph edit-distance threshold. Linkability attack success is measured as
ASR = # correctly linked epoch - crossing tokens # tested token pairs .
Storage and communication overhead are not optimized in this Python prototype and are therefore not used for the main comparison. The reported metrics are query latency, update latency, epoch-refresh maintenance cost, candidate pruning ratio, and linkability attack success. The stress-profile experiment additionally reports a metadata-assisted linkability attack that combines branch-label length, local degree, and coarse branch-string length buckets. Latencies are wall-clock measurements in milliseconds.

7.4. Query Scalability

The first experiment measures query latency as the graph database grows from 250 to 4000 graphs. Figure 3 shows that DFB-PPGSQ remains close to the static branch-tree baseline while outperforming full scanning and feature-only DSSE at larger scales. At 4000 graphs, DFB-PPGSQ required 46.60 ms on average, compared with 44.72 ms for Static PPGSQ2, 62.22 ms for Static PPGSQ1, and 64.95 ms for DSSE-branch. Thus, the dynamic mechanisms add about 4.2% query overhead relative to the static branch-tree baseline at the largest tested scale, while avoiding a return to linear full-database scanning.

7.5. Dynamic Update Cost

The second experiment separates ordinary updates from epoch maintenance. Figure 4 shows that immediate rebuild is expensive for insertions, deletions, and label updates because the whole protected index is reconstructed after every operation. In contrast, DFB-PPGSQ appends insertions and label updates to the update buffer and stores deletions as tombstones. In the measured prototype, insertion and label update cost 0.091 ms and 0.092 ms on average, respectively, while delete cost 0.007 ms. Epoch refresh remains expensive because it rebuilds and re-randomizes the active index; its mean cost was 192.73 ms. This is expected: DFB-PPGSQ moves rebuild cost from every update to scheduled epoch boundaries.

7.6. Re-Randomization Tradeoff

The third experiment varies epoch length. A shorter epoch reduces the time window in which tombstone and update-buffer traces remain linkable, but it increases amortized maintenance cost. Figure 5 shows this tradeoff. The measured maintenance cost falls from 4.03 ms per update at an epoch length of 50 updates to 0.177 ms per update at 1000 updates. The normalized linkability window grows in the opposite direction, because a longer epoch leaves stable within-epoch metadata visible for a longer period.

7.7. Pruning Ability

The fourth experiment evaluates whether dynamic privacy weakens branch-based pruning. Figure 6 reports the fraction of graphs removed before refinement. DFB-PPGSQ closely tracks the static branch-tree baseline because it preserves the same lower-bound filtering structure and adds only update-buffer and tombstone checks. At τ = 1 , Static PPGSQ2 pruned 68.9% of candidates, and DFB-PPGSQ pruned 68.2%. At τ = 6 , the pruning ratios were 2.0% and 2.0%, respectively. The feature-only DSSE baseline pruned almost no graphs in this generated sensor workload because most graphs share at least one coarse sensor label; this illustrates why dynamic keyword-style search is not a substitute for graph-similarity filtering.

7.8. Sensor-Network Stress Workloads

The fifth experiment tests whether the same implementation remains stable under more heterogeneous sensor-network profiles. Figure 7 reports three workloads. The default sensor-mesh profile uses 4000 graphs with 14.98 vertices per graph on average. The industrial CPS and campus IoT profiles use 1500 larger graphs with 40.05 and 56.16 vertices per graph on average, respectively, and include richer device and communication labels. DFB-PPGSQ required 52.92 ms on the 4000-graph mesh profile, 23.86 ms on the industrial CPS profile, and 23.80 ms on the campus IoT profile. The two larger-graph profiles also produced stronger pruning because their richer labels and higher local degree make branch summaries more selective: the pruning ratios were 63.2% and 73.2%, respectively. Under a stronger metadata-assisted cross-epoch attacker using label-length, degree, and coarse branch-string buckets, the measured attack success rates were 3.3%, 5.6%, and 4.8% for the three profiles. These results do not replace evaluation on public IoT traces, but they give a stronger stress test than a single small synthetic topology.

7.9. Leakage-Resilience

The sixth experiment evaluates temporal linkability under a simple attacker. For the no-re-randomization baseline, the attacker links occurrence handles across epochs by deterministic equality. For DFB-PPGSQ, equality no longer works after epoch refresh; the attacker therefore falls back to coarse bucket matching based on branch label length and local degree. Figure 8 shows that stable identifiers make occurrence-handle linkage trivial in the baseline, whereas DFB-PPGSQ reduces the measured bucket-matching success rate to approximately 1.4–1.5%. This experiment does not prove resistance to all leakage-abuse attacks. It demonstrates that epoch key refresh removes the strongest equality signal and leaves only coarse metadata leakage under the declared leakage model.

8. Conclusions

This paper proposed DFB-PPGSQ, a dynamic forward/backward-private graph similarity matching query scheme over encrypted graph databases. The scheme targets a realistic sensor-cloud setting where graphs are not static. They are inserted, deleted, relabeled, and periodically maintained.
DFB-PPGSQ combines branch-based lower-bound filtering with dynamic structured encryption. It introduces epoch-local feature tokens, per-record occurrence handles, update buffers, deletion tombstones, and shuffle-based periodic re-randomization. These mechanisms preserve efficient graph similarity filtering while reducing temporal leakage from dynamic updates. The security analysis shows how the scheme achieves forward privacy for future insertions and label updates, and epochal backward privacy for deleted graphs after compaction under an explicit leakage model. The prototype evaluation supports the design goal: ordinary updates avoid immediate full rebuild, query latency remains close to the static branch-tree baseline, stress workloads remain practical on heterogeneous sensor topologies, and epoch refresh removes stable cross-epoch token equality.
Future work will extend the prototype to public IoT and cyber-physical graph traces, optimize the cryptographic implementation, and investigate verifiable and multi-user encrypted graph services.

Supplementary Materials

The reproducibility script, measured CSV source data, and generated figure files are supplied with this manuscript package under scripts/, source_data/, and figures/.

Author Contributions

Hou Huiying was responsible for generating the paper’s ideas and writing the manuscript. Ma Yucong and Zisu Zhao conducted the experimental data collection and analysis. Xinrui Ge revised and reviewed the paper

Funding

This research was supported by the National Natural Science Foundation of China (No. 62302152).

Data Availability Statement

The prototype script, generated workload settings, measured CSV files, and figure-generation outputs are included with this manuscript package under scripts/, source_data/, and figures/. No human-subject data or third-party restricted dataset is used in the reported prototype evaluation.

Acknowledgments

This work was supported by the National Natural Science Foundation of China (No. 62302152); the Henan Provincial Key Scientific and Technological Project (242102211074); the Zhengzhou Municipal R&D Special Fund-Supported Research Project (22ZZRDZX30); and the Open Project of Key Laboratory of Grain Information Processing and Control, Ministry of Education (KFJN2022017).

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
DFB-PPGSQ Dynamic Forward/Backward-Private Privacy-Preserving Graph Similarity Query
DSSE Dynamic Searchable Symmetric Encryption
GED Graph Edit Distance
HMAC Hash-Based Message Authentication Code
IoT Internet of Things
PPGSQ Privacy-Preserving Graph Similarity Query
SSE Searchable Symmetric Encryption

References

  1. Li, S.; Song, H.; Iqbal, M. Privacy and Security for Resource-Constrained IoT Devices and Networks: Research Challenges and Opportunities. Sensors 2019, 19, 1935. [Google Scholar] [CrossRef] [PubMed]
  2. Wang, C.; Xing, S.; Gao, R.; Yan, L.; Xiong, N.; Wang, R. Disentangled Dynamic Deviation Transformer Networks for Multivariate Time Series Anomaly Detection. Sensors 2023, 23, 1104. [Google Scholar] [CrossRef] [PubMed]
  3. Zheng, Y.; Zhu, H.; Lu, R.; Guan, Y.; Zhang, S.; Wang, F.; Shao, J.; Li, H. PGSim: Efficient and Privacy-Preserving Graph Similarity Query Over Encrypted Data in Cloud. IEEE Trans. Inf. Forensics Secur. 2023, 18, 2030–2045. [Google Scholar] [CrossRef]
  4. Wang, S.; Zheng, Y.; Jia, X.; Huang, H.; Wang, C. PrigSim: Towards Privacy-Preserving Graph Similarity Search as a Cloud Service. IEEE Trans. Knowl. Data Eng. 2023, 35, 10478–10496. [Google Scholar] [CrossRef]
  5. Ge, X.; Yu, J.; Hao, R. Privacy-Preserving Graph Similarity Matching Query Over Encrypted Graph Database. IEEE Trans. Knowl. Data Eng. 2026, 38, 1932–1946. [Google Scholar] [CrossRef]
  6. Sanfeliu, A.; Fu, K.S. A Distance Measure Between Attributed Relational Graphs for Pattern Recognition. IEEE Trans. Syst. Man. Cybern. 1983, SMC-13, 353–362. [Google Scholar] [CrossRef]
  7. Gao, X.; Xiao, B.; Tao, D.; Li, X. A Survey of Graph Edit Distance. Pattern Anal. Appl. 2010, 13, 113–129. [Google Scholar] [CrossRef]
  8. Riesen, K.; Bunke, H. Approximate Graph Edit Distance Computation by Means of Bipartite Graph Matching. Image Vis. Comput. 2009, 27, 950–959. [Google Scholar] [CrossRef]
  9. Yan, X.; Yu, P.S.; Han, J. Graph Indexing: A Frequent Structure-Based Approach. In Proceedings of the Proceedings of the 2004 ACM SIGMOD International Conference on Management of Data, 2004; pp. 335–346. [Google Scholar] [CrossRef]
  10. Zheng, W.; Zou, L.; Lian, X.; Wang, D.; Zhao, D. Efficient Graph Similarity Search Over Large Graph Databases. IEEE Trans. Knowl. Data Eng. 2015, 27, 964–978. [Google Scholar] [CrossRef]
  11. Zhao, X.; Xiao, C.; Lin, X.; Wang, W. Efficient Graph Similarity Joins with Edit Distance Constraints. In Proceedings of the Proceedings of the 2012 IEEE 28th International Conference on Data Engineering, 2012; pp. 834–845. [Google Scholar] [CrossRef]
  12. Song, D.X.; Wagner, D.; Perrig, A. Practical Techniques for Searches on Encrypted Data. In Proceedings of the Proceedings of the 2000 IEEE Symposium on Security and Privacy, 2000; pp. 44–55. [Google Scholar] [CrossRef]
  13. Boneh, D.; Di Crescenzo, G.; Ostrovsky, R.; Persiano, G. Public Key Encryption with Keyword Search. In Proceedings of the Advances in Cryptology – EUROCRYPT 2004, 2004; pp. 506–522. [Google Scholar] [CrossRef]
  14. Chang, Y.C.; Mitzenmacher, M. Privacy Preserving Keyword Searches on Remote Encrypted Data. In Proceedings of the Applied Cryptography and Network Security, 2005; pp. 442–455. [Google Scholar] [CrossRef]
  15. Curtmola, R.; Garay, J.; Kamara, S.; Ostrovsky, R. Searchable Symmetric Encryption: Improved Definitions and Efficient Constructions. In Proceedings of the Proceedings of the 13th ACM Conference on Computer and Communications Security, 2006; pp. 79–88. [Google Scholar] [CrossRef]
  16. Cash, D.; Jarecki, S.; Jutla, C.; Krawczyk, H.; Rosu, M.C.; Steiner, M. Highly-Scalable Searchable Symmetric Encryption with Support for Boolean Queries. In Proceedings of the Advances in Cryptology – CRYPTO 2013, 2013; pp. 353–373. [Google Scholar] [CrossRef]
  17. Kamara, S.; Papamanthou, C.; Roeder, T. Dynamic Searchable Symmetric Encryption. In Proceedings of the Proceedings of the 2012 ACM Conference on Computer and Communications Security, 2012; pp. 965–976. [Google Scholar] [CrossRef]
  18. Kamara, S.; Papamanthou, C. Parallel and Dynamic Searchable Symmetric Encryption. In Proceedings of the Financial Cryptography and Data Security; 2013; pp. 258–274. [Google Scholar] [CrossRef]
  19. Cash, D.; Jaeger, J.; Jarecki, S.; Jutla, C.; Krawczyk, H.; Rosu, M.C.; Steiner, M. Dynamic Searchable Encryption in Very-Large Databases: Data Structures and Implementation. In Proceedings of the Proceedings of the 2014 Network and Distributed System Security Symposium, 2014. [Google Scholar] [CrossRef]
  20. Stefanov, E.; Papamanthou, C.; Shi, E. Practical Dynamic Searchable Encryption with Small Leakage. In Proceedings of the Proceedings of the 2014 Network and Distributed System Security Symposium, 2014. [Google Scholar] [CrossRef]
  21. Bost, R. Σoϕoς: Forward Secure Searchable Encryption. In Proceedings of the Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, 2016; pp. 1143–1154. [Google Scholar] [CrossRef]
  22. Bost, R.; Minaud, B.; Ohrimenko, O. Forward and Backward Private Searchable Encryption from Constrained Cryptographic Primitives. In Proceedings of the Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security, 2017; pp. 1465–1482. [Google Scholar] [CrossRef]
  23. Cao, N.; Yang, Z.; Wang, C.; Ren, K.; Lou, W. Privacy-Preserving Query over Encrypted Graph-Structured Data in Cloud Computing. In Proceedings of the Proceedings of the 2011 IEEE 31st International Conference on Distributed Computing Systems, 2011; pp. 393–402. [Google Scholar] [CrossRef]
  24. Meng, X.; Kamara, S.; Nissim, K.; Kollios, G. GRECS: Graph Encryption for Approximate Shortest Distance Queries. In Proceedings of the Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, 2015; pp. 504–517. [Google Scholar]
  25. Du, M.; Wu, S.; Wang, Q.; Chen, D.; Jiang, P.; Mohaisen, A. GraphShield: Dynamic Large Graphs for Secure Queries with Forward Privacy. IEEE Trans. Knowl. Data Eng. 2020, 1–1. [Google Scholar] [CrossRef]
  26. Falzon, F.; Ghosh, E.; Paterson, K.G.; Tamassia, R. PathGES: An Efficient and Secure Graph Encryption Scheme for Shortest Path Queries. In Proceedings of the Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security, 2024; pp. 4047–4061. [Google Scholar] [CrossRef]
  27. Yang, S. Privacy-Preserving Multi-User Graph Intersection Scheme for Wireless Communications in Cloud-Assisted Internet of Things. Sensors 2025, 25, 1892. [Google Scholar] [CrossRef] [PubMed]
  28. Cash, D.; Grubbs, P.; Perry, J.; Ristenpart, T. Leakage-Abuse Attacks against Searchable Encryption. In Proceedings of the Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, 2015; pp. 668–679. [Google Scholar] [CrossRef]
  29. Naveed, M.; Kamara, S.; Wright, C.V. Inference Attacks on Property-Preserving Encrypted Databases. In Proceedings of the Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, 2015; pp. 644–655. [Google Scholar] [CrossRef]
  30. Grubbs, P.; Lacharite, M.S.; Minaud, B.; Paterson, K.G. Learning to Reconstruct: Statistical Learning Theory and Encrypted Database Attacks. In Proceedings of the Proceedings of the 2019 IEEE Symposium on Security and Privacy, 2019; pp. 1067–1083. [Google Scholar] [CrossRef]
  31. Oya, S.; Kerschbaum, F. Hiding the Access Pattern is Not Enough: Exploiting Search Pattern Leakage in Searchable Encryption. In Proceedings of the Proceedings of the 30th USENIX Security Symposium, 2021; pp. 127–142. [Google Scholar]
  32. Lewi, K.; Wu, D.J. Order-Revealing Encryption. In Proceedings of the Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, 2016; pp. 1167–1178. [Google Scholar] [CrossRef]
  33. Chase, M.; Kamara, S. Structured Encryption and Controlled Disclosure. In Proceedings of the Advances in Cryptology – ASIACRYPT 2010; 2010; pp. 577–594. [Google Scholar] [CrossRef]
Figure 1. System model of DFB-PPGSQ. The icon-rich architecture separates the trusted client domain from the honest-but-curious cloud graph service. The client owns plaintext dynamic graphs, query graphs, and cryptographic keys, while the cloud stores encrypted graph records, secure branch-tree summaries, update buffers, tombstones, and re-randomization state. Setup, update, query, result-return, and epoch-refresh flows are mediated by client-generated tokens or re-randomization material.
Figure 1. System model of DFB-PPGSQ. The icon-rich architecture separates the trusted client domain from the honest-but-curious cloud graph service. The client owns plaintext dynamic graphs, query graphs, and cryptographic keys, while the cloud stores encrypted graph records, secure branch-tree summaries, update buffers, tombstones, and re-randomization state. Setup, update, query, result-return, and epoch-refresh flows are mediated by client-generated tokens or re-randomization material.
Preprints 219630 g001
Figure 3. Query latency under increasing graph-database scale. Points show mean values over five random seeds; error bars show standard deviations.
Figure 3. Query latency under increasing graph-database scale. Points show mean values over five random seeds; error bars show standard deviations.
Preprints 219630 g003
Figure 4. Dynamic update latency for insertion, deletion, label update, and epoch refresh. Bars show mean values over five random seeds; error bars show standard deviations.
Figure 4. Dynamic update latency for insertion, deletion, label update, and epoch refresh. Bars show mean values over five random seeds; error bars show standard deviations.
Preprints 219630 g004
Figure 5. Epoch-length tradeoff between amortized re-randomization maintenance cost and normalized linkability window.
Figure 5. Epoch-length tradeoff between amortized re-randomization maintenance cost and normalized linkability window.
Preprints 219630 g005
Figure 6. Candidate pruning ratio under different edit-distance thresholds. Points show mean values over five random seeds; error bars show standard deviations.
Figure 6. Candidate pruning ratio under different edit-distance thresholds. Points show mean values over five random seeds; error bars show standard deviations.
Preprints 219630 g006
Figure 7. Sensor-network stress workloads. The three panels report DFB-PPGSQ query latency, candidate pruning ratio, and metadata-assisted cross-epoch linkability attack success over mesh, industrial CPS, and campus IoT graph profiles. Bars show mean values over five random seeds; error bars show standard deviations.
Figure 7. Sensor-network stress workloads. The three panels report DFB-PPGSQ query latency, candidate pruning ratio, and metadata-assisted cross-epoch linkability attack success over mesh, industrial CPS, and campus IoT graph profiles. Bars show mean values over five random seeds; error bars show standard deviations.
Preprints 219630 g007
Figure 8. Linkability attack success rate across epochs with and without periodic re-randomization. Points show mean values over five random seeds; error bars show standard deviations.
Figure 8. Linkability attack success rate across epochs with and without periodic re-randomization. Points show mean values over five random seeds; error bars show standard deviations.
Preprints 219630 g008
Table 2. Notation.
Table 2. Notation.
Symbol Description
λ Security parameter
G t Dynamic graph database at time t
G i The i-th data graph
Q Query graph
τ Graph edit-distance threshold
B ( G ) Branch multiset extracted from graph G
b A branch feature
e Current epoch
K e Epoch key
θ b e Epoch-local query-matchable feature token of branch b
η b , i , c e Per-record occurrence handle for the c-th occurrence of branch b in graph G i
I e Encrypted branch-tree index in epoch e
U e Encrypted update buffer in epoch e
D e Deletion tombstone set in epoch e
LBED Branch-based lower bound of edit distance
op Dynamic operation type
Table 4. Experimental baselines.
Table 4. Experimental baselines.
Method Mechanism profile Purpose
Query Update Privacy
Static PPGSQ1-style linear branch scan rebuild only content privacy query-cost lower baseline
Static PPGSQ2-style branch-tree pruning rebuild only content privacy strongest static pruning baseline
Rebuild-after-update branch-tree pruning full rebuild freshness maintenance-cost upper baseline
DSSE-branch feature-only lookup dynamic update forward privacy cost of losing branch-tree pruning
No re-randomization dynamic branch-tree buffered update partial privacy value of epoch refresh
DFB-PPGSQ dynamic branch-tree buffer and compaction forward/backward privacy proposed construction
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

© 2026 MDPI (Basel, Switzerland) unless otherwise stated

Accessibility

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings