Multi-Dimensional Range Query over Encrypted Data

We design an encryption scheme called multi-dimensional range query over encrypted data (MRQED), to address the privacy concerns related to the sharing of network audit logs and various other applications. Our scheme allows a network gateway to encrypt summaries of network flows before submitting them to an untrusted repository. When network intrusions are suspected, an authority can release a key to an auditor, allowing the auditor to decrypt flows whose attributes (e.g., source and destination addresses, port numbers, etc.) fall within specific ranges. However, the privacy of all irrelevant flows are still preserved. We formally define the security for MRQED and prove the security of our construction under the decision bilinear Diffie-Hellman and decision linear assumptions in certain bilinear groups. We study the practical performance of our construction in the context of network audit logs. Apart from network audit logs, our scheme also has interesting applications for financial audit logs, medical privacy, untrusted remote storage, etc. In particular, we show that MRQED implies a solution to its dual problem, which enables investors to trade stocks through a broker in a privacy-preserving manner.


Introduction
Recently, the network intrusion detection community has made large-scale efforts to collect network audit logs from different sites [25,35,24].In this application, a network gateway or an Internet Service Provider (ISP) can submit network traces to an audit log repository.However, due to the presence of privacy sensitive information in the network traces, the gateway will allow only authorized parties to search their audit logs.We consider the following four types of entities: a gateway, an untrusted repository, an authority, and an auditor.We design a cryptographic primitive that allows the gateway to submit encrypted audit logs to the untrusted repository.Normally, no one is able to decrypt these audit logs.However, when malicious behavior is suspected, an auditor may ask the authority for a search capability.With this search capability, the auditor can decrypt entries satisfying certain properties, e.g., network flows whose destination address and port number fall within a certain range.However, the privacy of all other flows should still be preserved.Note that in practice, to avoid a central point of trust, we can have multiple parties to jointly act as the authority.Only when a sufficient number of the parities collaborate, can they generate a valid search capability.
We name our encryption scheme Multi-dimensional Range Query over Encrypted Data (MRQED).In MRQED, we encrypt a message with a set of attributes.For example, in the network audit log application, the attributes are the fields of a network flow, e.g., source and destination addresses, port numbers, time-stamp, protocol number, etc.Among these attributes, suppose that we would like to support queries on the time-stamp t, the source address a and the destination port number p. Our encryption scheme provides the following properties: • Range query on attributes.An authority can issue a decryption key for all flows whose (t, a, p) falls within a certain range: t ∈ [t 1 , t 2 ] and a ∈ [a 1 , a 2 ] and p ∈ [p 1 , p 2 ].Notice that range query implies equality and greater-than (smaller-than) tests, e.g., t ≥ t 1 and a = a 1 and p ≤ p 1 .With this decryption key, all flows whose (t, a, p) tuple falls within the above range can be decrypted.
• Security requirement.Normally, no one can learn any information from the ciphertexts.Under special circumstances, however, an auditor may obtain a decryption key from an authority for some range t ∈ [t 1 , t 2 ] and a ∈ [a 1 , a 2 ] and p ∈ [p 1 , p 2 ].For any flow, if at least one attribute among t, a, p lies outside the specified range, the auditor fails to decrypt it.The auditor inevitably learns that the (t, a, p) tuple of this flow does not lie within the given range.However, apart from this information, the auditor cannot learn anything more about the flow.For example, the auditor cannot learn anything about attributes other than t, a, p; in addition, she cannot decide whether t < t 1 or t > t 2 , etc.
Our results and contributions.We are among the earliest to study the problem of point encryption, range query, and conditional decryption of matching entries.We propose a provably secure encryption scheme that allows us to achieve these properties.Table 1 summarizes the asymptotic performance of our scheme in comparison with other approaches.Please refer to Section 2 for a detailed comparison between our scheme MRQED, and the concurrent work BonehWaters06 [13].
We study the practical performance of MRQED, and show that it makes the encrypted network Scheme Pub.Key Size Encrypt.Cost CT Size Decrypt.Key Size Decrypt.Cost Security BonehWaters06 [13] O Table 1: Performance of different approaches.D denotes the number of dimensions and T the number of points in each.The naive AIBE-based scheme is described in Section 4.3.MC and MR refer to the match-concealing and match-revealing security models respectively as defined in Section 3.
audit log application feasible.We also study the dual problem to MRQED, where one encrypts under a hyper-range in multi-dimensional space, and decrypts under a point.We show that MRQED implies a solution to its dual problem, which enables investors to trade stocks through a broker in a privacy-preserving manner.
Paper organization.In the remainder of this section, we give more example applications of MRQED.We review related work in Section 2, and formally define the MRQED problem in Section 3. In Section 4, we demonstrate some initial attempts at constructing MRQED; while in Section 5, we describe our novel construction which we consider the main contribution of this paper.We note that the purpose of Section 4 is not only to exhibit straw-man schemes, but also to better motivate our design of MRQED as described in Section 5.In particular, some of the primitives introduced in Section 4 will later be used in Section 5 when we explain our novel construction.Due to limit of space, formal security proofs of security are provided in Appendix C. In the proof, we borrow techniques from the AHIBE scheme of Boyen and Waters [15].As a result, the security of our construction is likewise based on the hardness of Decision Bilinear Diffie-Hellman problem and the Decision Linear problem.In Section 7, we consider the practical performance of the scheme in the context of network audit logs.We show that MRQED implies a solution to its dual problem in Section 8, and show that the dual problem is of particular interest to investors who would like to trade stocks through a broker in a privacy-preserving manner.

Application to Network Audit Logs
We briefly mentioned network audit logs at the beginning of this section.Throughout the paper, we will keep using this example to motivate the design of MRQED.To provide context for the remainder of the paper, we now describe this application in greater detail.Firewalls and network intrusion detection systems (NIDS) such as Snort [43], Emerald [40], and Bro [39] produce logs summarizing detected or blocked activities suspected to be malicious.Log entries typically correspond to either a single packet (perhaps rejected by a firewall) or an established flow deemed suspicious.Each entry normally includes fields such as source and destination IP address and port, date and time, protocol (e.g., TCP, UDP, or ICMP), and, in the case of NIDS, the type of rule causing an alert.Sharing and comparing such logs across organizations is a method for gaining broader information about malicious activities on the Internet so that administrators may better protect their systems.Current large scale efforts to collect and aggregate network audit logs for this purpose include DShield [25], myNetWatchman [35], and Deepsight [24].However, sharing of network audit logs is hampered by the presence of security and privacy sensitive information.By encrypting each log entry before sending it to another party, the source can allay these concerns.Later, the source may release a decryption key for a carefully specified set of log entries deemed currently relevant.For example, suppose a particular host with IP address a 1 is determined to have been compromised at time t 1 and later involved in scanning other hosts for vulnerabilities on a certain range of ports [p 1 , p 2 ].A trusted authority may then choose to release a key decrypting any entries at time t, with source address a, connecting to port p such that t ≥ t 1 , a = a 1 , and p 1 ≤ p ≤ p 2 .Note that to avoid a central point of trust, we can have multiple parties jointly act as the authority.Using techniques from secure multi-party computation [27], only when a sufficient number of them collaborate, can they generate a valid decryption key.The source would then have precise guarantees about the privacy of their network while providing useful information to other individual organizations or a global monitoring effort.The public key nature of the scheme would allow distributed, encrypted submissions to a central monitoring organization possessing the master private key and giving out decryption keys as necessary.There have been some previous attempts to protect the security of audit logs through encryption or anonymization while allowing limited queries [46,23,33], but in no previous scheme has it been possible to issue keys for conjunctions of ranges over multiple attributes while maintaining the secrecy of the attributes.In particular, we are not aware of any previous method supporting queries such as our example of (t ≥ t 1 ) ∧ (a = a 1 ) ∧ (p 1 ≤ p ≤ p 2 ) that does not require either revealing the attribute values or issuing an exponential number of key components.

Other Applications
Apart from the network audit log application, and the stock-trading application described in Section 8, we mention here some other potentially interesting applications of MRQED.

