Metadata-Private Resource Allocation in Edge Computing Withstands Semi-Malicious Edge Nodes

Edge computing provides higher computational power and lower transmission latency by offloading tasks to nearby edge nodes with available computational resources to meet the requirements of time-sensitive tasks and computationally complex tasks. Resource allocation schemes are essential to this process. To allocate resources effectively, it is necessary to attach metadata to a task to indicate what kind of resources are needed and how many computation resources are required. However, these metadata are sensitive and can be exposed to eavesdroppers, which can lead to privacy breaches. In addition, edge nodes are vulnerable to corruption because of their limited cybersecurity defenses. Attackers can easily obtain end-device privacy through unprotected metadata or corrupted edge nodes. To address this problem, we propose a metadata privacy resource allocation scheme that uses searchable encryption to protect metadata privacy and zero-knowledge proofs to resist semi-malicious edge nodes. We have formally proven that our proposed scheme satisfies the required security concepts and experimentally demonstrated the effectiveness of the scheme.


Introduction
Edge computing offers significantly enhanced computing power by outsourcing enddevice tasks to nearby edge nodes or devices with additional computing resources.The reduced transmission latency in edge-based solutions, as compared with traditional cloudbased alternatives, underscores its efficiency.As intelligent requirements for terminal devices continue to evolve, the limitations of traditional cloud computing become evident, especially in handling a multitude of delay-sensitive and computationally intensive tasks.This shift has given rise to the emergence of edge computing [1].The application scope of edge computing extends widely across industry and manufacturing, agriculture, healthcare, urban management, and environmental protection [2][3][4][5], leveraging the transformative potential of the Internet of Things (IoT).
The optimization of task offloading and resource allocation is the core problem of edge computing [6], and the scheme based on a smart gateway [7] is considered a promising solution.Specifically, the end device will send the task to the smart gateway, which will carry out measures such as refining and filtering the data according to the application requirements at the smart gateway end, and finally assign the task to the appropriate edge node for processing, in which the gateway should take into account various factors, such as the type of the task, the time sensitivity, and the computational complexity.In order to realize such a system, metadata defining the factors required for the task need to accompany the task data when they are sent [8], and these metadata can help the gateway to make decisions when allocating resources [9]; e.g., time sensitivity points out that the task needs to be processed in real-time, and computational complexity points out that the task needs more computational resources.
The metadata of edge computing contain sensitive information, such as when a user publishes a task, what kind of resource they request, and how much computation resource they need.Unprotected metadata will expose the end device's private information; e.g., a malicious adversary can launch a side-channel attack by observing how the gateway performs the resource allocation to obtain the user's privacy information [10].Some research has shown that it is possible to get a detailed and private picture of a person's contacts and interests just by analyzing metadata, and it is technically much more accessible to search massive amounts of metadata than to listen in on millions of phone calls [11].In recent years, some researchers have focused on the metadata privacy in secure messaging [12,13], however, in the area of edge computing, we still face the challenge of lower computation resources on the end devices and lower bandwidth requirements.
A possible method to achieve metadata privacy in edge computing is for the end device to encrypt the metadata using the public key of the gateway and send it to the gateway, which decrypts it and then completes the resource allocation.Although this scheme can resist malicious eavesdroppers, the gateway can still obtain information about the metadata, and once the gateway is corrupted, the attacker can still obtain the user's privacy.To solve the above problem, a scheme based on searchable encryption has been proposed [14]; by using searchable encryption, the smart gateway can check whether the received encrypted metadata contains a specific keyword without learning any metadata-related content.
It is challenging to run a strong cyber defense system because of the relatively limited computing power of the edge nodes.In addition, the security setup of the edge nodes is also more prone to errors than the cloud [15].As a result, edge nodes are more easily corrupted and become semi-malicious edge nodes.A semi-malicious edge node is defined as an edge node that will maintain system consistency but will behave maliciously to weaken the privacy of the system.However, the above scheme [14] lacks the consideration of semimalicious edge nodes, which may allow the gateway to perform equality test searches for specific keywords if one or more edge nodes are corrupted in the group generation phase.

