Differential privacy for encrypted data

Methods, systems, and devices for data processing are described. Some database systems may support differential privacy for encrypted data. For example, a database may store user data as ciphertext. A system may receive a statistical query for the user data and may identify a relevant differential privacy mechanism. The system may transform the query to operate on encrypted data while including a noisification function based on the mechanism. The system may execute the transformed query at the database, involving adding noise to the query result according to the noisification function without decrypting the data. For example, the system may leverage homomorphic encryption techniques to inject the noise while the data remains encrypted. The database may return the noisified, encrypted query results, which the system may decrypt for statistical analysis. By applying differential privacy on the encrypted data, the system may avoid exposing any private user information throughout the process.

FIELD OF TECHNOLOGY

The present disclosure relates generally to database systems and data processing, and more specifically to differential privacy for encrypted data.

BACKGROUND

Some database systems may store information related to a number of users. In some cases, this user data may include personally identifiable information (PII) or other data protected under one or more data privacy regulations. Some examples of such regulations may include the European Union's General Data Protection Regulation (GDPR), the Health Insurance Portability and Accountability Act (HIPAA) for health-related data privacy, and the Federal Trade Commission's (FTC's) data and privacy regulations for financial institutions, among other such regulations. However, despite the regulations, such user data may be extremely valuable for statistical analysis (e.g., to determine marketing campaigns, track user trends, etc.). As such, some systems or users may desire to use this user data for statistical analysis within the bounds of the privacy regulations. Further complicating such analysis, database systems may encrypt the user data at rest for data securitization. Some encryption techniques may not support statistical analysis. However, decrypting user data for statistical analysis may involve the system storing PII or other protected information as unencrypted, noise-free data (e.g., temporarily while performing one or more statistical methods). While in this unencrypted, noise-free state, a malicious user may access the data, resulting in data leakage of private user data from the database system.

DETAILED DESCRIPTION

A database system may store information for a number of users, including personally identifiable information (PII) or other data protected under one or more data privacy regulations. Such user data may be extremely valuable for data analytics, including statistical analysis. For example, although specific data values may be protected under the data regulations, general trends, average values, or similar statistical properties may be informative to a system or user analyzing the data (e.g., for targeting groups of users, making generalized determinations about groups of users, etc.). However, to run a statistical query on the user data in the database system, the data regulations may enforce maintaining a balance between providing accurate insights and respecting the privacy of the individual users. To support such a balance, a system may implement differential privacy as a statistical method for providing guarantees to users for bounded privacy. Differential privacy techniques may involve adding noise or sampling of user data to obfuscate any specific personal information for the users.

In some cases, the database system may secure the user information by storing the user data as encrypted at rest in a database. For example, the user data may be encrypted to ensure that the data is accessed by specific users or systems with the proper credentials and is used for specific purposes supported by legitimizing reasons (e.g., user consent or other regulations). The database may restrict other users or systems from accessing the data and may restrict requests for unauthorized usages of the data by withholding an encryption key corresponding to the encrypted data. While statistical queries on the data may be supported by the database system, temporarily decrypting the data for statistical analysis may, correspondingly, temporarily expose private user data (e.g., for potential security breaches by malicious users). For example, this data may not include noise (e.g., from one or more differential privacy techniques) upon decryption. If this data is directly accessed in any way (e.g., prior to applying differential privacy), the database system may fail to uphold one or more data regulations associated with user privacy.

To perform statistical analysis on user data while maintaining data security and supporting data regulations, a system may implement homomorphic differentially private statistical queries. The system may store user data in a database using homomorphic encryption. In some cases, a single value may be stored multiple times using multiple different homomorphic encryption techniques to support different functionality. When the system receives a statistical query for the user data, the system may identify a differential privacy mechanism applicable to the query, queried data, or both. Based on this identified differential privacy mechanism, the system may transform the query. The transformation may involve rewriting the query to target specific encrypted data in the database and to inject noise into the query results (e.g., without decrypting the data) by leveraging particular homomorphic encryption mechanisms. The system may execute the transformed query at the database to add noise into the queried data and retrieve a noisified query result including encrypted user data (e.g., ciphertext). The system may decrypt the encrypted user data to perform statistical analysis on the user data. By injecting noise into the data at query time (e.g., while the data is encrypted), the decrypted user data may already be differentially private. As such, the decryption may not expose any specific user data to potentially malicious users. Instead, by applying differential privacy on the encrypted data in the database (e.g., by leveraging specific homomorphic encryption properties), the system may support statistical analysis of user data while following data privacy regulations.

Aspects of the disclosure are initially described in the context of systems supporting differential privacy for encrypted data. Additional aspects of the disclosure are described with reference to a database configuration and a process flow. Aspects of the disclosure are further illustrated by and described with reference to apparatus diagrams, system diagrams, and flowcharts that relate to differential privacy for encrypted data.

FIG. 1illustrates an example of a system100that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The system100may include a server105(e.g., a single server, a server cluster, an application server, a database server, a proxy server, a cloud-based server, a virtual machine, or any other system, service, or device supporting data processing), a database110(e.g., a single database, a distributed database, multiple distributed databases, a data store, an emergency backup database, or any other system supporting data storage) storing encrypted data115, and a user device120(e.g., a laptop, a desktop computer, a smartphone, a server, a tablet, a sensor, or any other computing device or system capable of generating, analyzing, transmitting, or receiving communications or data). In some cases, the server105and the database110may be part of a database system. For example, the server105may support a service for the database system, including configuring the database110and providing mechanisms to support differential privacy for encrypted data115.

The database110may be configured with a particular database schema. The database schema may define how data is stored at the database110, including which encryption schemes are implemented by the database110to store encrypted data115. The supported encryption schemes may include random (RND) encryption, deterministic (DET) encryption, order preserving encryption (OPE), homomorphic encryption enabling summation (HOM-SUM), homomorphic encryption enabling products (HOM-PROD), homomorphic encryption enabling token searches (SEARCH), or any combination of these or other encryption schemes. In some examples, values stored in the database110may be encrypted using different encryption schemes and stored multiple times in the database110according to the different encryption schemes (e.g., stored in different columns in a relational database). In some such examples, the database110may execute a query125on a specific column of the database110based on the functionality specified in the query125. Additionally or alternatively, the database110may implement encryption onions, in which a single entry in the database is encrypted multiple times using different encryption schemes in layers (e.g., in a single column in a relational database). As such, the database110may decrypt a number of layers to reach an encryption scheme that supports a specific functionality for querying.

The database110may implement a server105to support querying operations. In some cases, the server105may operate as a proxy between users or systems and the database110, where the proxy handles query transformations and encryption procedures into and out of the database110. For example, the server105may transform queries and query results based on the configuration of the database110. In some cases, the server105may operate transparent to an end user (e.g., a user operating the user device120); the user device120may send queries125and receive query results as if the user device120is communicating directly with the database110(e.g., without the server105intercepting and modifying the query125and query results). The server105may support any number of application programming interfaces (APIs), database connectors, or both to facilitate communications between a user device120and the server105and between the server105and the database110.

The user device120may transmit a query125to the database system. The query may include a request for data stored as ciphertext (e.g., encrypted data115) at the database110. In some cases, this query125may be an example of a statistical query, which also may be referred to as an analytics query. A statistical query may affect multiple values (e.g., multiple rows in a relational database, in some cases across multiple potential tables) in the database110, where the query125requests for the database system to return aggregate, differentially private statistics for a set of users. To ensure that the statistical results are differentially private, the database system may inject noise into the queried user data. However, to support one or more data regulations throughout the entire querying process, the database system may transform the query to inject the noise into the user data while the data remains encrypted. In this way, the database system refrains from exposing any noise-free, plaintext data—for example, even during intermediate statistical processing—that could potentially expose PII or other protected user data to malicious users.

The server105may intercept—or otherwise receive—the query125from the user device120to perform the query transformation. The server105may include a query transformation component130, which may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. The query transformation component130may support a number of processes to transform a received query125(e.g., a structured query language (SQL) query or any other type of query) to operate according to the database110configuration. In some examples, the query transformation component130may call one or more user-defined functions (UDFs) based on the query. For statistical queries, the transformation may involve adding a noisification function to the query125to inject noise into the encrypted data to support differential privacy. For example, the query transformation component130may identify a differential privacy mechanism applicable to the query125, the requested data, or both. The query transformation component130may transform the query125to include a noisification function based on the identified differential privacy mechanism (e.g., using one or more specific UDFs defined for the query type, the differential privacy mechanism, or both). In some examples, a noisification function may randomly determine, based on a probability, whether to provide an actual data value or a random data value. As such, for any individual data point, a user may not be able to determine whether the data point corresponds to an actual value for a user or to random noise. However, at scale, data for a total set of users may provide statistically meaningful information based on the probability used. Such a noisification function may incur a tradeoff: for example, a higher probability that any data value is random may increase user privacy but decrease the statistical relevance of the results, while a lower probability that any data value is random may increase the statistical relevance of the results while decreasing the user privacy. In some cases, the probability may be statically or dynamically selected based on the user data, one or more data regulations, the query125, or a user input to the system100.

Additionally or alternatively, the query transformation component130may transform the query125to operate on ciphertext (e.g., encrypted data115) in the database110. For example, the query transformation component130may encrypt plaintext values in the query125with the proper encryption keys and techniques to accurately search the ciphertext in the database110. Based on the query transformation procedure, the server105may obtain a transformed query135.

The server105may execute the transformed query135at the database110. Executing the transformed query135may involve adding noise to a query result at the database110prior to—or, otherwise, without—decrypting the ciphertext at the database110. For example, the database110may identify the data values of the encrypted data115relevant to the query (e.g., based on one or more query parameters), may determine a query result based on the identified data values, and may inject noise into the query result (e.g., at the database110) according to the noisification function specified in the transformed query135. This execution process may be based on the configuration of the database110. For example, the transformed query135may operate on one or more specific columns of the database110based on the homomorphic encryption techniques used for the columns and, correspondingly, the encrypted functionality supported by the columns. Such a query execution procedure may result in a noisified query result. The noisified query result may include statistical information relevant to a set of users whose information is securely stored at the database110. The database110may return the noisified query result (e.g., the encrypted result with noise140) in response to the transformed query135. In some cases, the server105may intercept—or otherwise receive—the noisified query result from the database110in response to the transformed query135.

The server105may prepare the query results to be returned to the user device120. For example, the server105may include an encryption manager145. The encryption manager145may maintain an updated set of encryption keys (or identifiers supporting finding the proper encryption keys) relevant to the database110. The encryption manager145may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. In some examples, the encryption manager145may be an example or component of an external key management system for the database system. Using the encryption manager145, the server105may decrypt the ciphertext in the noisified query result (e.g., the encrypted result with noise140) to obtain plaintext for the query result. In some examples, the server105may perform one or more statistical methods on the obtained plaintext according to the received statistical query125. In some other examples, the database110, at query execution time, may perform the one or more statistical methods to obtain the query result. In any such examples, the decrypted query result at the server105may include the requested statistical information for the user device120. By injecting the noise at the database110(e.g., at query execution time), the statistical information may uphold differential privacy upon decryption. The server105may send the query result with noise150to the user device120in response to the query125. In some examples, the user device120may display the query result in a user interface or may otherwise perform additional analysis on the query result. Based on the noise, a user operating the user device120may not be able to determine reliable information for any specific user included in the statistical analysis. However, at the aggregate level, the statistical information may provide valuable insights about a set of users despite the noise.

In some other systems, statistical analysis and differential privacy are implemented on plaintext information. For example, user data relevant to statistical analysis may not be encrypted at rest, leading to security concerns within a database. In other examples, a system may decrypt data relevant to statistical analysis, inject noise into the decrypted data, and perform the requested statistical methods. However, by decrypting the data prior to injecting the noise, such a system may temporarily expose user information that is not yet differentially private, resulting in security concerns. In yet other examples, systems may not support statistical analysis on encrypted user data based on data regulations, drastically diminishing the value of such data.

In contrast, system100supports differential privacy for encrypted data to produce valuable insights on user data while maintaining user privacy. For example, by implementing specific query transformations and homomorphic encryption techniques as described herein, the database system may inject noise into user data without decrypting the data (e.g., while running the transformed query135at the database110). As such, when the data is decrypted for sending as a query response, the data is already differentially private and does not expose any user information, even temporarily. The database system may therefore provide valuable statistical insights while supporting differential privacy and maintaining the security of private user data (e.g., according to one or more data privacy regulations) throughout the entire statistical query process. By utilizing differential privacy, the system100may mitigate the risk of a malicious user performing user re-identification from the statistical analysis (e.g., using one or more histograms of the statistics).

FIG. 2illustrates an example of a system200that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The system200may be an example of a system100as described with reference toFIG. 1. For example, the system200may include a server205, a database210storing encrypted data215, and one or more user devices220, which may be examples of the corresponding server105, database110storing encrypted data115, and user device120described with reference toFIG. 1. The system200may support handling of different types of information entering a database system (e.g., a database system including the server205, the database210, or both). For example, the system200may handle data entering the database system and different types of queries entering the database system. In some cases, the handling of the system inputs may be based on a configuration of the database210.

In a first example, a user device220-amay send a data record225to the database for storage. The data record225may be associated with a specific user and may include data covered under one or more data privacy regulations. In some cases, the data record225may be received based on an input from the specific user (e.g., a form submitted by the user, a product purchased by the user, etc.). In some other cases, the data record225may be received from another user or system collecting user data (e.g., by scraping data or otherwise collecting user data). In yet some other cases, the data record225may be an example of a prediction or an assertion about the specific user. The database system may check to ensure that the database system has a legitimizing reason for storing the data record225(e.g., in accordance with one or more data privacy regulations). If the database system has a legitimizing reason (e.g., user consent or some other reason) for storing the data record225, the server205may receive the data record225and prepare the data record225for storage in the database210.

The server205may encrypt the data record225for storage at the database210according to a database210configuration. For example, the server205may encrypt each data value in the data record225using one or more encryption techniques. In some cases, based on the type of data value, the server205may determine the encryption technique(s) to use. For example, for numeric values, the server205may implement a HOM-SUM technique for encryption in order to support summations on the encrypted numeric values (e.g., without decrypting the values). Additionally or alternatively, the server205may implement an OPE technique for encryption in order to support order and range operations on the encrypted numeric values. To support both order operations and summation operations, the server205may encrypt a same value (e.g., a numeric value) multiple times using different encryption schemes. As such, a single plaintext data value may correspond to multiple ciphertext values, where the database210may determine which ciphertext value to access based on what functionality to apply. Furthermore, for text values, the server205may implement a DET encryption technique for encryption in order to support equality operations (but not summations, as summations may not be relevant to text values). Accordingly, the server205may modify the data record225to obtain an encrypted data record230and may send the encrypted data record230to the database210for storage (e.g., with the encrypted data215). The encrypted data record230may be stored at the database210noise-free (e.g., to support both retrieval queries235and statistical queries255).

In a second example, a user device220-bmay send a retrieval query235to the database system. In some cases, the retrieval query235may be an example of an operational query, a user profile request, or any other query for specific user information. The server205may transform the retrieval query235to operate on the encrypted data215in the database210. In some cases, the server205may check for permissions associated with the retrieval query220-b. For example, the server205may verify whether the user device220-b—or a user associated with the user device220-b—is authorized to query for the specified data (e.g., in some cases, according to a specific use case for the data). In some other cases, the database210may check for the permissions (e.g., automatically based on the transformed retrieval query240or according to a database210policy).

The server205may execute the transformed retrieval query240at the database210to retrieve one or more data values. If the transformed retrieval query240has permission to retrieve the specified data, the database210may return an encrypted result245in response to the transformed retrieval query240. The server205may decrypt the encrypted result245to obtain a query result250(e.g., in plaintext). Based on the permissions associated with the retrieval query235, the query result250may not be differentially private. For example, the retrieval query235may be associated with a request for specific user information by the user or a system with permissioned access to the specific user information. Because the encrypted data215is stored noise-free, the query result250may include the actual data values for the user information. The server205may return the decrypted query result250to the user device220-bin response to the retrieval query235.

In contrast, in a third example, a user device220-cmay send a statistical query255to the database system. The server205may transform the statistical query255to operate on the encrypted data215in the database210, as well as to inject noise into the encrypted data215(e.g., via a noisification function) based on the query being a statistical query255. Adding noise to the query results may ensure sufficient randomization of the data underlying the statistical analysis in order to protect user privacy. For example, the injected noise may support differential privacy for the data. The server205may select the noisification function (e.g., a noise mechanism) based on the query type. In some cases, the server205or database210may additionally check for permissions associated with the requested statistical analysis.

The server205may execute the transformed statistical query260at the database210to retrieve one or more data values. If the transformed statistical query260has permission to retrieve the specified data for statistical analysis, the database210may return an encrypted result with noise265in response to the transformed statistical query260. For example, based on the noisification function in the transformed statistical query260, the database210may inject noise into the encrypted data215(e.g., at read time) to obtain an encrypted result with noise265. In some cases, the server205or the database210may track a privacy budget during query execution. Retrieving user data for statistical analysis may consume the privacy budget. When a specific amount of user data is retrieved (e.g., for a given user, across all users, etc.), the query process may meet the privacy budget. Based on meeting the privacy budget (i.e., the privacy budget is depleted), the server205or the database210may refrain from returning additional results (e.g., for a given query, for a given user, etc.). The server205may decrypt the encrypted result with noise265to obtain a query result with noise270(e.g., in plaintext). As the noise is added into the encrypted data as part of the query process, the decrypted data already includes noise. This noise may support differential privacy for the decrypted data, supporting user privacy regulations. The server205or database210may perform one or more statistical methods on the data to determine a query result with noise270(e.g., a statistical analysis of user data stored at the database210). The server205may return the decrypted query result with noise270to the user device220-cin response to the statistical query255.

Adding noise into the encrypted data215at query time may involve one or more processes. In some examples, the statistical query255may include a COUNT operation (or some other aggregation function). Adding noise to aggregate numbers may not involve encryption, since aggregate values are calculated homomorphically at the database210. That is, an aggregate value calculated based on encrypted data215is itself not encrypted. As such, adding noise to such an aggregate value may not involve encrypting the noise. Instead, the database210may add unencrypted noise to the unencrypted aggregate value (e.g., based on the noisification function specified in the transformed statistical query260). However, the label for such an aggregate value may be encrypted in the database210, obfuscating the meaning of the aggregate value. The server205may receive, in response to the transformed statistical query260, a noisified aggregate value with an encrypted label. The server205may decrypt the label to support analysis of the noisified aggregate value.

In some other examples, the statistical query255may include a field-level operation. In some cases, a field-level operation may be an example of a JOIN operation at a row-level in a relational database. Adding noise or weights for field-level operations may include a process performed by the database210(e.g., based on the noisification function specified in the transformed statistical query260). The database210may add noise or weights to individual rows (e.g., fields) by creating a random noise column in the relational database. The random noise column may be a temporary column in the database210or may be a set of temporary relational values in the database210. In some implementations, the database210may calculate this random noise column (e.g., a dedicated Laplace noise column) on-the-fly at query time. The database210may encrypt the random noise column using a same encryption key (e.g., a HOM-SUM encryption key) as the target data column in the database210. The database210may add the random noise column to the target data column (e.g., row-by-row addition) using a homomorphic addition operation. This homomorphic addition operation may be supported based on the database210using the same HOM-SUM encryption key to encrypt both the random noise column and the target data column. By adding noise at the row-level (e.g., without decrypting the data), the data values in the target data column may be used for statistical analysis due to the added noise supporting differential privacy. In some cases, the server205or database210may specify the random noise function used to generate the random noise column. This random noise function may be static or dynamic (e.g., based on a user input indicating a privacy threshold, a statistical significance threshold for the statistical analysis, or some combination thereof).

In yet some other examples, the statistical query255may include a sampling operation. Sampling may include a GROUP BY operation on a random index column. Sampling on encrypted data215may not involve injecting noise into the sampling process. For example, the privacy may be supported based on the random selection procedure, which may operate on encrypted values similar to unencrypted values.

As described herein, the system200may implement any differential privacy mechanism on a function-by-function basis to apply to homomorphically encrypted data. For example, by using one or more UDFs, the server205may transform a statistical query255to introduce noise and combine the noise with data without decrypting the data. For example, in some cases, the database210may encrypt the noise homomorphically, rather than decrypt the data. By adding noise on read operations (e.g., as opposed to write operations at the database210), the database210may support retrieving exact values (e.g., for a retrieval query235) or values with a dynamic level of noise (e.g., for a statistical query255) based on who is retrieving the data, why the data is being retrieved, or both.

FIG. 3illustrates an example of a database configuration300that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. A database305may implement the database configuration300. The database305may be an example of a database110or a database210as described with reference toFIGS. 1 and 2. In some cases, the database configuration300may be setup based on a service supporting homomorphic differentially private statistical queries. For example, the database305may store data according to the database configuration300in order to support a number of homomorphic encryption properties that enable differential privacy for encrypted data.

The database305may store user data, including PII. In some examples, the database305may store a number of data records as ciphertext (e.g., to securely store the data at rest). An encrypted data record310may correspond to a user. Each encrypted data record310may include a number of values340encrypted at rest. In some cases, the same plaintext value may be stored as multiple ciphertext values340in the database305. In the example configuration illustrated inFIG. 3, each encrypted data record310may include a record identifier315(e.g., a user identifier) and two data values, a zip code and an age. The database configuration300may specify that the database305stores the zip code as a DET encrypted value320and stores the age as a HOM-SUM encrypted value325and as an OPE encrypted value330. These different homomorphic techniques may support different operations on the encrypted data. As illustrated, the database305may store an encrypted data record310-a, an encrypted data record310-b, up to an encrypted data record310-n. For the encrypted data record310-a, the database305may store a ciphertext value340-afor the record ID315, a ciphertext value340-bfor the DET encrypted value320(e.g., corresponding to the zip code), a ciphertext value340-cfor the HOM-SUM encrypted value325(e.g., corresponding to the age), and a ciphertext value340-dfor the OPE encrypted value330(e.g., also corresponding to the age). The database configuration300is given as one example, and many other configurations (e.g., including any number of data records, fields, encryption schemes, etc.) may be implemented.

The database configuration300may support a number of different noise mechanisms (e.g., implementing differential privacy mechanisms to encrypted data). In a first example, the database configuration300may support a sensitivity-based method. The sensitivity-based method may apply a differential privacy mechanism of adding Laplace noise on aggregate data to encrypted data. A query transformation for this identified differential privacy mechanism may transform a query to apply to a DET encrypted column (e.g., the DET encrypted values320) to support a COUNT operation. For example, the transformed query may search the DET encrypted value320column to determine a count for a particular value. By encrypting the search value using the same encryption key as used for the DET encrypted value320column, the database305may search the column without decrypting the data (e.g., based on the column using DET encryption). The database305may inject Laplace noise on the count value, which is not encrypted. For example, the query may request a count of users with the zip code “20001.” The transformed query may search for a DET encrypted ciphertext value corresponding to the plaintext value “20001” in the DET encrypted value320column and may sum the total identified. The database305may inject Laplace noise to this calculated total to support the differential privacy mechanism.

In a second example, the database configuration300may support a row-level Laplace noise method. The row-level Laplace noise method may apply to multiple differential privacy mechanisms (e.g., in combination with one or more other approaches). A query transformation for such identified differential privacy mechanisms may transform a query to apply to a HOM-SUM encrypted column (e.g., the HOM-SUM encrypted values325) to add noise at the field level. To add the noise, the database305may generate a random noise column (or, similarly, a set of relational values corresponding to random noise). In some examples, such a column may be referred to as a dedicated Laplace noise column. The database305may encrypt this noise column with the same HOM-SUM encryption key as the HOM-SUM encrypted column, resulting in a column of HOM-SUM encrypted noise values335. In some examples, the noise column generation, noise column encryption, or both may be performed at query time. The database305may add the HOM-SUM encrypted noise value335column to the HOM-SUM encrypted value325column to inject the noise into the encrypted data. This addition may be an example of row-level (e.g., field-level) homomorphic encryption. For example, the database305may homomorphically add ciphertext value340-eto ciphertext value340-cand may separately add ciphertext value340-gto ciphertext value340-f.

In a third example, the database configuration300may support a weighted privacy integrated query (PINQ) method. The weighted PINQ method may support differential privacy mechanisms implementing joins. The query transformation and database305operations supporting the weighted PINQ method may be similar to the query transformation and database305operations supporting the row-level Laplace noise method (e.g., adding random weights in a similar manner to adding Laplace noise).

In a fourth example, the database configuration300may support a sample and aggregate method. The sample and aggregate method may support a number of differential privacy mechanisms (e.g., mechanisms not implementing joins). A query transformation for such differential privacy mechanisms may transform a query to apply to a DET encrypted column (e.g., the DET encrypted values320) to support a sample operation. If aggregating data, the query transformation for such differential privacy mechanisms may transform the query to apply to a HOM-SUM encrypted column (e.g., the HOM-SUM encrypted values325) to aggregate values. Noise may be added at the field level or at the aggregate level. If aggregating data according to a particular range or set of characteristics (e.g., aggregating on quantiles), the query transformation may transform the query to apply to an OPE encrypted column (e.g., the OPE encrypted values330) to determine quantiles.

Accordingly, the database305may execute transformed queries to generate and return noisified, encrypted query results (e.g., according to any supported differential privacy mechanisms on a function-by-function basis).

FIG. 4illustrates an example of a process flow400that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The process flow400may be implemented by a system100or200as described with reference toFIGS. 1 and 2. In some cases, a server405and a database410may be aspects of a database system, where the database410may be configured according to a database configuration300as described with reference toFIG. 3. A user device415may query the database system for statistical information, and the database system may implement differential privacy for encrypted data to provide insights while maintaining user privacy. Alternative examples of the following may be implemented, where some steps are performed in a different order than described or are not performed at all. In some cases, steps may include additional features not mentioned below, or further steps may be added.

At420, the server405may receive, from an application (e.g., an application running at the user device415), a query including a request for data stored as ciphertext at the database410. In some examples, the query may be an example of a statistical query.

At425, the server405may identify a differential privacy mechanism applicable to the query, the data, or both. At430, the server405may transform the query to include a noisification function based on the differential privacy mechanism. The noisification function may be an example of a process defined within the transformed query statement specifying one or more data modifications. Such data modifications may inject noise into a query result (e.g., into an aggregate value or at a field-level) to support differential privacy. In some examples, the server405may perform one or more calls to one or more UDFs based on the query, the differential privacy mechanism, or both in order to perform the query transformation.

At435, the server405may send the transformed query to the database410. At440, the database410may execute the transformed query. Executing the transformed query may involve adding noise to a query result at the database410prior to decrypting the ciphertext (e.g., without decrypting the ciphertext at the database410) to obtain a noisified query result according to the noisification function. Such a query execution process may allow the database410to refrain from handling a plaintext value of the data in the database by injecting the noise directly into ciphertext using homomorphic encryption techniques (e.g., based on adding the noise to the query result at the database prior to decrypting the ciphertext). In some examples, the server405or the database410may determine a level of noise for the noisification function based on a preference of the owner of the data, a user identifier associated with the query (e.g., for a user operating the user device415), an analytics operation associated with the query, or a combination thereof.

At445, the server405may receive, from the database410and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query. At450, the server405may decrypt the ciphertext for the noisified query result (e.g., external to the database410). In some examples, the server405may perform one or more statistical operations on the decrypted noisified query result based on the statistical query. In some other examples, the database410may perform the one or more statistical operations on the noisified query result (e.g., while the data is still encrypted) using one or more homomorphic functions. In any such examples, the server405may determine decrypted statistical results for the query, where the user data is differentially private based on the added noise at query time. At455, the server405may transmit, to the application and in response to the query, the noisified query result including the decrypted ciphertext (e.g., the decrypted statistical results for the query).

FIG. 5shows a block diagram500of an apparatus505that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The apparatus505may include an input module510, a differential privacy handler515, and an output module545. The apparatus505may also include a processor. Each of these components may be in communication with one another (e.g., via one or more buses). In some cases, the apparatus505may be an example of a user terminal, a database server, or a system containing multiple computing devices.

The differential privacy handler515may include a query reception component520, a differential privacy identifier525, a query transformation component530, a query execution component535, and a results component540. The differential privacy handler515may be an example of aspects of the differential privacy handler605or710described with reference toFIGS. 6 and 7.

The query reception component520may receive, from an application, a query including a request for data stored as ciphertext at a database. The differential privacy identifier525may identify a differential privacy mechanism applicable to the query, the data, or both. The query transformation component530may transform the query to include a noisification function based on the differential privacy mechanism.

The query execution component535may execute the transformed query at the database, where the executing involves adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function. The results component540may receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query.

The output module545may manage output signals for the apparatus505. For example, the output module545may receive signals from other components of the apparatus505, such as the differential privacy handler515, and may transmit these signals to other components or devices. In some specific examples, the output module545may transmit output signals for display in a user interface, for storage in a database or data store, for further processing at a server or server cluster, or for any other processes at any number of devices or systems. In some cases, the output module545may be a component of an I/O controller715as described with reference toFIG. 7.

FIG. 6shows a block diagram600of a differential privacy handler605that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The differential privacy handler605may be an example of aspects of a differential privacy handler515or a differential privacy handler710described herein. The differential privacy handler605may include a query reception component610, a differential privacy identifier615, a query transformation component620, a query execution component625, a results component630, an encryption handler635, a statistical component640, a UDF component645, a storage component650, a noisification component655, a COUNT operation handler660, a field-level operation handler665, or any combination of these or additional components. Each of these components may communicate, directly or indirectly, with one another (e.g., via one or more buses).

The query reception component610may receive, from an application, a query including a request for data stored as ciphertext at a database. The differential privacy identifier615may identify a differential privacy mechanism applicable to the query, the data, or both. The query transformation component620may transform the query to include a noisification function based on the differential privacy mechanism.

The query execution component625may execute the transformed query at the database, where the executing involves adding noise to a query result at the database (e.g., prior to decrypting the ciphertext) to obtain a noisified query result according to the noisification function. The results component630may receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query.

In some examples, the encryption handler635may decrypt the ciphertext for the noisified query result. In some such examples, the results component630may transmit, to the application and in response to the query, the noisified query result including the decrypted ciphertext. In some cases, the ciphertext for the noisified query result is decrypted external to the database.

In some cases, the query may be an example of a statistical query, and the statistical component640may perform one or more statistical operations on the noisified query result based on the decrypted ciphertext and the statistical query.

The UDF component645may perform one or more calls to one or more UDFs based on the query, the differential privacy mechanism, or both.

In some examples, the encryption handler635may encrypt the data to obtain the ciphertext. In some such examples, the storage component650may store the ciphertext at the database, where the stored ciphertext is noise-free.

In some cases, the query may be associated with an analytics operation and the differential privacy mechanism may be identified based on the analytics operation. Additionally, the query reception component610may receive, from a second application, a second query including a second request for at least a portion of the data, where the second query may be associated with a permissioned user request. In some examples, the query execution component625may execute the second query at the database to obtain a query result including second ciphertext associated with the portion of the data. The results component630may receive, from the database and in response to the second query, the query result including the second ciphertext based on executing the second query, and the encryption handler635may decrypt the second ciphertext for the query result to obtain the portion of the data, where the portion of the data is noise-free based on the storing and the second query being associated with the permissioned user request. In some examples, the results component630may transmit, to the second application and in response to the second query, the portion of the data.

In some cases, the noisification function may be associated with a level of noise, and the noisification component655may determine the level of noise for the noisification function based on a preference of an owner of the data, a user identifier associated with the query, an analytics operation associated with the query, or a combination thereof.

In some examples, the query may include a COUNT operation. In some such examples, adding the noise to the query result at the database may include a number of processes performed by a COUNT operation handler660. For example, the COUNT operation handler660may calculate one or more aggregate values based on the ciphertext and the COUNT operation, where each aggregate value of the one or more aggregate values is associated with a corresponding ciphertext label, and may determine one or more noise values. In some examples, the COUNT operation handler660may add the one or more noise values to at least one of the one or more aggregate values to obtain one or more noisified aggregate values, where the noisified query result includes the one or more noisified aggregate values and where each noisified aggregate value of the one or more noisified aggregate values is associated with the corresponding ciphertext label.

In some examples, the query may include a field-level operation. In some such examples, adding the noise to the query result at the database may include a number of processes performed by a field-level operation handler665. For example, the field-level operation handler665may identify a set of encrypted fields in the database including the ciphertext, where the ciphertext is encrypted according to a homomorphic encryption key, and may determine a set of noise values, where each noise value of the set of noise values corresponds to a respective field of the set of fields. In some examples, the field-level operation handler665may encrypt the set of noise values using the homomorphic encryption key and may add the set of encrypted noise values to the set of encrypted fields based on the field-level operation to obtain a set of noisified encrypted field values, where the noisified query result includes the set of noisified encrypted field values. In some cases, the database may be a relational database, the field-level operation may be an example of a row-level operation, a JOIN operation, or a combination thereof in the relational database, and the set of encrypted fields may correspond to a column in the relational database.

In some cases, the database may be a relational database, and the data may be stored as first ciphertext in a first column of the relational database and as second ciphertext in a second column of the relational database, where the first ciphertext is encrypted according to a first homomorphic encryption method and the second ciphertext is encrypted according to a second homomorphic encryption method different from the first homomorphic encryption method. In some examples, the query execution component625may determine to use the first column for executing the transformed query based on the first homomorphic encryption method supporting the differential privacy mechanism.

In some examples, the results component630may refrain from handling a plaintext version of the data in the database based on adding the noise to the query result at the database prior to decrypting the ciphertext.

FIG. 7shows a diagram of a system700including a device705that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The device705may be an example of or include the components of an application server (e.g., a single server, a server cluster, a database server, a proxy server, a cloud-based server, a virtual machine, a container, or any other device or system supporting data processing) or an apparatus505as described herein. The device705may include components for bi-directional data communications including components for transmitting and receiving communications, including a differential privacy handler710, an I/O controller715, a database controller720, memory725, a processor730, and a database735. These components may be in electronic communication via one or more buses (e.g., bus740).

The differential privacy handler710may be an example of a differential privacy handler515or605as described herein. For example, the differential privacy handler710may perform any of the methods or processes described above with reference toFIGS. 5 and 6. In some cases, the differential privacy handler710may be implemented in hardware, software executed by a processor, firmware, or any combination thereof.

The I/O controller715may manage input signals745and output signals750for the device705. The I/O controller715may also manage peripherals not integrated into the device705. In some cases, the I/O controller715may represent a physical connection or port to an external peripheral. In some cases, the I/O controller715may utilize an operating system such as iOS®, ANDROID®, MS-DOS®, MS-WINDOWS®, OS/2®, UNIX®, LINUX®, or another known operating system. In other cases, the I/O controller715may represent or interact with a modem, a keyboard, a mouse, a touchscreen, or a similar device. In some cases, the I/O controller715may be implemented as part of a processor. In some cases, a user may interact with the device705via the I/O controller715or via hardware components controlled by the I/O controller715.

The database controller720may manage data storage and processing in a database735. In some cases, a user may interact with the database controller720. In other cases, the database controller720may operate automatically without user interaction. The database735may be an example of a single database, a distributed database, multiple distributed databases, a data store, a data lake, or an emergency backup database.

Memory725may include random-access memory (RAM) and read-only memory (ROM). The memory725may store computer-readable, computer-executable software including instructions that, when executed, cause the processor to perform various functions described herein. In some cases, the memory725may contain, among other things, a basic I/O system (BIOS) which may control basic hardware or software operation such as the interaction with peripheral components or devices.

FIG. 8shows a flowchart illustrating a method800that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The operations of method800may be implemented by an application server (e.g., a single server, a server cluster, a database server, a proxy server, a cloud-based server, a virtual machine, a container, or any other device or system supporting data processing) or its components as described herein. For example, the operations of method800may be performed by a differential privacy handler as described with reference toFIGS. 5 through 7. In some examples, an application server may execute a set of instructions to control the functional elements of the application server to perform the functions described below. Additionally or alternatively, an application server may perform aspects of the functions described below using special-purpose hardware.

At805, the application server may receive, from an application, a query including a request for data stored as ciphertext at a database. The operations of805may be performed according to the methods described herein. In some examples, aspects of the operations of805may be performed by a query reception component as described with reference toFIGS. 5 through 7.

At810, the application server may identify a differential privacy mechanism applicable to the query, the data, or both. The operations of810may be performed according to the methods described herein. In some examples, aspects of the operations of810may be performed by a differential privacy identifier as described with reference toFIGS. 5 through 7.

At815, the application server may transform the query to include a noisification function based on the differential privacy mechanism. The operations of815may be performed according to the methods described herein. In some examples, aspects of the operations of815may be performed by a query transformation component as described with reference toFIGS. 5 through 7.

At820, the application server may execute the transformed query at the database. Executing the transformed query may involve adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function. The operations of820may be performed according to the methods described herein. In some examples, aspects of the operations of820may be performed by a query execution component as described with reference toFIGS. 5 through 7.

At825, the application server may receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query. The operations of825may be performed according to the methods described herein. In some examples, aspects of the operations of825may be performed by a results component as described with reference toFIGS. 5 through 7.

FIG. 9shows a flowchart illustrating a method900that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The operations of method900may be implemented by an application server or its components as described herein. For example, the operations of method900may be performed by a differential privacy handler as described with reference toFIGS. 5 through 7. In some examples, an application server may execute a set of instructions to control the functional elements of the application server to perform the functions described below. Additionally or alternatively, an application server may perform aspects of the functions described below using special-purpose hardware.

At905, the application server may receive, from an application, a query including a request for data stored as ciphertext at a database. The operations of905may be performed according to the methods described herein. In some examples, aspects of the operations of905may be performed by a query reception component as described with reference toFIGS. 5 through 7.

At910, the application server may identify a differential privacy mechanism applicable to the query, the data, or both. The operations of910may be performed according to the methods described herein. In some examples, aspects of the operations of910may be performed by a differential privacy identifier as described with reference toFIGS. 5 through 7.

At915, the application server may transform the query to include a noisification function based on the differential privacy mechanism. The operations of915may be performed according to the methods described herein. In some examples, aspects of the operations of915may be performed by a query transformation component as described with reference toFIGS. 5 through 7.

At920, the application server may execute the transformed query at the database, where the executing may involve adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function. The operations of920may be performed according to the methods described herein. In some examples, aspects of the operations of920may be performed by a query execution component as described with reference toFIGS. 5 through 7.

At925, the application server may receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query. The operations of925may be performed according to the methods described herein. In some examples, aspects of the operations of925may be performed by a results component as described with reference toFIGS. 5 through 7.

At930, the application server may decrypt the ciphertext for the noisified query result. The operations of930may be performed according to the methods described herein. In some examples, aspects of the operations of930may be performed by an encryption handler as described with reference toFIGS. 5 through 7.

At935, the application server may transmit, to the application and in response to the query, the noisified query result including the decrypted ciphertext. The operations of935may be performed according to the methods described herein. In some examples, aspects of the operations of935may be performed by a results component as described with reference toFIGS. 5 through 7.

FIG. 10shows a flowchart illustrating a method1000that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The operations of method1000may be implemented by an application server or its components as described herein. For example, the operations of method1000may be performed by a differential privacy handler as described with reference toFIGS. 5 through 7. In some examples, an application server may execute a set of instructions to control the functional elements of the application server to perform the functions described below. Additionally or alternatively, an application server may perform aspects of the functions described below using special-purpose hardware.

At1005, the application server may receive, from an application, a query including a request for data stored as ciphertext at a database. The query may include a COUNT operation. The operations of1005may be performed according to the methods described herein. In some examples, aspects of the operations of1005may be performed by a query reception component as described with reference toFIGS. 5 through 7.

At1010, the application server may identify a differential privacy mechanism applicable to the query, the data, or both. The operations of1010may be performed according to the methods described herein. In some examples, aspects of the operations of1010may be performed by a differential privacy identifier as described with reference toFIGS. 5 through 7.

At1015, the application server may transform the query to include a noisification function based on the differential privacy mechanism. The operations of1015may be performed according to the methods described herein. In some examples, aspects of the operations of1015may be performed by a query transformation component as described with reference toFIGS. 5 through 7.

At1020, the application server may execute the transformed query at the database. Executing the transformed query may involve adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function. The noise may be added according to1025,1030, and1035. The operations of1020may be performed according to the methods described herein. In some examples, aspects of the operations of1020may be performed by a query execution component as described with reference toFIGS. 5 through 7.

At1025, the application server may calculate one or more aggregate values based on the ciphertext and the COUNT operation, where each aggregate value of the one or more aggregate values is associated with a corresponding ciphertext label. The operations of1025may be performed according to the methods described herein. In some examples, aspects of the operations of1025may be performed by a COUNT operation handler as described with reference toFIGS. 5 through 7.

At1030, the application server may determine one or more noise values. The operations of1030may be performed according to the methods described herein. In some examples, aspects of the operations of1030may be performed by a COUNT operation handler as described with reference toFIGS. 5 through 7.

At1035, the application server may add the one or more noise values to at least one of the one or more aggregate values to obtain one or more noisified aggregate values, where the noisified query result includes the one or more noisified aggregate values and where each noisified aggregate value of the one or more noisified aggregate values is associated with the corresponding ciphertext label. The operations of1035may be performed according to the methods described herein. In some examples, aspects of the operations of1035may be performed by a COUNT operation handler as described with reference toFIGS. 5 through 7.

At1040, the application server may receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query. The operations of1040may be performed according to the methods described herein. In some examples, aspects of the operations of1040may be performed by a results component as described with reference toFIGS. 5 through 7.

FIG. 11shows a flowchart illustrating a method1100that supports differential privacy for encrypted data in accordance with aspects of the present disclosure. The operations of method1100may be implemented by an application server or its components as described herein. For example, the operations of method1100may be performed by a differential privacy handler as described with reference toFIGS. 5 through 7. In some examples, an application server may execute a set of instructions to control the functional elements of the application server to perform the functions described below. Additionally or alternatively, an application server may perform aspects of the functions described below using special-purpose hardware.

At1105, the application server may receive, from an application, a query including a request for data stored as ciphertext at a database. The query may include a field-level operation. The operations of1105may be performed according to the methods described herein. In some examples, aspects of the operations of1105may be performed by a query reception component as described with reference toFIGS. 5 through 7.

At1110, the application server may identify a differential privacy mechanism applicable to the query, the data, or both. The operations of1110may be performed according to the methods described herein. In some examples, aspects of the operations of1110may be performed by a differential privacy identifier as described with reference toFIGS. 5 through 7.

At1115, the application server may transform the query to include a noisification function based on the differential privacy mechanism. The operations of1115may be performed according to the methods described herein. In some examples, aspects of the operations of1115may be performed by a query transformation component as described with reference toFIGS. 5 through 7.

At1120, the application server may execute the transformed query at the database. Executing the transformed query may involve adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function. The noise may be added according to1125,1130,1135, and1040. The operations of1120may be performed according to the methods described herein. In some examples, aspects of the operations of1120may be performed by a query execution component as described with reference toFIGS. 5 through 7.

At1125, the application server may identify a set of encrypted fields in the database including the ciphertext, where the ciphertext is encrypted according to a homomorphic encryption key. The operations of1125may be performed according to the methods described herein. In some examples, aspects of the operations of1125may be performed by a field-level operation handler as described with reference toFIGS. 5 through 7.

At1130, the application server may determine a set of noise values, where each noise value of the set of noise values corresponds to a respective field of the set of fields. The operations of1130may be performed according to the methods described herein. In some examples, aspects of the operations of1130may be performed by a field-level operation handler as described with reference toFIGS. 5 through 7.

At1135, the application server may encrypt the set of noise values using the homomorphic encryption key. The operations of1135may be performed according to the methods described herein. In some examples, aspects of the operations of1135may be performed by a field-level operation handler as described with reference toFIGS. 5 through 7.

At1140, the application server may add the set of encrypted noise values to the set of encrypted fields based on the field-level operation to obtain a set of noisified encrypted field values, where the noisified query result includes the set of noisified encrypted field values. The operations of1140may be performed according to the methods described herein. In some examples, aspects of the operations of1140may be performed by a field-level operation handler as described with reference toFIGS. 5 through 7.

At1145, the application server may receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query. The operations of1145may be performed according to the methods described herein. In some examples, aspects of the operations of1145may be performed by a results component as described with reference toFIGS. 5 through 7.

A method for data processing is described. The method may include receiving, from an application, a query including a request for data stored as ciphertext at a database, identifying a differential privacy mechanism applicable to the query, the data, or both, transforming the query to include a noisification function based on the differential privacy mechanism, executing the transformed query at the database, where the executing includes adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function, and receiving, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query.

An apparatus for data processing is described. The apparatus may include a processor, memory coupled with the processor, and instructions stored in the memory. The instructions may be executable by the processor to cause the apparatus to receive, from an application, a query including a request for data stored as ciphertext at a database, identify a differential privacy mechanism applicable to the query, the data, or both, transform the query to include a noisification function based on the differential privacy mechanism, execute the transformed query at the database, where the executing includes adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function, and receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query.

Another apparatus for data processing is described. The apparatus may include means for receiving, from an application, a query including a request for data stored as ciphertext at a database, means for identifying a differential privacy mechanism applicable to the query, the data, or both, means for transforming the query to include a noisification function based on the differential privacy mechanism, means for executing the transformed query at the database, where the executing includes adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function, and means for receiving, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query.

A non-transitory computer-readable medium storing code for data processing is described. The code may include instructions executable by a processor to receive, from an application, a query including a request for data stored as ciphertext at a database, identify a differential privacy mechanism applicable to the query, the data, or both, transform the query to include a noisification function based on the differential privacy mechanism, execute the transformed query at the database, where the executing includes adding noise to a query result at the database prior to decrypting the ciphertext to obtain a noisified query result according to the noisification function, and receive, from the database and in response to the transformed query, the noisified query result including the ciphertext based on executing the transformed query.

Some examples of the method, apparatuses, and non-transitory computer-readable medium described herein may further include operations, features, means, or instructions for decrypting the ciphertext for the noisified query result and transmitting, to the application and in response to the query, the noisified query result including the decrypted ciphertext.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the query may be a statistical query and some examples of the method, apparatuses, and non-transitory computer-readable medium described herein may further include operations, features, means, or instructions for performing one or more statistical operations on the noisified query result based on the decrypted ciphertext and the statistical query.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the ciphertext for the noisified query result may be decrypted external to the database.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, transforming the query further may include operations, features, means, or instructions for performing one or more calls to one or more UDFs based on the query, the differential privacy mechanism, or both.

Some examples of the method, apparatuses, and non-transitory computer-readable medium described herein may further include operations, features, means, or instructions for encrypting the data to obtain the ciphertext and storing the ciphertext at the database, where the stored ciphertext may be noise-free.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the query may be associated with an analytics operation, and the differential privacy mechanism may be identified based on the analytics operation. Some examples of the method, apparatuses, and non-transitory computer-readable medium described herein may further include operations, features, means, or instructions for receiving, from a second application, a second query including a second request for at least a portion of the data, where the second query may be associated with a permissioned user request, executing the second query at the database to obtain a query result including second ciphertext associated with the portion of the data, receiving, from the database and in response to the second query, the query result including the second ciphertext based on executing the second query, decrypting the second ciphertext for the query result to obtain the portion of the data, where the portion of the data may be noise-free based on the storing and the second query being associated with the permissioned user request, and transmitting, to the second application and in response to the second query, the portion of the data.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the noisification function may be associated with a level of noise. Some examples of the method, apparatuses, and non-transitory computer-readable medium described herein may further include operations, features, means, or instructions for determining the level of noise for the noisification function based on a preference of an owner of the data, a user identifier associated with the query, an analytics operation associated with the query, or a combination thereof.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the query may include a COUNT operation and adding the noise to the query result at the database further may include operations, features, means, or instructions for calculating one or more aggregate values based on the ciphertext and the COUNT operation, where each aggregate value of the one or more aggregate values may be associated with a corresponding ciphertext label, determining one or more noise values, and adding the one or more noise values to at least one of the one or more aggregate values to obtain one or more noisified aggregate values, where the noisified query result includes the one or more noisified aggregate values and where each noisified aggregate value of the one or more noisified aggregate values may be associated with the corresponding ciphertext label.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the query may include a field-level operation and adding the noise to the query result at the database further may include operations, features, means, or instructions for identifying a set of encrypted fields in the database including the ciphertext, where the ciphertext may be encrypted according to a homomorphic encryption key, determining a set of noise values, where each noise value of the set of noise values corresponds to a respective field of the set of fields, encrypting the set of noise values using the homomorphic encryption key, and adding the set of encrypted noise values to the set of encrypted fields based on the field-level operation to obtain a set of noisified encrypted field values, where the noisified query result includes the set of noisified encrypted field values.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the database may be a relational database, the field-level operation may include a row-level operation, a JOIN operation, or a combination thereof in the relational database, and the set of encrypted fields corresponds to a column in the relational database.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the database may be a relational database, and the data may be stored as first ciphertext in a first column of the relational database and as second ciphertext in a second column of the relational database, where the first ciphertext may be encrypted according to a first homomorphic encryption method and the second ciphertext may be encrypted according to a second homomorphic encryption method different from the first homomorphic encryption method.

In some examples of the method, apparatuses, and non-transitory computer-readable medium described herein, the ciphertext may be an example of the first ciphertext and executing the transformed query at the database further may include operations, features, means, or instructions for determining to use the first column for executing the transformed query based on the first homomorphic encryption method supporting the differential privacy mechanism.

Some examples of the method, apparatuses, and non-transitory computer-readable medium described herein may further include operations, features, means, or instructions for refraining from handling a plaintext version of the data in the database based on adding the noise to the query result at the database prior to decrypting the ciphertext.