Financial audit logs.
Financial audit logs contain sensitive information about financial transactions.Our MRQED scheme allows financial institutions to release audit logs in encrypted format.When necessary, an authorized auditor can obtain a decryption key from a trusted authority.With this decryption key, the auditor can decrypt certain transactions that may be suspected of fraudulent activities.However, the privacy of all other transactions are preserved.
Medical privacy.Consider a health monitoring program.When Alice moves about in her daily life, a PDA or smart-phone she carries automatically deposits encrypted crumbs of her trajectory at a storage server.Assume that each crumb is of the form ((x, y, t), ct), where (x, y) represents the location, t represents time, and ct is Alice's contact information.During an outbreak of an epidemic, Alice wishes to be alerted if she was present at a site borne with the disease during an incubation period, i.e., if (x, y, t) falls within a certain range.However, she is also concerned with privacy, and she does not wish to leak her trajectory if she has not been to a site borne with the disease.
Untrusted remote storage.Individual users may wish to store emails and files on a remote server, but because the storage server is untrusted, the content must be encrypted before it is stored at the remote server.Emails and files can be classified with multi-dimensional attributes.Users may wish to perform range queries and retrieve only data that satisfy the queries.
Using biometrics in anonymous IBE.The MRQED scheme can also be used in biometric-based Anonymous Identity-Based Encryption (AIBE).Using biometrics in identity-based encryption first appeared in the work by Sahai and Waters [41].In this application, a person's biometric features such as finger-prints, blood-type, year of birth, eye color, etc., are encoded as a point X in a multi-dimensional lattice.Personal data is encrypted using the owner's biometric features as the identity, and the encryption protects both the secrecy of the personal data and the owner's biometric identity.Due to potential noise each time a person's biometric features are sampled, a user holding the private key for biometric identity X should be allowed to decrypt data encrypted under X , iff X and X have small distance.In particular, the SahaiWaters04 construction [41] considered the set-overlap distance (or the Hamming distance); and their encryption scheme does not hide the identity of the user.Our construction allows a user with the private key for identity X, to decrypt an entry encrypted under X , iff ∞ (X, X ) ≤ .Here ∞ denotes the ∞ distance between X and X , and is defined as In this case, the decryption region is a hypercube in multi-dimensional space.One can also associate a different weight to each dimension, in which case the decryption region becomes a hyper-rectangle.

Related Work
Search on encrypted data.The problem of search on encrypted data (SoE) was introduced in the symmetric key setting by Song et al. [44] and has had some recent improvements in security definitions and efficiency [21].Boneh et al. [10] later proposed Public Key Encryption with Keyword Search (PEKS), in which any party possessing the public key can encrypt and the owner of the corresponding private key can generate keyword search capabilities.Both SoE and PEKS can be trivially extended to support one-dimensional range queries; the extension is similar to the MRQED1 scheme described in Section 4.2.However, it is not clear that either can be used to construct a scheme supporting range queries over multiple attributes.Recent work on traitor-tracing systems [14,12] allows a more specialized sort of range query.Given a ciphertext C with attributes X = (x 1 , x 2 , . . ., x D ), a master key owner can issue a token for some value x that allow us to decide whether x d ≤ x for all 1 ≤ d ≤ D with O( √ T ) ciphertext size and token size.Applications of searchable encryption have been studied by the database community [30,22,2].Other works related to searches on encrypted data include oblivious RAMs [37,28], and private stream searching [5,38].

IBE.
The notion of Identity-Based Encryption (IBE) was introduced by Shamir [42].Several IBE schemes [20,11,7,6,18,45,36], hierarchical IBE (HIBE) schemes [31,26,8,47], and applications [41,29] were proposed since then.In particular, the HIBE scheme proposed by Boneh, Boyen, and Goh [8] can be extended to multiple dimensions (M-HIBE) efficiently and in a collusion-resistant 1 manner.The resulting scheme can be used to solve a problem similar to MRQED, but lacking the third property in the previous discussion.That is, when using M-HIBE it would not be possible to hide the attribute values associated with a ciphertext.

Anonymous IBE.
Recently, researchers have proposed anonymous IBE and HIBE schemes (AIBE, AHIBE) [15,1].The notion of anonymity is also related to key privacy [4,3].Like the HIBE scheme mentioned above, the AHIBE scheme of Boyen and Waters [15] can be extended to multiple dimensions in a collusion-resistant manner, resulting in a Multi-dimensional AHIBE (M-AHIBE) scheme.An M-AHIBE scheme could be used to implement MRQED (including the third property), but applying it directly would have a serious drawback.Because the encryption is anonymous and hides the attributes used as the public key, at time of decryption one would need to try all possible decryption keys on a given ciphertext.This incurs O(T D ) decryption cost on a single ciphertext, where T is the number of possible values each attribute may assume and may be quite large.Nevertheless, on a technical level, this AHIBE scheme and its extension to M-AHIBE are the most closely related work to ours.In particular, we prevent collusion in the same way the M-AHIBE construction does.Since we do not require the key delegation property of HIBE schemes, however, we are able to improve decryption cost to be logarithmic in T .
Recent developments.Concurrent to our work, Boneh and Waters [13] propose another construction (BonehWaters06 in Table 1) for complex queries over encrypted data.They propose a primitive called Hidden Vector Encryption, and use it in conjunctive range and subset queries.When applied to multi-dimensional range query, their scheme results in O(DT ) encryption time, ciphertext size, and public key size, and O(D) decryption key size and decryption cost.As in Table 1, D and T are the number of attributes and the number of discrete values for each attribute.Their scheme is more expensive in terms of public key size, encryption cost and ciphertext size; but saves on decryption key size and decryption cost.In applications with large T and small D (e.g., network audit logs, and the stock trading application mentioned in Section 8), our approach is more appropriate.In particular, for network audit logs, T = 2 32 for an IP address, and D may range from 2 to 4. In other applications where D is large and T is small, the BonehWaters06 construction is more appropriate.We also would like to note that the BonehWaters06 construction achieves a stronger notion of security.Their construction hides the attribute values, even when the message is successfully decrypted.This stronger security property is a key difference from our construction, in which the attribute values are revealed upon successful decryption.In Section 3, we name these two different security models match-concealing security and match-revealing security respectively.For applications like encrypted network audit logs, it is acceptable to reveal the attributes of a message when it is successfully decrypted.By relaxing the security definition to allow this possibility, we achieve O(D log T ) encryption time, ciphertext size, and public key size.This makes applications such as the encrypted network audit logs possible.However, one may conceive of other applications where the stronger security notion is necessary.

Problem Definition
In the network audit log application, a gateway encrypts network flows, and submits them to an untrusted repository.When necessary, an auditor may ask an authority for a key that allows the decryption of all flows whose attributes fall within a certain range; while the privacy of all irrelevant flows are still preserved.There is a geometric interpretation to these multi-attribute range queries.Suppose that we would like to allow queries on these three fields: time-stamp t, source address a, and destination port p.The tuple (t, a, p) can be regarded as a point X in multi-dimensional space.Now suppose we query for all flows whose t, a, p falls within some range: forms a hyperrectangle B in space.The above range query is equivalent to testing whether a point X falls inside the hyper-rectangle B.
We now formally define these notions mentioned above.Assume that an attribute can be encoded using discrete integer values 1 through T .For example, an IP address can be encoded using integers 1 through 2 32 .We use the notation [T ] to denote integers from 1 to T , i.e., [T ] = {1, 2, . . ., T }.Let S ≤ T be integers, we use [S, T ] to denote integers from S to T inclusive, i.e., [S, T ] = {S, S + 1, . . ., T }.Throughout this paper, we assume that T is a power of 2, and denote log 2 as simply log.Suppose that we would like to support range queries on D different attributes, each of them can take on values in [T 1 ], [T 2 ], . . ., [T D ] respectively.We formally define a D-dimensional lattice, points and hyper-rectangles below.
A MRQED scheme consists of four (randomized) polynomial-time algorithms: Setup, Encrypt, DeriveKey and QueryDecrypt.In the network audit log example, an authority runs Setup to generate public parameters and a master private key; a gateway runs the Encrypt algorithm to encrypt a flow.Encryption is performed on a pair (Msg, X).The message Msg is an arbitrary string, and X is a point in multi-dimensional space, representing the attributes.For example, suppose that we would like to support queries on the following three attributes of a flow: time-stamp t, source address a, and destination port p.The tuple (t, a, p) then becomes the point X, and the entire flow summary forms the message Msg.Whenever necessary, the authority can run the DeriveKey algorithm, and compute a decryption key allowing the decryption of flows whose attributes fall within a certain range.Given this decryption key, an auditor runs the QueryDecrypt algorithm over the encrypted data to decrypt the relevant flows.We now formally define MRQED.For each message Msg ∈ M, hyper-rectangle B ⊆ L Δ , and point X ∈ L Δ , the above algorithms must satisfy the following consistency constraints:

Security Definitions
Suppose that during time [t 1 , t 2 ], there is an outbreak of a worm characteristic by the port number p 1 .Now the trusted authority issues a key for the range t ∈ [t 1 , t 2 ] and p = p 1 to a research group who has been asked to study the worm behavior.With this key, the research group should be able to decrypt only flows whose time-stamp and port number fall within the given range.The privacy of all other flows should still be preserved.Informally, suppose that a computationally bounded adversary has obtained decryption keys for regions B 0 , B 1 , . . ., B q .Now given a ciphertext C = Encrypt(PK, X, Msg) such that X / ∈ B 0 , B 1 , . . ., B q , the adversary cannot learn X or Msg from C. Of course, since the adversary fails to decrypt C using keys for regions B 0 , B 1 , . . ., B q , the adversary inevitably learns that the point X encrypted does not fall within these regions.But apart from this fact, the adversary cannot learn more information about X or Msg.
We now formalize this intuition into a selective security game for MRQED.Here, the selective security notion is similar to the selective-ID security for IBE schemes [16,17,6].We prove the security of our construction in the selective model.A stronger security notion is adaptive security, where the adversary does not have to commit to two points in the Init stage of the security game defined below.In Appendix D, we give a formal definition for adaptive security, and state how it is related to the selective security model.Definition 3 (MR-selective security).An MRQED scheme is selectively secure in the matchrevealing (MR) model if all polynomial-time adversaries have at most a negligible advantage in the selective security game defined below.
• Init: The adversary submits two points X * 0 , X * 1 ∈ L Δ where it wishes to be challenged.• Setup: The challenger runs the Setup(Σ, L Δ ) algorithm to generate PK, SK.It gives PK to the adversary, keeping SK secret.
• Challenge: The adversary submits two equal length messages Msg 0 , Msg 1 ∈ M. The challenger flips a random coin, b, and encrypts Msg b under X * b .The ciphertext is passed to the adversary.
• Guess: The adversary outputs a guess b of b.
An adversary A's advantage in the above game is defined as We would like to note that a stronger notion of security is possible as defined by Boneh and Waters in their concurrent work [13].We call this stronger security notion match-concealing (MC) security, since it requires that the attribute values (i.e., the point X) remain hidden even when an entry matches a query.MC-selective security can be formally defined through the following game between an adversary and a challenger.Definition 4 (MC-selective security [13]).An MRQED scheme is selectively secure in the matchconcealing (MC) model if all polynomial-time adversaries have at most a negligible advantage in the selective security game defined below.
• Init: The adversary submits two points X * 0 , X * 1 ∈ L Δ where it wishes to be challenged.
• Setup: The challenger runs the Setup(Σ, L Δ ) algorithm to generate PK, SK.It gives PK to the adversary, keeping SK secret.
• Phase 1: The adversary adaptively issues decryption key queries for q 0 hyper-rectangles B 1 , B 2 , . . ., B q 0 , satisfying the condition that for all 0 < i ≤ q 0 , either • Challenge: The adversary submits two equal length messages Msg 0 , Msg 1 ∈ M. If in Phase 1, there exists some The challenger flips a random coin, b, and encrypts Msg b under X * b .The ciphertext is passed to the adversary.
• Phase 2: Phase 1 is repeated.The adversary adaptively issues decryption key queries for hyper-rectangles B q 0 +1 , B q 0 +2 , . . ., B q , satisfying the condition that for all q 0 < i ≤ q, either ( • Guess: The adversary outputs a guess b of b.

Likewise, an adversary A's advantage in the above game is defined as Adv
In this paper, we use the MR security model, i.e., we do not protect the privacy of the attributes if an entry is matched by the query.This security notion suffices for applications such as network audit logs, and the stock-trading application as described in Section 8.

Preliminary: Bilinear Groups
A pairing is an efficiently computable, non-degenerate function, e : G × G → G , satisfying the bilinear property that e(g r , g s ) = e(g, g) rs .G, G and G are all groups of prime order.g, g and e(g, g) are generators of G, G and G respectively.Although our MRQED scheme can be constructed using asymmetric pairing, for simplicity, we describe our scheme using symmetric pairing in the remainder of the paper, i.e., G = G.
We name a tuple G = [p, G, G , g, e] a bilinear instance, where G and G are two cyclic groups of prime order p.We assume an efficient generation algorithm that on input of a security parameter Σ, outputs G R ← Gen(Σ) where log 2 p = Θ(Σ).We rely on the following complexity assumptions: Decision BDH Assumption: The Decision Bilinear DH assumption, first used by Joux [32], later used by IBE systems [11], posits the hardness of the following problem:

Decision Linear Assumption:
The Decision Linear assumption, first proposed by Boneh, Boyen and Shacham for group signatures [9], posits the hardness of the following problem: , where z 1 , z 2 , z 3 , z 4 are picked at random from Z p , decide whether Z = g z 3 +z 4 .

A First Step towards MRQED
In this section, we first show a trivial construction for MRQED which has O(T 2D ) public key size, O(T 2D ) encryption cost and ciphertext size, O(1) decryption key size and decryption cost.Then in Section 4.2, we show that using AIBE, we can obtain an improved one-dimension MRQED scheme.Henceforth, we refer to a one-dimension MRQED scheme as MRQED 1 and refer to multidimension MRQED as MRQED D .The AIBE-based MRQED 1 construction has O(1) public key size, O(log T ) encryption cost, ciphertext size, decryption key size and decryption cost.While describing the AIBE-based MRQED 1 construction, we introduce some primitives and notations that will later be used in our main construction in Section 5.In Section 4.3, we demonstrate that a straightforward extension of the AIBE-based MRQED 1 scheme into multiple dimensions results in O (log T ) D encryption cost, ciphertext size, decryption key size and decryption cost.The AIBEbased MRQED 1 construction aids the understanding of our main construction in Section 5.By contrast, details of the AIBE-based MRQED D scheme are not crucial towards the understanding of our main construction.Therefore, we only highlight a few important definitions and give a sketch of the scheme in Section 4.3.We give the detailed description of the AIBE-based MRQED D scheme in Appendix F.

Trivial Construction
We first give a trivial construction for one-dimensional range query over encrypted data.We refer to one-dimensional range query over encrypted data as MRQED 1 where the superscript represents the number of dimensions.
In the trivial MRQED 1 construction, we make use of any secure public key encryption scheme.We first generate O(T 2 ) public-private key pairs, one for each range we encrypt Msg with public key pk s,t ; otherwise, we encrypt an invalid message ⊥ with pk s,t .The decryption key for any range [s, t] is then sk s,t , the private key for [s, t].
In Appendix E, we give a formal description of this trivial construction.
One can extend this idea into multiple dimensions.The resulting MRQED D scheme requires that one encrypt δ B (Msg, X) for all hyper-rectangles B in space.Therefore, the trivial MRQED D scheme has O(T 2D ) public key size, O(T 2D ) encryption cost and ciphertext size, O(1) decryption key size and O(1) decryption cost.

Improved MRQED 1 Construction Based on AIBE
We show an improved MRQED construction based on Anonymous Identity-Based Encryption (AIBE).For clarity, we first explain the construction for one dimension.We call the scheme MRQED 1 where the superscript denotes the number of dimensions.We note that the primitives and notations introduced in this section will be used in our main construction.

Primitives: Efficient Representation of Ranges
To represent ranges efficiently, we build a binary interval tree over integers 1 through T .Definition 5 (Interval tree).Let tr(T ) denote a binary interval tree over integers from 1 to T .Each node in the tree has a pre-assigned unique ID.For convenience, we define tr(T ) to be the set of all node IDs in the tree.Each node in tr(T ) represents a range.Let cv(ID) denote the range represented by node ID ∈ tr(T ).Define cv(ID) as the following: Let ID be the i th leaf node, then cv(ID) = i.Otherwise, when ID is an internal node, let ID 1 and ID 2 denote its child nodes, then cv(ID) = cv(ID 1 ) ∪ cv(ID 2 ).In other words, cv(ID) is the set of integers that correspond to the leaf descendants of ID.
Given the interval tree tr(T ), we define the P(x) of IDs covering a point x ∈ [1, T ], and the set Λ(x) of IDs representing a range [s, t] ⊆ [1, T ].
• Set of IDs covering a point x.For a point x ∈ [1, T ] and some node ID ∈ tr(T ), we say that ID covers the point x if x ∈ cv(ID).Define P(x) to be the set of IDs covering point x.Clearly, P(x) is the collection of nodes on the path from the root to the leaf node representing x.As an example, in Figure 1 (a), • Range as a collection of IDs.A range [s, t] ⊆ [1, T ] is represented by a collection of nodes: Λ(s, t) ⊆ tr(T ).We define Λ(s, t) to be the smallest of all subsets V ⊆ tr(T We will make use of the following properties in our AIBE-based construction:

AIBE-Based MRQED 1 Scheme
AIBE encrypts a message Msg using an identity ID as the public key.Given the private key for ID, one can successfully decrypt all messages encrypted by identity ID.The encryption scheme protects both the secrecy of the message Msg and the identity ID in the following sense: Given ciphertext C, which is an encryption of Msg by identity ID 0 , and given decryption keys for identities ID 1 , ID 2 , . . ., ID q but not for ID 0 , a computationally bounded adversary cannot learn anything about Msg or about ID 0 from the ciphertext C. Researchers have successfully constructed secure AIBE schemes [15,1] with O(1) cost in all respects: in public parameter size, encryption cost, ciphertext size, decryption key size and decryption cost.Given a secure AIBE scheme, we can construct an MRQED 1 scheme based on the following intuition.To encrypt the message Msg under point x, we encrypt Msg under all IDs in P(x).To release the decryption key for a range [s, t] ⊆ [1, T ], we release the keys for all IDs in Λ(s, t).Now if x ∈ [s, t], then P(x)∩Λ(s, t) = ∅.Suppose P(x) and Λ(s, t) intersect at node ID.Then we can apply the decryption key at ID to the ciphertext encrypted under ID, and obtain the plaintext message Msg.Otherwise, if x / ∈ [s, t], then P(x) ∩ Λ(s, t) = ∅.In this case, the security of the underlying AIBE scheme ensures that a computationally bounded adversary cannot learn any information about the message Msg or the point x, except for the obvious fact (since decryption fails) that x / ∈ [s, t].
Example.In Figure 1 one can construct a secure MRQED 1 scheme as below: • Setup(Σ, T) calls Setup * (Σ) and outputs PK and SK.
To check whether a decryption is valid, prior to encryption, we append m trailing 0s denoted 0 m to message Msg ∈ {0, 1} m .
•  T ) time.However, observe that it is not necessary to try k ID on c ID , if ID and ID are at different depth in the tree; since then, ID and ID cannot be equal.Thus we only need to try k ID on c ID if ID and ID are at the same depth in the tree, which requires knowledge of the depth of ID for ciphertext c ID .Of course, we cannot directly release ID for ciphertext c ID , since the encryption is meant to hide ID .However, since each ciphertext C has a portion at every depth of the tree, we can give out the depth of ID for each c ID ∈ C without leaking any information about ID .In this way, we reduce the decryption cost to O(log T ) rather than O(log 2 T ).
We emphasize that using AIBE as the underlying encryption scheme is crucial to ensuring the security of the derived MRQED 1 scheme.In particular, a non-anonymous IBE scheme is not suitable to use as the underlying encryption scheme, since IBE hides only the message Msg but not the attribute x.

AIBE-Based MRQED D Construction
The same idea can be applied to construct an MRQED D scheme, resulting in O(1) public key size, O (log T ) D encryption cost, ciphertext size, decryption key size, and decryption cost.Since the details of this construction is not crucial to the understanding of our main construction, we only give a sketch here and leave the full description of the scheme to Appendix F. However, we highlight a few important definitions here, including the notion of a simple hyper-rectangle, and the definition of Λ × (B).These definitions will later be used in our main construction.
We build D binary interval trees, one for each dimension.We assign a globally unique ID to each node in the D trees.
Representing a hyper-rectangle.We represent an arbitrary hyper-rectangle as a collection of simple hyper-rectangles.To illustrate this idea, we first give a formal definition of a simple hyperrectangle, and then state how to represent an arbitrary hyper-rectangle as a collection of simple hyper-rectangles.Simply put, a simple hyper-rectangle is a hyper-rectangle B 0 in space, such that B 0 can be represented by a single node in the tree of every dimension.More specifically, a hyperrectangle B(s is a simple range in the d th dimension, then we say that the hyper-rectangle B(s 1 , t 1 , . . ., s D , t D ) is a simple hyper-rectangle.A simple hyper-rectangle can be defined by a single node from each dimension.We can assign a unique identity to each simple-rectangle B 0 (s 1 , t 1 , . . ., s D , t D ) in space.Define

Definition 6 (Hyper-rectangle as a collection of simple hyper-rectangles). Given an hyper-rectangle
The hyper-rectangle B can be represented as a collection Λ × (B) of simple hyper-rectangles: In particular, for every id ∈ Λ × (B), id is a vector of the form (ID 1 , ID 2 , . . ., ID D ), where ) is a node in the tree corresponding to the d th dimension.Therefore, id uniquely specifies a simple hyper-rectangle B 0 in space.
Clearly, |Λ × (B)| = O (log T ) D ; in addition, Λ × (B) can be efficiently computed.Given the above definitions, we briefly describe the AIBE-based MRQED D construction.The detailed description is provided in Appendix F.

Encryption.
Suppose that now we would like to encrypt a message Msg and the point X = (x 1 , x 2 , . . ., x D ).We encrypt the message Msg under all simple hyper-rectangles that contain the point X = (x 1 , x 2 , . . ., x D ).This is equivalent to encrypting Msg under the cross-product of D different paths to the root.Specifically, for d ∈ [D], denote P d (X) := P(x d ).P d (X) is the path from the root to the leaf node representing x d in the d th dimension.Define the cross-product of all D different paths to the root: Then, to encrypt Msg and X, we use AIBE to encrypt Msg under every id ∈ P × (X).Since   Now if X ∈ B, then P × (X) ∩ Λ × (B) = ∅; in addition, P × (X) and Λ × (B) intersect at exactly one simple hyper-rectangle id B 0 , where the keys and the ciphertexts overlap.In this case, we use the key for id B 0 to decrypt the ciphertext for id B 0 .Otherwise, if X / ∈ B, then P × (X) ∩ Λ × (B) = ∅.In this case, the security of the underlying AIBE schemes ensures the security of the MRQED D constructions.In Appendix F, we show that the cost of decryption is also O (log T ) D .

Our MRQED D Construction
In

Intuition
We build D interval trees over integers from 1 to T , each representing a separate dimension.Assume each tree node has a globally unique ID.In the previous section, we showed a naive construction for MRQED D based on AIBE.The naive construction encrypts Msg under the O((log T ) D ) simple hyper-rectangles that contain the point X; and releases decryption keys for the O((log T ) D ) simple hyper-rectangles that compose a hyper-rectangle B. Our goal is to reduce the ciphertext size and decryption key size to O(D log T ) instead.However, as we will soon explain, naively doing this introduces the collusion attack as shown in Figure 2 (b).Our main technical challenge, therefore, is to devise ways to secure against the collusion attack.
Reducing the ciphertext size.In other words, rather than encryption Msg for each simple hyperrectangle in P × (X) = P 1 (X) × . . .× P D (X), we would like to encrypt Msg for each tree node in the the union of these D different paths: Reducing the decryption key size.Instead of representing an arbitrary hyper-rectangle using the collection of simple hyper-rectangles, we can represent a simple hyper-rectangle B as the collection of disjoint intervals over different dimensions: Definition 7 (Hyper-rectangle as a collection of nodes).A hyper-rectangle B ⊆ L Δ gives a collection of nodes corresponding to disjoint intervals over different dimensions: Note that for all hyper-rectangle B ⊆ L Δ , |Λ ∪ (B)| = O(D log T ); in addition, Λ ∪ (B) can be computed efficiently.
Using the above definition, rather than releasing keys for each simple hyper-rectangle in Λ × (B) = Λ 1 (B) × . . .× Λ D (B), we would like to release keys for each Example. Figure 2 (a) is an example in two dimensions.To encrypt under the point (3, 5), we find the path from the leaf node 3 to the root in the first dimension, and the path from the leaf node 5 to the root in the second dimension.We then produce a block in the ciphertext corresponding to each node on the two paths.In the first dimension, we produce blocks c 1 , c 2 , c 3 and c 4 .In the second dimension, we produce blocks c 5 , c 6 , c 7 and c 8 .To release decryption keys for the range [2,6] × [3,7], we find a collection Λ(2, 6) of nodes covering the range [2,6] in the first dimension; and a collection Λ(3, 7) of nodes covering [3,7] in the second dimension.We issue a block in the decryption key corresponding to each node in Λ(2, 6) and in Λ(3, 7).In the first dimension, we create blocks k ID A , k ID B , and k ID C ; and in the second dimension, we create blocks k ID D , k ID E , and k ID F .
Preventing the collusion attack.Unfortunately, naively doing the above is equivalent to applying the AIBE-based MRQED 1 scheme independently in each dimension.As we demonstrate in Figure 2 (b), such a scheme is susceptible to the collusion attack.Suppose that Figure 2 (b), every rectangle is a simple rectangle.Now suppose that an adversary were given the decryption keys for region R 1 and R 4 , then the adversary would have collected keys With these, the adversary would be able to reconstruct the keys for R 2 and R 3 : Hence, our major challenge is to find a way to secure against the collusion attack without incurring additional cost.We use a binding technique to prevent the collusion attack: we use re-randomization to tie together the sub-keys in different dimensions.For example, in Figure 2 (b), when we release the decryption key for region R 1 , instead of releasing {k x1 , k y1 }, we release { μ x k x1 , μ y k y1 }, where μ x and μ y are random numbers that we pick each time we issue a decryption key.Likewise, when releasing the key for region R 4 , we release { μ x k x2 , μ y k y2 }, where μ x and μ y are two random numbers picked independently from μ x and μ y .Of course, in the real construction, μ x and μ y ( μ x and μ y ) also need to satisfy certain algebraic properties (e.g., μ x μ y = μ x μ y = some invariant) to preserve the internal consistency of our scheme.In this way, components in the decryption key for R 1 cannot be used in combination with components in the decryption key for R 4 .

The Main Construction
We are now ready to describe our construction.Define L = O(log T ) to represent the height of a tree.Assume that node IDs are picked from Z * p .We append a message Msg ∈ {0, 1} m with a series of trailing zeros, 0 m , prior to encryption.Assume that {0, 1} m+m ⊆ G .

Setup(Σ, L Δ )
To generate public parameters and the master private key, the setup algorithm first generates a bilinear instance G = [p, G, G , g, e] R ← Gen(Σ).Then, the setup algorithm does the following.
1. Select at random the following parameters from Z 8DL+1 p : In addition, we require that the α's and the β's be forcibly non-zero.At this point, we give a brief explanation of our notation.The variable ϕ is used to index a tuple where d denotes the dimension and l denote the depth of a node in the corresponding tree.

Publish G and the following public parameters PK
3. Retain a master private key SK ∈ G 8DL+1 comprising the following elements: Notice that in the public parameters and the master key, we have different versions of the same variable, e.g., a ϕ,1 , a ϕ,2 , a ϕ,1 , a ϕ,2 .Although they seem to be redundant, they are actually need to provide sufficient degrees of randomness for our proof to go through.The reasons for having these different versions will become clear once the reader has gone over the detailed proof provided in Appendix C.

DeriveKey(PK, SK, B)
The following steps compute the decryption key for hyper-rectangle B, given public key PK and master private key SK.
such that d∈ [D] μ d = ω.The reason for having an overhead tilde for the variable μ d is to associate it with the variable ω, since they both belong to the group G, and they satisfy the condition that d∈[D] μ d = ω.We note that the random μ d 's generated in this stage are later used to re-randomize the components of the decryption key.In this way, components in different dimensions are tied to each other; and components from one decryption key cannot be used in combination with components from another decryption key.This is how we prevent the collusion attack as shown in Figure 2 Observe that we release a portion of the decryption key for each node in Λ ∪ (B), as opposed to for each hyper-rectangle in Λ × (B).In this way, the size of the private key is O(DL), instead of O(L D ).Also observe that we multiply the first element of DK(ID) by μ d .This illustrates the binding technique used to tie together components in different dimensions.In this way, components in one decryption key cannot be used in combination with components in another decryption key; therefore, we successfully prevent the collusion attack.

Encrypt(PK, X, Msg)
We create a block in the ciphertext for every ID ∈ P ∪ (X).Equivalently, for each dimension d and depth l, denote ϕ = (d, l), we create a portion of the ciphertext corresponding to the node I ϕ , residing in the d th tree at depth l, on the path P d (X) to the root.We now describe the Encrypt algorithm in the following steps: , the node at depth l in P d (X) in the d th dimension.Now compute and output the following ciphertext C ∈ G × G 4DL+1 :

. , ID D ).
We also need to find the correct blocks in the ciphertext to apply this key for id B 0 .Recall that the ciphertext is of the form . c ϕ is the block in the ciphertext corresponding to a node in the d th dimension and at depth l of the tree.Define Φ(ID) := (d, l) to extract the dimension and depth of the node ID.Now for a sub-key DK(ID), define ϕ = Φ(ID), it is not hard to see that DK(ID) should be used in combination with the block c ϕ in the ciphertext.
The following algorithm iterates through the simple hyper-rectangles in Λ × (B) and checks if the ciphertext can decrypt to a valid message under each simple hyper-rectangle in Λ × (B).
For each simple hyper-rectangle (2) Try to decrypt C under B 0 with the collection {DK(ID 1 ), DK(ID 2 ), . . ., DK(ID D )} of sub-keys: If V is of the form Msg||0 m , then output Msg as the decrypted plaintext and exit.
If for all simple hyper-rectangles in Λ × (B), the previous step fails to produce the plaintext, then output ⊥.
When done naively, the above QueryDecrypt algorithm takes O(D(log T ) D ) time.However, if one saves intermediate results, it can be done in O((log T ) D ) time with O(D log T ) storage.The above numbers takes into account all group operations, include multiplication, exponentiation and bilinear pairing.However, since a pairing operation is typically more expensive than exponentiation (and far more expensive than multiplication) in known bilinear groups, we are particularly interested in reducing the number of pairings at time of decryption.Notice that we can precompute all pairings e(c 0 , k ID d ,0 ) and pairings e(c ϕ d ,i , k ID d ,i ) for 1 ≤ i ≤ 4, and store the results in a look-up table.Therefore, the decryption algorithm requires O(D log T ) pairings in total.