Our Contribution
Existing resource allocation schemes for metadata privacy protection often lack the consideration of malicious smart gateways and semi-malicious edge nodes.In order to address these challenges, we propose a resource allocation scheme for metadata privacy protection based on searchable encryption.This scheme is valuable in edge computing environments with limited computational resources and bandwidth, such as the Internet of Vehicles.The contributions of this work are as follows: First, edge nodes can generate a group encryption public key by interacting with each other, and subsequently, for a set of selected keywords, each edge node can compute a partial trapdoor, and the smart gateway can aggregate these partial trapdoors to generate a complete trapdoor.End devices need to encrypt the corresponding metadata using the group public key when sending data and send the encrypted metadata to the gateway together with the task data.The gateway uses a complete trapdoor to determine whether the encrypted metadata contains the specific keyword and finally allocates resources according to the predetermined policy.In the process, the gateway does not learn any keyword-related content.Moreover, our proposed scheme achieves constant message expansion, i.e., the ciphertext length of the encrypted keyword does not increase with the increase in edge nodes.
Second, we use extractable zero-knowledge proofs to resist corrupted edge nodes.Specifically, in the group generation phase, each edge node must provide the corresponding proofs of the selected random parameter, and the parameter without the corresponding proofs will not be added to the corresponding computation of the group public key, which prevents semi-malicious edge nodes from enabling the gateway to perform an equality test search on a specific keyword by generating a malicious parameter in the group generation phase.
Finally, we identify the security concepts of a metadata-privacy resource allocation scheme and perform the corresponding security analysis.Our scheme captures important security properties such as user privacy, full key compromise resistance, and semi-malicious edge node resistance.In addition, we give a formal proof of how our proposed scheme satisfies the defined security concepts.In addition, we experimentally evaluate the performance of the proposed scheme.

Related Work
The allocation of limited resources is the most critical component of an edge computing system, and its efficiency directly affects the whole system's performance.Recently, many resource allocation strategies and algorithms have been proposed to realize resource allocation and management in edge computing [16][17][18].The use of smart gateways [7] is considered a promising solution for edge computing resource allocation, where the smart gateway can utilize system resources better by deciding the time and type of data to be sent based on application feedback.However, it is worth noting that user privacy is not considered in Aazam et al.'s scheme [7].
Lu et al. [19] proposed a lightweight privacy-preserving data aggregation scheme based on homomorphic encryption and the Chinese Remainder Theorem in response to the limitation that existing schemes only support homogeneous devices and experimentally proved the scheme's efficiency.However, the scheme does not consider identity privacy and traceability.In order to reduce privacy leakage in edge computing, Lyu et al. [20] proposed a new privacy-preserving data aggregation scheme based on homomorphic encryption and differential privacy, which guarantees the obliviousness of the aggregator.However, the scheme does not consider the edge node that may steal the user's location privacy.Zhang et al. [21] proposed a resource allocation scheme that can resist malicious edge nodes using blockchain and trust computing.However, since the scheme uses symmetric searchable encryption, it cannot generate complete trapdoors cooperatively.Thus, the scheme is difficult to implement to protect metadata privacy.Kong et al. [22] designed a task offloading strategy based on a multifeedback trust mechanism, which can identify malicious nodes using trust assessment and improve system operation efficiency using the clustering algorithm.Zhou et al. [23] proposed a lightweight, verifiable privacy-preserving outsourcing matching pattern protocol that prevents collusion between the cloud and malicious receivers/senders.Li et al. [24] proposed a verifiable edge outsourcing computing scheme based on blockchain, which protects the privacy of the results.Wang et al. [25] designed a privacy-preserving computational offloading framework based on vehicular fog computing and smart contracts and experimentally demonstrated the effectiveness of the framework.However, we note that all the above schemes lack consideration of metadata privacy issues.
In order to protect the privacy of metadata in edge computing, Zhang et al. [14] proposed a scheme based on searchable encryption that achieves constant message expansion and full key compromise resistance.Angel et al. [26] proposed a new resource allocation scheme that allocates resources to a group of clients and does not disclose to the clients whether there are other clients receiving the resources.Beams et al. [10] proposed a privacypreserving packet scheduling scheme that prevents a malicious adversary from obtaining the victim's private information by launching a side-channel attack and observing how the switch schedules packets.Ahmad et al. [27] proposed a new voice communication scheme that enables metadata privacy-preserving voice communication over a completely untrusted infrastructure.However, all the above privacy-preserving resource allocation schemes do not consider malicious edge nodes.
Barman et al. [12] proposed a metadata privacy messaging system based on differential privacy and Private Information Retrieval (PIR) [28] that can support asynchronous messaging chats and can run on untrusted servers.Tests of a prototype system show the effectiveness of the scheme.Jiang et al. [13] implemented a scalable metadata-private messaging system based on hardware enclaves that achieves resistance to malicious clients.Ex-periments show that the scheme has a lower extra cost and higher efficiency.Cai et al. [29] designed a metadata-hiding data analytic system called Vizard using the distributed point function, which allows data owners to share their data in a privacy-preserving manner, and the experimental results proved the practicality of the scheme.Langowski et al. [30] designed a metadata-private anonymous broadcasting scheme called Trellis based on boomerang encryption and anonymous routing tokens that hides all network-level metadata and supports horizontal scalability.However, these solutions are designed for large network systems and are difficult to apply directly to edge systems with limited computational and bandwidth resources.