Consistency, Security
The following two theorems state the consistency and security of our MRQED construction.

Theorem 6.2 (Selective security). The above defined MRQED construction is selectively secure against polynomial-time adversaries.
Below we give an overview of the techniques used in the security proof.The detailed proofs of Theorem 6.1 and Theorem 6.2 are provided in Appendix C and Appendix B respectively.To prove the selective security of our MRQED D construction, we decompose the selective MRQED game into two games: a selective confidentiality game and a selective anonymity game.By the hybrid argument, if no polynomial-time adversary has more than negligible advantage in either the confidentiality game or the anonymity game, then no polynomial-time adversary has more than negligible advantage in the combined selective MRQED game.
In the proof, we build a simulator that leverages an MRQED adversary to solve the D-BDH problem or the D-Linear problem.The simulator inherits parameters specified by the D-BDH/D-Linear instance, hence, it has incomplete information about the master key.Therefore, the crux of the proof is how to simulate the key derivation algorithm without knowing the complete master key.In comparison, the anonymity proof is more complicated than the confidentiality proof, because it involves a hybrid argument containing 2DL steps.In step (d 1 , l 1 , n 1 ) of the hybrid argument, y ϕ 1 ,n 1 and y ϕ 1 ,n 1 (ϕ 1 = (d 1 , l 1 )) in the master key contain unknown parameters inherited from the D-Linear instance.Therefore, we need to condition on the relative position between X * and the (d 1 , l 1 ) in question.Our proof techniques are similar to that presented in the AHIBE paper [15].

Practical Performance
In this section, we give a detailed analysis of the performance of the MRQED D scheme given in Section 5 in practical scenarios.We use the conditional release of encrypted network audit logs as our motivating application.
Assumptions.To evaluate the scheme of Section 5 in this application, we detail a set of scenarios regarding the searchable fields present in the logs.We assume log entries contain the fields listed in Table 2.The 17-bit time field is sufficient to distinguish times over a period of about 15 years with a one hour resolution, or about three months at a one minute resolution.More precise times may be stored in the non-searchable portion of the message if desired.The protocol field corresponds Table 2: Fields appearing in a network audit log and their possible values.
to the actual bits of the corresponding field in an IP header (where, for example, 6 denotes TCP and 133 denotes Fibre Channel).Various subsets of these fields may be included as searchable attributes in MRQED D .Other fields and any additional associated data such as a payload may be included as the encrypted message.Regardless of message length, we need only use the MRQED D scheme to encrypt a single group element, which may be a randomly generated symmetric key (e.g., for AES) used to encrypt the message.Benchmarks for the selected pairing were run on a modern workstation.The processor was a 64-bit, 3.2 Ghz Pentium 4. We used the Pairing-Based Cryptography (PBC) library [34], which is in turn based on the GNU Multiple Precision Arithmetic Library (GMP).The relevant results are given in Table 3.Using these benchmark numbers, we now estimate the performance of our encryption scheme under several scenarios for the network audit log application.
Operation Time pairing (no preprocessing) 5.5 ms pairing (after preprocessing) 2.6 ms preprocess pairing 5.9 ms exponentiation in G, G 6.4 ms exponentiation in G 0.6 ms multiplication in G 5.1 μs Table 3: Group arithmetic and pairing performance benchmarks on a modern workstation [34].
Public parameters and master key.The space required to store the public parameters and master key is logarithmic with respect to the number of possible attribute values.Specifically, denote the set of attributes as A = {sip, dip, port, time, prot}.Then for each attribute a ∈ A, define the height of the tree L a = log 2 T a + 1.For example, L sip = 33 and L prot = 9.Then the public parameters PK require a total of 8 a∈A L a = 880 elements of G and one element of G .Assuming 512bit representations2 of elements of G and G , the total size of PK is 55KB.The master key SK contains the same number of elements, again requiring 55KB of storage.More space efficient pairings than the one used in this estimate are available, but this one was selected for speed of evaluation.
Computation time for Setup is reasonable, given that it is only run once.Computing the public and private parameters in Setup requires roughly 16 a∈A L a exponentiations and one pairing, for a total of about 11.3s.Time spent on multiplication in this case is negligible.
Encryption.Saving the group elements of a ciphertext requires 4 a∈A L a + 2 group elements, or 28KB.Note that we normally just encrypt a session key, so this is a constant overhead beyond the actual length of the message.Running Encrypt requires about two exponentiations for each group element, resulting in a time of about 5.6s.While significant, this overhead should be acceptable in most cases in the network audit log example.If audit logs are high volume, the best strategy may be to produce periodic summaries rather than separately encrypting each packet.The searchable attributes of such summaries would reflect the collection of entries they represent, and the full contents of the entries could be included as the encrypted message without incurring additional overhead.In systems containing a cryptographic accelerator chip supporting ECC (such as some routers), much higher performance is possible.For example, the Elliptic Semiconductor CLP-17 could reduce the time of exponentiation from 6.4ms to 30μs [19], resulting in a total encryption time as low as 27ms.
Key derivation and decryption.We now consider decryption keys and the running time of the decryption algorithm, the more interesting aspects of the scheme's computational and storage requirements.The space required to store a decryption key, the time to derive it, and the time to decrypt using it depend only on the ranges of attributes for which it permits decryption.Unlike the computational and storage requirements discussed thus far, these costs do not depend on the full range of possible values, only those associated with the key.These costs depend on the number of key components necessary to represent the permissible range along each dimension.For example, suppose a particular decryption key DK only allows decryption of entries with a destination port in the range [3,7] (perhaps placing other requirements on the other attributes).Referring back to Figure 1, we see that three tree nodes are necessary to cover this range, so DeriveKey would include these three for the destination port dimension in DK.Similarly, given some decryption key DK, we denote the number of tree nodes necessary to cover the decryption range in each of the dimensions a ∈ A by N a = |Λ a (B)| (using the notation of Section 5).So in this example, N port = 3.Note that for any a ∈ A, in the worst case, N a = 2L a − 2.
Now given N a for each a ∈ A, we may compute the decryption costs.A decryption key consists of 5 a∈A N a group elements and DeriveKey performs 8 a∈A N a exponentiations.The number of operations necessary to decrypt using a key DK is slightly more subtle.While QueryDecrypt is Θ( a∈A L a ) (i.e., Θ((log T ) D )) overall, only O( a∈A L a ) (i.e., O(D log T )) pairings are required, as mentioned in Section 5.2.Specifically, we need only compute 5 a∈A N a pairings to populate a lookup table containing values of e(c 0 , k ID,0 ), e(c ϕ,1 , k ID,1 ), e(c ϕ,2 , k ID,2 ), e(c ϕ,3 , k ID,3 ), e(c ϕ,4 , k ID,4 ), and e(c ϕ,5 , k ID,5 ).These values are enough to complete the QueryDecrypt algorithm.Assuming a key will normally be used to decrypt a batch of ciphertexts one after another, we may further reduce the cost of pairings by preprocessing with the key.As shown in Table 3, preprocessing reduces the pairing time by about half, at a one time cost (per decryption key DK) equivalent to one or two decryptions.Computed naively, the sequence of trials in step one of QueryDecrypt end up requiring a total of |A| a∈A N a multiplications in G .This can be somewhat reduced.Let S 1 , . . .S |A| be { N a | a ∈ A } sorted in ascending order: S 1 ≤ S 2 ≤ . . .S |A| .Then by saving intermediate results between trials and ordering the dimensions appropriately, it is possible to complete step one with a total of