Background 2.1. System Architecture
The edge computing system used in our proposed scheme comprises five types of entities: trusted authority (TA), end device, gateway, edge node, and cloud, as shown in Figure 1.• TA provides registration services for edge nodes and generates system parameters.In our scheme, TA is considered to be entirely trustworthy.

•
End devices with limited computing and storage capabilities are users of the edge computing system and need to accomplish various tasks with the help of edge nodes.

•
The gateway does the forwarding process for the received task and finds the appropriate edge nodes or cloud.Note that since the resource allocation is done by the gateway and not by the end device itself, only one group exists at every moment.In our scheme, the gateway is considered to be honest but curious [31], meaning that the gateway will honestly follow the protocol to complete the forwarding job but will try to violate the privacy of the end device.

•
Edge nodes have a relatively limited computational and storage capacity [32,33], and thus generally need to collaborate to handle tasks.In our scheme, edge nodes may be compromised to become semi-malicious edge nodes.A semi-malicious edge node is defined as an edge node that will maintain system consistency but will behave maliciously (we call it an elimination attack) to weaken the privacy of the system.
The elimination attack is defined as follows: Suppose an edge node with identity ID i is corrupted by the smart gateway in the group setup phase.The elimination attack may "eliminate the necessity authorization" via edge node ID j .In other words, with the help of the corrupted edge node ID i , the gateway is able to aggregate to a valid trapdoor for the message m l without the permission of edge node ID j .The attack works as follows: (1) In the group public key generation phase, edge node ID i broadcasts r i − r j instead of r i = x i P ; (2) In the trapdoor generation phase, edge node ID i generates the trapdoor with x i as normal; (3) In the trapdoor generation phase, the gateway does not include the partial trapdoor w j of the edge node ID j in the aggregation process, i.e., it computes T m l = ∑ i̸ =j w i which turns out to be a valid trapdoor since r j has been canceled out in the group generation phase.

•
The cloud is considered to have a sufficient computing and storage capacity, and some tasks that are not time-sensitive and require significant computing and storage resources will be sent to the cloud for processing.

Design Goals
Considering the security risks posed by malicious behaviors to the resource allocation process in edge computing, our security goals must satisfy the following points.

1.
Metadata privacy: The gateway should be able to check whether a legitimate keyword is included in the encrypted metadata without learning the content of the metadata.
When the gateway has no complete trapdoor, it will be equivalent to an eavesdropper.For an eavesdropper, indistinguishability is required.That is, the eavesdropper cannot distinguish whether two encrypted keywords are the same.In other words, one of the given two keywords is randomly chosen to be encrypted, and the attacker cannot distinguish which keyword the encrypted keyword corresponds to.

2.
Full key compromise resistance: Even if the attacker corrupts all the edge nodes in the system, the attacker still cannot decrypt the previously encrypted metadata.

3.
Semi-malicious edge node resistance: Semi-malicious edge nodes cannot disrupt other nodes' participation in group public key generation via an elimination attack.

Bilinear Pairing
Suppose that G 1 and G T are cyclic groups of prime order q and that the generator of G 1 is P. A pair ê : Bilinear: ê(uP, vP) = ê(P, P) uv , where u, v ∈ Z * q .2.

Identity-Based Cryptosystem
The concept of the identity-based cryptosystem (IBC) was first proposed by Shamir [34].In IBC, the user's public key is their identity, thus reducing the certificate management overhead in q traditional Public Key Infrastructure-based (PKI-based) cryptosystem [35].Our scheme is designed in IBC [34], where the edge nodes use their identity as the public key, thus reducing complex problems such as certificate updates and revocations.

Searchable Encryption
Searchable encryption [36] is a cryptographic primitive that allows encrypted data to be searched by a user with a trapdoor without revealing information about the data.Searchable encryption mainly consists of symmetric searchable encryption (SSE) [37] and public key encryption with keyword search (PEKS) [38], which have different focuses on functionality and performance and are used to meet the requirements in different scenarios.The data owner, trapdoor generator, and decryptor in SSE must share a key, while PEKS allows anyone who knows the entity's public key to generate the encrypted keyword.Since PEKS enables smart gateways to determine whether a keyword is present in encrypted metadata without learning its content, PEKS enables metadata privacy protection against the malicious gateway.
In an edge computing system, it is reasonable to assume that a group of edge nodes that agree on the same privacy terms will decide what information can be leaked to the gateway.This means that these edge nodes should generate a trapdoor cooperatively.However, in current searchable encryption schemes for multiple recipients [39], if an attacker obtains one of the recipients' private keys, they can generate any trapdoor to recover the keyword.Although this problem can be solved using a thresholding scheme, it also means that the length of the ciphertext corresponding to the keyword will grow linearly with the number of receivers.Our proposed scheme achieves constant message expansion, i.e., the length of the encryption keyword does not increase with the number of edge nodes, which contributes to the scalability of the scheme.

Extractable Zero-Knowledge Proof
A zero-knowledge proof [40] allows the prover to prove a statement's truth without revealing additional information to the verifier.The proofs of knowledge used in this work need to be extractable, meaning that there exists an extractor with oracle access to the prover that can output the witness of a statement.We adopt the notation proposed by Camenisch et al. [41] to represent zero-knowledge proofs of discrete logarithms.Specifically, we use PK{(x, y, z) : h = aP + yc ∧ h ′ = xP + zc} to denote the zero-knowledge proofs of x, y, z that can make the equations h = aP + yc and h ′ = xP + zc hold.If the extractor can extract the witness without rewinding, it is called online-extractable [42], and in this paper, witnesses that need to be online-extractable will be underlined.

Preliminary Definitons
In this section, the relevant definitions of the proposed scheme will be given, and our proposed scheme consists of a PPT algorithm (Init, Reg, GG, KG, ME, TA, RA), which works as follows: The randomization algorithm Init takes the security parameter k as input and outputs the system master secret s and public system parameters ∆.The security parameter k is a parameter used to ensure the security of the scheme, usually including the secret key length and the output length of the hash function, etc.; this parameter needs to be chosen based on the tradeoffs between the desired security level and the performance requirements.The system parameters need to be public.• Resource allocation.RA(C, T) → (0, 1): The gateway runs the algorithm, and the input is the complete trapdoor T and the encryption keyword C. The algorithm outputs 1 if C contains the corresponding keyword m; otherwise, it outputs 0. Subsequently, the gateway can decide the resource allocation result based on the output and the corresponding tag of the edge node.

The Proposal
As shown in Figure 2. Our scheme consists of several phases, which are described below: Initialization, Registration, Group Generation, Keyword Generation, Message Encapsulation, Test Authorization, and Resource Allocation.The specific construction is shown below: • Initialization: Taking as input the security parameter k, the TA generates a bilinear pairing ê : where G 1 and G T are both cyclic groups with prime order q, and P is the generator of G 1 .TA randomly chooses s ∈ Z * q as the system master secret and computes P pub = sP; then, three cryptographic hash functions are selected, notated as Then, TA generates a common reference string, which includes a description of the group G 1 , denoted by CRS.Finally, the TA publishes all system parameters: param = (G 1 , G T , ê, P, P pub , h 1 , h 2 , h 3 , CRS).

•
Registration: During this phase, TA should provide a registration service for edge nodes.Specifically, each edge node sends its ID i to TA through a secure channel, and TA first computes q i = h 1 (ID i ) and subsequently computes s i = sq i as the private key of edge node ID i .

•
Group Generation: Suppose an edge system consists of k edge nodes with IDs ID 1 , . . ., ID k , and a group public key needs to be negotiated at that phase.Each edge node needs to maintain a set that contains all valid edge node subscripts, i.e., S = {1, 2, . . .., k}.Subsequently, the edge nodes perform the following operations: -For 1 ≤ i ≤ k, the i-th edge node ID i chooses a random number x i ∈ Z * q and computes r i = x i P as well as a proof π r i = PK{(x i ) : r i = x i P}.Finally, the edge node ID i sends {ID i , r i , π r i } to other edge nodes via a secure channel.