Specific scenarios.
We have now computed the costs associated with the storage and usage of a decryption key in terms of N a for a ∈ A, but we have not yet specified N a .If we assume the range for each attribute is randomly selected (uniformly), then for each a ∈ A, the expected value of N a is L a − 1.This results in a decryption key size of 33KB and a running time for DeriveKey of 5.4s.The corresponding worst-case decryption time3 is 13.1s.We note that this is a major cost, and likely to be inconvenient if significant quantities of log entries must be decrypted.Fortunately, queries eliciting such long decryption times are not likely to be necessary in practice.In fact, fairly  elaborate queries are possible while keeping decryption costs low.
In Table 4 we provide several examples that help demonstrate this.The first entry illustrates the fact that specifying a single value, all values, or a range of values falling on power-of-two boundaries (as in the case of an IP subnet) for some attribute a results in N a = 1, reducing decryption time dramatically.In the next example, several attributes are required to be in general ranges, or, in the case of prot, selected from a small set.This results in larger numbers of key components and slightly longer decryption times.Still, the decryption time in this case is far below the time with each range randomly selected.As shown by the third example, larger ranges result in larger values of N a and, again, somewhat larger, but still relatively low, decryption times.

The Dual Problem and Stock Trading through a Broker
In the MRQED problem, one encrypts a message Msg under a point X in multi-dimensional space, and given a hyper-rectangle B, the master key owner can construct a capability, allowing an auditor to decrypt all entries satisfying X ∈ B. On the other hand, the privacy of the irrelevant entries are still preserved.
Informally, the natural dual problem to MRQED is where one encrypts under a hyper-rectangle B, and given a point X, the master key owner can construct a capability allowing an auditor to decrypt all entries satisfying B X. Like in MRQED, we require that the privacy of all irrelevant entries be preserved.We now show an interesting application of the dual problem, and then show that MRQED implies a solution for the dual problem.
An interesting application of the dual problem is for trading stocks and other securities.Suppose an investor trades stocks through a broker.The investor specifies a price range and a time range, such that if the stock price falls within that range during a specific period of time, the broker can buy or sell the stock on behalf of the investor.This is usually referred to as a stop order, limit order, or stop-limit order.Sometimes, the investor may not fully trust the broker, and may wish to conceal the price and time ranges from the broker before an order is executed.
The dual problem can be applied in such scenarios to address the privacy concerns of investors.In particular, the stock exchange, or any third-party with knowledge of the real-time stock price can act as the trusted authority who owns the master key.For convenience, in the following description, we assume that the stock exchange is the trusted authority.The investor first encrypts the order along with the desired price and time ranges, and sends the encrypted order to the broker.Suppose that at a certain point of time t, the stock price is p.The stock exchange constructs a decryption key for the pair (t, p), and hands it to the broker.With this decryption key, the broker can decrypt all orders whose price and time ranges match the current price p and the current time t, and execute these orders.For orders whose price and time ranges do not match the current price and time, the broker cannot learn any additional information about these orders.
MRQED implies the dual problem.We use a two-dimensional example to illustrate how MRQED implies a solution for the dual problem. 4 ), and output the public key PK, and master key SK.In essence, the above construction maps a range 4 , and testing if a point (x, y) is within the range It is easy to verify that the security of the MRQED scheme guarantees a similar notion of security for the dual construction, i.e., if a decryption key fails to decrypt a certain ciphertext entry, then a probablistic polynomial adversary cannot learn any additional information about that entry.

Adaptive Security
Our scheme is provably secure in the selective-ID model.A stronger notion of security is adaptive-ID security (also known as full security), i.e., the adversary does not have to commit ahead of time which point in the lattice to attack.We present the formal definition for MRQED adaptive-ID security in Appendix D .Previous research has shown that IBE schemes secure in the selective-ID sense can be converted to schemes fully secure [6,18,45,36] with some loss in security.In particular, Boneh and Boyen prove the following theorem: Theorem 8.1 ([6]).A (t, q, )-selective identity secure IBE system (IND-sID-CPA) that admits N distinct identities is also a (t, q, N )-fully secure

IBE (IND-ID-CPA).
This technique can be applied to our case to achieve full confidentiality and anonymity.In our case, the scheme admits N = T D identities and hence that would be the loss factor in security.

Conclusion
We design an encryption scheme that allows us to encrypt an arbitrary message and a set of attributes.An authority holding a master key can issue a search capability to an authorized party, allowing it to decrypt data entries whose attributes fall within specific ranges; while the privacy of other data entries is preserved.We prove the security of our scheme under the D-BDH and the D-Linear assumptions in certain bilinear groups.We also study the practical performance of our construction in network audit log applications.Apart from network audit logs, MRQED can be useful in various other applications such as financial audit logs, untrusted email servers and medical privacy.In particular, we show that the dual problem can be useful for investors who wish to trade stocks through a broker in a privacy-preserving manner.

A Notations
In Table 5, we summarize the notations used throughout this paper.path to root in the d th dimension for the point X Sec.4.3 P × (X) cross-product of all D paths to root for the point X Sec.4.3 union of all D paths to root for the point X Sec.

B Proof of Consistency
Proof of Theorem 6.1: For simplicity, let ξ(x) = e(g, g) x , and denote I ϕ d = I ϕ d (X).Now decryption for B 0 proceeds as follows: n∈ [2] , and the ciphertext is distributed uniformly at random in G .Hence the probability that V is of the form Msg||0 m is less than