-
Upon receiving a set of {(r i , π r i )} i∈S from other edge nodes, an edge node verifies the validity of π r i with regard to r i and param for all i ∈ S. If π r i is not valid, this also implies that the edge node is semi-malicious; therefore, the subscript of the node should be removed from the set S, i.e., update S := S \ {i}.Subsequently, these edge nodes need to select a serial number (which can be instantiated based on a concatenation of the date and the value of a counter of the number of the group generation) to negotiate and publicize a unique group ID: Finally, the edge node can compute and publish the group public key E = (r, Φ, S), where • Keyword Generation: In this phase, the edge system nodes need to negotiate to generate a list of keywords for the end device.This list of keywords is sent through the secure channel to the end device that wants to use this edge system.In order to resist the keyword guessing attack [43], the edge system needs to select random strings as keywords and the end devices and edge nodes need to record the correspondence between the keywords and the required factors.
• Message Encapsulation: The end device can send task data with encrypted metadata to the gateway.In order to encrypt the keyword m in the metadata, an end device selects y ∈ Z * q and computes the encrypted keyword (X, Y), where • Test Authorization: Suppose the set S contains k edge nodes, GID = ID 1 ||ID 2 || . . .||ID k ||serial number.To authorize the gateway to test the keyword list m 1 , . . ., m n , the i-th edge node needs to compute the corresponding partial trapdoor w i = s i + x i h 2 (GID, m l ) for the keyword m l , where l ∈ {1, 2 . . .., n}.Subsequently, the edge node sends the corresponding (w i , tag i ) to the gateway via a secure channel in a specific keyword order, where tag ∈ {0, 1}.The tag = 1 or tag = 0 represents whether the i-th edge node is willing to perform the task represented by m or not, respectively.Receiving {w i , tag i } 1≤i≤k , the gateway computes T m l is the trapdoor used to determine whether the encrypted metadata contain the keyword m l .

•
Resource Allocation: After receiving the encryption keyword (X j , Y j ) in the encrypted metadata, the gateway needs to determine whether the equation holds.If the equation holds, the encrypted metadata contain the keyword m l ; otherwise, the encrypted metadata do not contain m l .After testing all the keywords, the gateway can complete the resource allocation process according to the tag corresponding to the trapdoor.If no edge node is available to execute the task, it will be sent to the cloud for execution.

Security Analysis
This section starts with the definition of the security model for the proposed scheme.The security model captures the properties of user privacy, corrupted edge nodes, and full key compromise resistance.Following this, we provide a formal proof that our proposed scheme satisfies the required security notion.

Security Model
In our security model, an adversary can be either a gateway or a eavesdropper.We call a gateway adversary a Type I adversary and an eavesdropper adversary a Type II adversary.We define the security of our proposed scheme through the following two games.
Game 1 plays between a challenger C and a Type I adversary A, which captures the behavior of the Type I adversary.In Game 1, the adversary A will try to learn the contents of the encrypted metadata.Game 1 consists of three phases.
Initial: C run Initialization to obtain master-secret and the system parameter list.It then sends the system parameters to A while keeping master-secret secret.
Training: Allow A to adaptively execute a polynomially bounded number of the following types of queries:

•
Private key queries: This query is used to model our proposed scheme's full key compromise resistance property.Specifically, A is allowed to perform this query to obtain the private key of the edge node with the identity ID i , and the query's output is the corresponding node's private key.

•
Group public key queries: A can use this query to obtain the group public key for a group of edge nodes.C responds with the corresponding group public key.

•
Trapdoor queries: A can request the trapdoor corresponding to metadata m, and, as a response, C runs the Test Authorization algorithm to obtain and return the trapdoor.
Output: A selects a group ID GID * and sends that group to challenger C. C chooses a keyword m * , encrypts it, generates a trapdoor T m * , and sends T m * to the adversary; if A is able to correctly decrypt T m * , we say that A has won game 1.
Define the advantage of A winning the above game as If for any probabilistic polynomial time adversary A, Adv(A) can be negligible, we say that our scheme is secure against Type I adversaries.
Game 2 plays between a challenger C and a Type II adversary A, which captures the behavior of the Type II adversary.In Game 2, two encrypted keywords are given to the adversary A, and A is required to distinguish whether the two contain the same keyword.Game 2 consists of three phases.
Initial: This phase is the same as in Game 1.
Training: Allow A to adaptively execute a polynomially bounded number of the following types of queries:

•
Private key queries: This query is used to model our proposed scheme's full key compromise resistance property.Specifically, A is allowed to perform this query to obtain the private key of the edge node with identity ID i , and the query's output is the corresponding node's private key.

•
Group public key queries: A can use this query to obtain the group public key for a group of edge nodes.C responds with the corresponding group public key.

•
Trapdoor queries: A can request the trapdoor corresponding to metadata m, and, as a response, C runs the Test Authorization algorithm to obtain and return the trapdoor.• Semi-malicious corruptions queries: C needs to maintain an initially empty list L m with records of the format (ID i , r i , π r i ).A is allowed to add malicious records to L m .

Output:
The adversary A selects a group ID GID * and two keywords m 0 , m 1 .Next, (GID, m 0 , m 1 ) is sent to C. We require that A cannot query the trapdoor corresponding to m 0 and m 1 under GID * .However, A can corrupt all the edge nodes related to GID * .Then, C can randomly select the message m ξ , where ξ ∈ {0, 1}, and encrypt that message using the group public key corresponding to GID * to get the encryption keyword C * , which will be sent to A as a response.Finally, A returns its guess: ξ ′ ∈ {0, 1}.
If for any probabilistic polynomial time adversary A, can be negligible, our scheme is secure against Type II adversaries.

Security Proofs
The security of our proposed scheme is based on the Bilinear Diffie-Hellman (BDH) assumption, which is defined as follows.
BDH Assumption: Suppose B is an algorithm that can solve the BDH problem with the advantage Adv(B) = Pr B(P, αP, βP, γP) = ê(P, P) αβγ .Then, for any polynomial time algorithm B, Adv(B) can be negligible.Theorem 1.In time τ, assuming that A can win Game 1 with an advantage denoted as Adv(A), this means that there exists an algorithm that breaks the one-way property of the hash function.
Proof.Next, we will prove that if an adversary A can break the user privacy, then it means that C can utilize A to break the one-way property of the hash function.In the real world, this is considered difficult.
Initial: C runs Initialization to get master-secret and the system parameter list, then sends the system parameters to A while keeping master-secret secret.
Training: Type I adversaries A are allowed to do the various query requests defined above, and C responds accordingly as defined in Section 3.2.
Output: A selects a group ID GID * , generates the corresponding group encryption public key E * = (r * , Φ * ), and sends (GID * , E * ) to C. C randomly chooses a keyword m * and randomly chooses o * ∈ G 1 as the trapdoor corresponding to m * .If C outputs its guess as m * ′ = m * , an algorithm exists that breaks the one-way property of the hash function.
Theorem 2. Suppose the group size is N; in time τ, the Type II adversary A requested q h 3 queries for h 3 and requested q t trapdoor queries.Suppose that the adversary A can win Game 2 with an advantage denoted by Adv(A).This then means that there exists an algorithm to solve the BDH problem, which has an advantage of Proof.Next, we will prove that if the adversary A can break our scheme, then C can utilize A to solve the BDH problem.In the real world, this is considered difficult.Initial: C sets P pub = αP, then generates the system parameters params = (G 1 , G T , ê, P, P pub , h 1 , h 2 , h 3 ), and sends the system parameters to A. Assume that the number of edge nodes in the system is N.The i-th edge node ID i performs the registration when C flips a coin coin i ; the probability of producing a 1 is δ, and the probability of producing a 0 is 1 − δ, where 1 ≤ i ≤ N.
Training: We consider h 1 , h 2 , and h 3 to be random oracles, and C responds to the request of A as follows: • h 1 queries: C needs to maintain an initially empty list L h 1 .When ID i is input, C first checks whether the record (ID i , d i , q i , s i ) exists in L h 1 , and, if it does, it returns q i to A; otherwise, C randomly selects d i ∈ Z * q , computes q i = d i P, s i = d i P pub , adds the record (ID i , d i , q i , s i ) to L h 1 , and returns q i to A. randomly chooses x i ∈ Z * q , otherwise recovering the corresponding record (ID i , r i , π r i ) from L m , and we note that, in this work, we use extractable knowledge proofs so that we can extract the x i from π r i .Then, if coin i = 0, C computes r i = x i P, and if Add the record (GID j , r 1 , r 2 , . . ., r k , x 1 , x 2 , . . ., x k , E, Φ) to G lits .

•
Trapdoor queries: C maintains a list L t with records of the form (GID i , m i , T i ).The query receives (GID j , m j ) as input, C first recovering (GID j , r 1 , r 2 , . . ., r k , x 1 , x 2 , . . ., x k , E, Φ) from L G .For 1 ≤ i ≤ k, C recovers the ID i corresponding to the records (ID i , d i , q i , s i ) from L h 1 , and the (GID j , m j ) corresponding records (GID j , m j , w j , o j , coin h 2 j ) from L h 2 .Then, C determines whether a record (GID j , m j , T j ) corresponding to (GID j , m j ) exists in L t , and, if it does, C returns T j as a response.If 1 ≤ i ≤ k, then C executes the following steps: as the answer to the BDH problem.When Event 1 does not happen, A will not notice the difference between the simulation and the real world, so we have We note that for C to output a solution to the BDH problem, it is required that, for an index l ∈ [1, k], coin * l = 1 and coin h 2 ξ * = 1.And these occur with a probability of at least Nδ 2 .Thus, we have C outputting a solution to the BDH problem with the probability