C Proof of Security
To prove the selective security of our MRQED D construction, we decompose the selective MRQED game into two games: a selective confidentiality game and a selective anonymity game.By the hybrid argument, if no polynomial-time adversary has more than negligible advantage in either the confidentiality game or the anonymity game, then no polynomial-time adversary has more than negligible advantage in the combined selective MRQED game.The terminology confidentiality and anonymity that we use here is adopted from AIBE schemes.
Definition 8 (MRQED selective confidentiality game).The MRQED selective confidentiality game is defined as below.
• Init: The adversary A outputs a point X * where it wishes to be challenged.
• Setup: The challenger runs the Setup(Σ, L Δ ) algorithm to generate PK, SK.It gives PK to the adversary, but does not divulge SK.
• Phase 1: The adversary is allowed to issue decryption key queries for hyper-rectangles that do not contain X * .
• Challenge: The adversary submits two equal length messages Msg 0 and Msg 1 .The challenger flips a random coin, b, and encrypts Msg b under X * .The ciphertext is passed to the adversary.
• Guess: The adversary outputs a guess b of b.
Definition 9 (MRQED selective anonymity game).The MRQED selective anonymity game is defined as below.
• Init: The adversary A outputs two points X 0 and X 1 , where it wishes to be challenged.
• Setup: The challenger runs the Setup(Σ, L Δ ) algorithm to generate PK, SK.It gives PK to the adversary, but does not divulge SK.
• Phase 1: The adversary is allowed to issue decryption key queries for hyper-rectangles that do not contain X 0 and X 1 .
• Challenge: The adversary submits a message Msg.The challenger first flips a random coin b, and then encrypts Msg under X b .The ciphertext is passed to the adversary.
• Guess: The adversary outputs a guess b of b.
In either game, we define the adversary A's advantage as Hence, it suffices to prove our MRQED construction IND-sID-CPA and ANON-sID-CPA secure.We say that an MRQED scheme is (τ, q, ) secure if any adversary making q range queries for decryption keys, cannot have more than advantage within time τ .
In particular, Θ(qD log T ) comes from the fact that the simulator needs O(D log T ) time to compute the decryption key for each hyper-rectangle queried.The 2D log T + 1 loss factor in comes from the hybrid argument we use to prove anonymity, and additive 1/p comes from the probability that bad events happen in the simulation so that the simulator has to abort.

C.1 Proof: Confidentiality
Proof of Theorem C.2: We reduce the semantic security of MRQED to the hardness of the D-BDH problem.Let [g, g 1 , g 2 , g 3 , Z] denote the D-BDH instance supplied to the simulator, B, where g 1 = g z 1 , g 2 = g z 2 , g 3 = g z 3 , the simulator's task is to decide whether or not Z = e(g, g) z 1 z 2 z 3 .And to do this, the simulator leverages an MRQED IND-sID-CPA adversary, A.
We describe a reduction such that if Z = e(g, g) z 1 z 2 z 3 , the simulator produces a valid ciphertext; otherwise, the first term c in the ciphertext is random.Hence, if the adversary could break the confidentiality of the scheme, the simulator would be able to solve the D-BDH problem.
2. Release the following public parameters to the adversary.[2] Note that this posits that ω = z 1 z 2 ; in addition, both ω and ω are both unknown to the simulator.
3. Compute what it can of the master key.[2] Portion ω of the master key is unknown to the simulator.  [2  subject to the constraint that d∈ [D] μ d = 0.

Challenge:
The adversary gives the simulator two messages Msg 0 and Msg 1 .The simulator picks a random bit b, and encrypts Msg b under point X * as below: 2. Compute and release the following as the ciphertext.[2] Note that this implies that r = z 3 ; and if Z = e(g, g) z 1 z 2 z 3 , it is easy to verify that the ciphertext is well-formed, due to the fact that θϕ,n [2] .On the other hand, if Z is a random number, then the first term c in the ciphertext is random and independent of the remaining terms.

C.2 Proof: Anonymity
In Definition 9 of the selective-ID anonymity game, the challenger flips a random coin b in the Challenge phase.An equivalent definition is where the challenger flips the coin b in the Setup phase before running the Setup(Σ, L Δ ) algorithm.This new definition can be further translated into a real-or-random version which we will use in the following proof of anonymity.In the real-orrandom game, the adversary commits to only one point X * in the Init phase; any of its subsequent range queries must not contain X * ; in the Challenge phase, the challenger either returns a faithful encryption of Msg under X * or a completely random ciphertext; and the adversary's job is to distinguish between these two worlds.It is easy to verify that the above real-or-random definition implies the selective-ID anonymity definition as stated in Definition 9 [15].
2. Compute and release to the adversary the following public parameters: This posits that α ϕ 1 ,n 1 = z 1 , β ϕ 1 ,n 1 = z 2 , both of which are unknown to the simulator.
3. Compute what it can of the private key: Note that the simulator does not know y ϕ 1 ,n 1 and y ϕ 1 ,n 1 .
The following lemma shows that even if we do not know the parameters z 1 , z 2 , y ϕ 1 ,n 1 or y ϕ 1 ,n 1 , we can still compute certain terms efficiently.
Moreover, the following two terms can also be computed efficiently we use simply θ i to denote θ ϕ i ,n i , and θ i to denote θ ϕ i ,n 1 .We use simply θ2 to denote θϕ 2 ,n 2 , and θ 2 to denote θ ϕ 2 ,n 2 .Notice we do not define θ1 , since θϕ 1 ,n 1 and θ ϕ 1 ,n 1 are not defined.Define for i ∈ Recall that the simulator picked parameters such that θ2 I * ϕ 2 + θ 2 = 0.In addition, since First, the simulator pick λ uniformly at random and define Observe that λ 2 is distributed uniformly, but we cannot compute λ 2 efficiently because we do not know z 2 .However, since we know g z 2 , we can compute g λ 2 efficiently.Hence, it follows that we can compute the two terms in (4) efficiently in the following way.
It remains to show how to compute the term in (3).Rewrite (3) as below: which can be computed efficiently given g z 1 and g z 2 .
Phase 1: Suppose the adversary makes a decryption query for the hyper-rectangle B(s 1 , t 1 , . . ., s D , t D ).Since B does not contain X * , there exists a dimension , where x * d 0 is X * projected onto the d th 0 dimension.Hence, exactly one of the following cases must be true: Case 2: There exists ID ∈ Λ d 1 (B) such that Φ(ID) = ϕ 1 and ID = I ϕ 1 (X * ).Note that in this case, for all ID ∈ Λ d 1 (B) such that ID = ID, ID = I ϕ (X * ), where ϕ = Φ(ID ); moreover, there exists a dimension d 0 , such that for all ID 0 ∈ Λ d 0 (B), ID 0 = I ϕ 0 (X * ), where ϕ 0 = Φ(ID 0 ).
Figure 3 illustrates the above two cases with a 2-dimensional example.We now explain how the simulator generates the decryption key in each of the above cases.
Case 1: (a) Pick at random ID,2 ] represent the element in DK for ID, compute and release DK(ID) as below: Since the simulator does not know y ϕ 1 ,n 1 or y ϕ 1 ,n 1 , it needs to use Lemma C.5 to generate DK(ID).Let n = n 1 .To apply Lemma C.5, the simulator first picks at random λ ID,n 1 , and rewrites k ID,0 as Since ID = I ϕ 1 (X * ) , the simulator can apply Lemma C.5 by substituting (d 2 , l 2 , n 2 ) in the lemma with (d 1 , l 1 , n ), and λ 1 with λ ID,n 1 ; in addition, both ID 1 and ID 2 in the lemma are substituted with ID.
Case 2: (a) Pick at random ID,2 ] represent the element in DK for ID, compute and release DK(ID) as below: This implies that μ d 0 = g μ d 0 • Υ.Note that Υ cannot be computed efficiently, as the simulator does not know y ϕ 1 ,n 1 or y ϕ 1 ,n 1 .However, since ID = I ϕ 0 (X * ), the simulator can apply Lemma C.5 by substituting (d 2 , l 2 , n 2 ) in the lemma with (d 0 , l, 1), λ 1 with λ ID,n 1 , ID 1 with ID, and ID 2 with ID.The remaining terms in k ID,0 can be computed efficiently.
(f) For ID, let n = n 1 .Pick λ ID,n at random from Z p .Then compute and release the following DK(ID): Again, to be able to generate k ID,0 , Lemma C.5 is required.However, in this case, a slight complication is involved, since two terms in k ID,0 contain y ϕ 1 ,n 1 and y ϕ 1 ,n 1 : Now the simulator picks λ ID,n 1 at random from Z * p , and computes Here we require that θ ϕ 1 ,n  If Y is a random number, then term c (a) (d 1 ,l 1 ),n 1 is random and independent of the remaining terms of the ciphertext.
ID ∈ Λ(s, t), that is to say, we denote [s, t] as the collection of simple ranges, and issue a key for every simple range in that collection.
The analog of a simple range in multiple dimensions is a simple hyper-rectangle.To define a simple hyper-rectangle, we first build D interval trees, one corresponding to each dimension.We assign a globally unique ID to each tree node.Simply put, a simple hyper-rectangle is a hyper-rectangle B 0 in space, such that B 0 can be represented by a single node in the tree of every dimension.More specifically, a hyper-rectangle B(s 1 , t 1 , . . ., s D , t D ) in space is composed of a range along each dimension.If for all 1 ≤ i ≤ D, |Λ(s i , t i )| = 1, i.e., [s i , t i ] is a simple range in the i th dimension, then we say that the hyper-rectangle B(s 1 , t 1 , . . ., s D , t D ) is a simple hyperrectangle.A simple hyper-rectangle can be defined by a single node from each dimension.We can assign a unique identity to each simple-rectangle B 0 (s 1 , t 1 , . . ., s D , t D ) in space.Define id B 0 = (ID 1 , ID 2 , . . ., ID D ) , where ID i (1 ≤ i ≤ D) is the node representing [s i , t i ] in the i th dimension.
Analogous to tr(T ), we now define U to be the set id B 0 B 0 is a simple hyper-rectangle .U can be thought of as the set of all simple hyper-rectangles in space.Analogous to cv(ID) defined for one dimension, define cv(id B 0 ) = B 0 .Below we define P × and Λ × analogous to P and Λ in one dimension: • Set of id's covering a point X.For a point X in space, P × (X) is the set of all id's in U such that X ∈ cv(id); hence, in this case, P × (X) is the set of all simple hyper-rectangles that contain the point X.Let X = (x 1 , x 2 , . . ., x D ).It is not hard to see that the cross-product P 1 (X) × P 2 (X) × . . .× P D (X) define all simple hyper-rectangles containing X. Therefore, P(X) = P 1 (X) × P 2 (X) × . .The above definitions satisfy the following properties: For a point X and a hyper-rectangle B, if X ∈ B, then P × (X) ∩ Λ × (B) = ∅; in addition, they intersect at only one simple hyper-rectangle.Otherwise, if X / ∈ B, then P × (X) ∩ Λ × (B) = ∅.Now we may apply the same AIBE-based construction of Section 4.2 to the multi-dimension case.The resulting scheme encrypts a message Msg under every simple hyper-rectangle in spaces that contain the point X = (x 1 , x 2 , . . ., x D ).This is equivalent to encrypting Msg under every id ∈ P × (X), where P × (X) is the cross-product of all paths from a leaf node representing x i , to the root of the tree in the i th dimension: P × (X) = P 1 (X) × P 2 (X) × . . .× P D (X).To release the decryption key for hyper-rectangle B, it releases the key for a set of simple hyper-rectangles that compose B. In other words, we release the key for every id ∈ Λ × (B).Since both P × (X) and Λ × (B) have size O (log T ) D , the AIBE-based MRQED D scheme has O (log T ) D encryption cost, ciphertext size, and decryption key size.Now we examine the cost of decryption.Suppose DK B is our decryption key for hyperrectangle B, and DK B is composed of a key k B 0 for every simple hyper-rectangle in Λ × (B).Let C denote a ciphertext under point X.C consists of a component c B 0 for every simple hyperrectangle containing the point X.Now if we naively try every k B 0 over every c B 0 , then decryption cost would be O (|P × (X)| • |Λ × (B)|), and in this case, O (log T ) 2D .However, just as in the one dimensional case, we know that ID and ID cannot be equal if they are at different depths in the tree.Define (ID) to extract the depth of node ID in its tree.For id = (ID 1 , ID 2 , . . ., ID D ), where ID i is a node in the tree corresponding to the i th dimension, define (id) = ( (ID 1 ), (ID 2 ), . . ., (ID D )).Therefore, we only need to try k B 0 over c B 0 when (id B 0 ) = (id B 0 ).Of course, we cannot directly release B 0 for the ciphertext c B 0 , since the ciphertext is meant to hide the point X being encrypted.However, observe that since we are encrypting a message under all id ∈ P 1 (X) × P 2 (X) × . . .× P D (X), (id) naturally establishes a bijection between c id ∈ C and (l 1 , l 2 , . . ., l D ) ∈ [L] D .Therefore, we can release (id) along with every ciphertext c id without leaking any information about X.Now since we only need to try k B 0 over c B 0 when (id B 0 ) = (id B 0 ), the decryption cost is reduced to O (log T ) D instead of O (log T ) 2D .
(D • T ) O(D • T ) O(D • T ) log T ) D ) O((log T ) D ) O((log T ) D ) O((log T ) D ) MR Our scheme O(D • log T ) O(D • log T ) O(D • log T ) O(D • log T ) O((log T ) D ) MR A ciphertext and a decryption key in MRQED 1 .
(b), we show a ciphertext C encrypted under the point x.Let L = O(log T ) denote the height of the tree, C is composed of O(log T ) components: {c 1 , c 2 , . . ., c L }. On the right, we show the decryption keys for the range [3, 7].Since [3, 7] can be represented by the set of nodes Λ(3, 7) = {ID A , ID B , ID C }, the decryption key for [3, 7] consists of three sub-keys, k ID A , k ID B and k ID C .The AIBE-based construction has O(1) public key size, O(|P(x)|) encryption cost and ciphertext size, and O(|Λ(s, t)|) decryption key size.Since |P(x)| = O(log T ), and |Λ(s, t)| = O(log T ), we get O(log T ) in encryption cost, ciphertext size, and decryption key size.Later, we will show that decryption can be done in O(log T ) time as well.Stated more formally, given a secure AIBE scheme Setup * (Σ), DeriveKey * (PK, SK, ID), Encrypt * (PK, ID, Msg), Decrypt * (PK, DK, C) , |P × (X)| = O (log T ) D , both encryption cost and ciphertext size are O (log T ) D .Key derivation and decryption.To issue decryption keys for a hyper-rectangle B, we issue a key for every id ∈ Λ × (B).Since |Λ × (B)| = O (log T ) D , the decryption key has size O (log T ) D .
A ciphertext and a decryption key in MRQED 2 .
Section 4, we showed an AIBE-based MRQED D construction with O(1) public key size, O (log T ) D encryption cost and ciphertext size, O (log T ) D decryption key size and decryption cost.In this section, we propose a new MRQED D construction with O (D log T ) public key size, O (D log T ) encryption cost and ciphertext size, O (D log T ) decryption key size, and O (log T ) D decryption cost.