Security Comparison and Performance Evaluation
Although the work of Barman et al. [12] and Jiang et al. [13] is robust, as mentioned before, it is unrealistic to introduce these complex schemes in edge computing systems with limited computational and bandwidth resources.Therefore, we compare the security of our proposed scheme with Zhang et al.'s proposed scheme [14], which also uses searchable encryption.We have compared the security of the two schemes via formal security proofs, and the comparison results are shown in Table 1.The results show that our scheme can resist semi-malicious edge nodes, which Zhang et al.'s scheme cannot do.Our proposed scheme and Zhang et al.'s proposed scheme have similar computational overheads in the other phases, with the main gap being the extractable zero-knowledge proofs introduced in the group generation phase.To evaluate these extra computational overheads, we performed experiments on the zero-knowledge proof scheme proposed by Cramer et al. [44] The experiment was performed using the Miracl library on a PC equipped with an i5-9400F CPU and 16 GB RAM.The experimental results show that the proof generation time is 2.98 s, while the verification time is 26.32 ms.Since the group generation phase is executed only once, such extra computational overhead is acceptable.In recent years, some more efficient zero-knowledge proof schemes have been proposed [45].In practice, the appropriate zeroknowledge proof schemes can be selected as the building blocks of our proposed scheme as needed.

Semi-Malicious Edge Nodes Resistance
Zhang et al.'s scheme [14] Our proposed scheme Next, we evaluate our proposed scheme in terms of performance.To our knowledge, no metadata privacy-preserving resource allocation scheme exists for resistance to semimalicious edge nodes.Therefore, we only evaluate the performance of our proposed scheme.In addition, since the other phases need to be executed only once, we only evaluate the efficiency of the Message Encapsulation phase, the Test Authorization phase, and the Resource Allocation phase.Specifically, in this section, we use the petrelic library to evaluate the computational overhead of our proposed scheme.We performed the measurements on a PC with an Intel i5-9400F CPU, 16GB of RAM, and Ubuntu 18.04.
We increase the number of encrypted keywords from 1 to 100 and calculate the required execution time in order to evaluate the performance of the Message Encapsulation phase.The results are shown in Figure 3.Our proposed scheme requires an execution time of about 1.607 ms for a single keyword.Similarly, we evaluate the Resource Allocation phase, where the execution time is about 0.858 ms for a single keyword.Since the metadata attached to the edge computation will not contain too many keywords, the corresponding two phase computation overhead will not be particularly large.In addition, to evaluate the scheme's performance on edge devices with limited computational resources, we performed experiments on a Raspberry Pi 3 Model B+ using the PBC library.The results are shown in Figure 4.The execution times of our scheme in the Message Encapsulation phase and Resource Allocation for a single keyword are 37.071 ms and 15.102 ms, respectively.Since the metadata attached to the edge computation will not contain too many keywords, the corresponding two-phase computation overhead is acceptable for edge devices.Since the number of keywords contained in the metadata and the number of edge nodes in the edge computing system will not be too many, we set the number of encrypted keywords to grow from 1 to 10, and the number of partial trapdoors to increase from 1 to 100, to evaluate the performance efficiency of the Test Authorization phase.Similarly, the experiment was performed on a PC and a Raspberry Pi, and the results are shown in Figures 5 and 6, respectively.We can see that the performance efficiency of the Test Authorization phase is usually sufficient to meet the requirements.

Conclusions
Resource allocation is the core problem of edge computing, but existing resource allocation schemes in edge computing often lack the protection of metadata privacy and consideration of semi-malicious edge nodes.In this paper, we propose a metadata-privacy resource allocation scheme based on searchable encryption and use a zero-knowledge proof to resist semi-malicious edge nodes.Our proposed scheme achieves constant message expansion, which contributes to scalability in practice.Through a formal security analysis, we demonstrate that the scheme satisfies the necessary security and privacy requirements.

Figure 2 .
Figure 2. Execution process of our scheme.