(b). 2 .
Compute and release a decryption key DK ∈ G 5|Λ ∪ (B)| .DK is composed of a portion DK(ID) for each ID ∈ Λ ∪ (B).In the following definition for DK(ID), ϕ = (d, l) = Φ(ID) represents the dimension and depth of node ID; without risk of ambiguity, denote λ 1 = λ ID,1 , λ 2 = λ ID,2 .DK(ID) is defined below: We first give an overview on how QueryDecrypt works.Recall that a decryption key DK = DK(ID) ID ∈ Λ ∪ (B) is composed of a portion DK(ID) for each ID ∈ Λ ∪ (B).We now reconstruct a decryption key for each simple hyper-rectangle id B 0 ∈ Λ × (B) as below.We grab from DK a sub-key from each dimension: for each d ∈ [D], grab a sub-key DK(ID d ) from the d th dimension, where ID d ∈ Λ d (B).The collection of sub-keys {DK(ID 1 ), DK(ID 2 ), . . ., DK(ID D )} can now be jointly used to decrypt a message encrypted under the simple hyper-rectangle id B 0 = (ID 1 , . .

5 . 1 Λ 2 I
∪ (B) hyper-rectangle B as a set of tree nodes Sec.5.1 L height of interval tree Sec.5.2 Φ(ID) a function that outputs the dimension and depth of some node ID Sec.5.2 ϕ = (d, l) usually used in subscripts to indicate the dimension and depth respectively Sec. 5.ϕ (X) where ϕ = (d, l) the node at depth l in the path P d (X) of the d th dimension Sec.5.2

Adv 2 Definition 10 (Lemma C. 1 .
A (Σ) = Pr[b = b ] − 1 IND-sID-CPA).An MRQED scheme is IND-sID-CPA secure if all polynomial-time adversaries have at most a negligible advantage in the confidentiality game.Definition 11 (ANON-sID-CPA).An MRQED scheme is ANON-sID-CPA secure if all polynomialtime adversaries have at most a negligible advantage in the anonymity game.If an MRQED scheme is both IND-sID-CPA secure and ANON-sID-CPA secure, then the MRQED scheme is selectively secure.Proof.By the hybrid argument.

Phase 2 :
Phase 1 is repeated.Guess: When the adversary outputs a guess b of b, the simulator outputs 1 if b = b and 0 otherwise, in answer to the D-BDH instance.

(PK, SK, B): Takes
a public key PK, a master private key SK, and a hyperrectangle B and outputs decryption key for hyper-rectangle B

. 4. QueryDecrypt(PK, DK, C): Takes
a public key PK, a decryption key DK, and a ciphertext C and outputs either a plaintext Msg or ⊥, signaling decryption failure. 2 Pairing Worst-case Worst-case Example Query N sip N dip N port N time N prot Time Mult.Time Dec. Time sip = 207.44.178.* , dip = 216.187.103.169,port = 22,

Table 4 :
Decryption times resulting from decryption keys of various sizes.

Phase 1 :
Suppose the adversary makes a decryption key query for the hyper-rectangle B(s 1 , t 1 , s 2 , t 2 , ..., s D , t D ).Since B does not contain X * , there exists a dimensiond 0 ∈ [D] such that x * d 0 / ∈ [s d 0 , t d 0 ], where x * d 0 is X * projected onto the d th 0 dimension.Hence, there exists a dimension d 0 ∈ [D], such that for all ID ∈ Λ d 0 (B), ID = I * ϕ , where ϕ = (d 0 , l) = Φ(ID).We say that X * does not overlap with B in dimension d 0 .The simulator now does the following:1.Pick d 0 such that X * does not overlap with B in dimension d 0 .Let n 0 = 1.