Figure 3 .
Figure 3. Execution time of Message Encapsulation phase and Resource Allocation phase on the PC.
b e r o f k e y w o r d s M e s s a g e E n c a p s u l a t i o n R e s o u r c e A l l o c a t i o n

Figure 4 .
Figure 4. Execution time of Message Encapsulation phase and Resource Allocation phase on the Raspberry Pi.

Figure 5 .
Figure 5. Execution time of Test Authorization phase on the PC.

Figure 6 .
Figure 6.Execution time of Test Authorization phase on the Raspberry Pi.
The deterministic algorithm Reg is run by TA and takes as input the identity ID i of the edge node and outputs the private key corresponding to ID i .• Group Generation.GG(ID 1 , ID 2 , . . ., ID k ) → (GID, E): A group of edge nodes ID 1 , . . ., ID k with total number k that want to build an edge computing system can run the algorithm to generate the corresponding group identity GID and group public key E. • Keyword Generation.KG(ID 1 , ID 2 , . . ., ID k ) → (Keywords): A group of edge nodes ID 1 , . . ., ID k with total number k generates a list of keywords for the end devices in the edge computing system.• Message Encapsulation.ME(m, E) → (C): The algorithm can be run by any end device that knows the group public key.Inputting the group public key E and the metadata keyword m, the algorithm outputs the corresponding encryption keyword C. Finally, C and the task data need to be sent to the gateway.
• Registration.Reg(ID i ) → (sk i ): • Test Authorization.TA(T 1 , T 2 , . . ., T k ) → (T): In order to authorize the gateway to test a specific keyword m, each edge node ID i in the group needs to generate the corresponding partial trapdoor T i .The gateway aggregates these partial trapdoors to generate the final trapdoor T.
• h 2 queries: C needs to maintain an initially empty list L h 2 .When ID i is input, C first checks whether the record (GID i , m i , w i , o i , coin h 2 i ) exists in L h 2 , and, if it does, it returns o i to A. Otherwise, C flips a coin coin h 2 i , assuming that the probability of the coin yielding 1 is δ and the probability of yielding 0 is 1 − δ, and, subsequently, C randomly selectsw i ∈ Z * q .-Ifcoin h 2 i = 1, compute o i = (w i + β)P, add record (GID i , m i , w i , o i , coin h 2 i ) to L h 2 ,and return o i as response.-Else, compute o i = w i P, add record (GID i , m i , w i , o i , coin h 2 i ) to L h 2 , and return o i as response.• h 3 queries: C needs to maintain an initially empty list L h 3 .When Λ i is input, C first checks whether record (Λ i , Υ i ) exists in L h 3 , and, if it does, returns Υ i to A; otherwise, C randomly selects Υ i ∈ {0, 1} * , adds the record (Λ i , Υ i ) to L h 3 , and returns Υ i to A. • Private key queries: The query takes ID i as input, and, upon receiving this query, C performs an h 1 query with ID i as input, and then recovers the corresponding (ID i , d i , q i , s i ) from L h 1 , returning s i as a response.• Semi-malicious corruptions queries: A inputs (ID i , r i , π r i ), and C adds the record (ID i , r i , π r i ) to L m .• Group public key queries: C maintains a list L G with records of the form (GID l , r 1 , r 2 , . . ., r k , x 1 , x 2 , . . ., x k , E, Φ). query receives GID j = (ID 1 ||ID 2 || . . .||ID k ||serial number) as input; for 1 ≤ i ≤ k, C first determines whether there is a record associated with ID i in L m , and, if not, C since C has knowledge of x i and the private key of ID i , C can use the Trapdoor algorithm to generate w i .-Else, if coin h 2 i = 0, computer w i = s i + w j r i .-Else, abort.We denote the event by Event 1.If Event 1 does not occur, C computes T j = ∑ k i=1 w i and adds the record (GID j , m j , T j ) = (r * , Φ * ).Then, A sends (GID * , E * , m * 0 , m * 1 ) to C. C randomly selects ξ ∈ {0, 1}, Υ * ∈ {0, 1} l , sends (γP, Υ * ) as a response to A, and finally, A outputs its guess ξ ′ .• Output: If ξ ′ = ξ, C recovers the records (GID * , r * 1 , . . ., r * k , x * 1 , . . ., x * k * we denote the value of the coin flip corresponding to ID l as coin * l .It requires that only one coin corresponds to a value of 1.Then, C randomly selects the pair (Λ i , Υ i ) from L h 3 .Finally, C outputs

Table 1 .
Comparison of security.