Providing an API for performing at least one function on sensitive data
The method generates a wrapper program to encrypt and process sensitive data in a trusted environment, addressing privacy and regulatory challenges by ensuring secure data utilization and compliance.
Patent Information
- Application Number
- PCT/EP2025/062177
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-05
- Publication Date
- 2026-11-12
AI Technical Summary
The processing and sharing of sensitive data pose significant privacy risks and regulatory challenges, limiting the ability to utilize user data effectively while adhering to stringent privacy regulations.
A method and system for generating a wrapper program on a user device to encrypt sensitive data, transmitting it to a protected environment for execution, and providing an API to perform functions on the data without exposing it to untrusted environments, using trusted execution environments and confidential containers.
Ensures secure processing of sensitive data by maintaining user privacy and compliance with privacy regulations, allowing data utilization while preventing unauthorized access and data breaches.
Smart Images

Figure EP2025062177_12112026_PF_FP_ABST
Abstract
Description
PROVIDING AN API FOR PERFORMING AT LEAST ONE FUNCTION ON SENSITIVE DATATECHNICAL FIELD
[0001] The present disclosure relates to the field of data protection and in particular to providing an application programming interface (API) for performing at least one function on sensitive data.BACKGROUND
[0002] The collection and utilisation of sensitive data, such as personal data from user devices, for example smartphones, tablets, and wearable computing devices, is increasing in modern computing environments. This sensitive data can be used in training to improve the performance of artificial intelligence (Al) systems and enhance the capabilities of rule-based models. Examples of such data include behavioural metrics, location history, and user-generated content, all of which can be of substantial value in training, validating, or refining Al or rule-based models.
[0003] However, the processing and sharing of sensitive data pose significant challenges. Personal data are subject to strict regulatory regimes, including but not limited to the General Data Protection Regulation (GDPR) in the European Union, which impose stringent requirements concerning user consent, data minimisation, and data localisation. These legal frameworks are designed to protect rights and freedoms of individuals, but they also limit the ability of service providers to access, aggregate, and analyse user data at scale.
[0004] The communication of sensitive data to multiple nodes introduces privacy risks, such as the potential for data breaches, unauthorised access, or misuse of sensitive data.
[0005] There is therefore a need for improved ways for enabling the utilisation of sensitive data collected on user devices, while simultaneously protecting user privacy.SUMMARY
[0006] One object is to improve privacy of sensitive data collected on user devices, while enabling processing of sensitive data.
[0007] According to a first aspect, it is provided a method for providing an application programming interface, API, for performing at least one function on sensitive data, the method being performed by a user device. The method comprises: determining at least one function to be performed on the sensitive data; encrypting the sensitive data to encrypted sensitive data; obtaining a generated wrapper program, the wrapper program being generated in response to determining the at least one function to be performed on the sensitive data, to provide an API for performing at least one function on the sensitive data, in accordance with the determined function to be performed on the sensitive data; transmitting the generated wrapper program to a server for execution in a protected environment of the server; receiving a key request from the protected environment; evaluating whether the key request is valid; and transmitting, in response to the key request being valid, a decryption key to enable the protected environment to decrypt the sensitive data from encrypted sensitive data.
[0008] The determining at least one function to be performed on the sensitive data may comprise receiving an API request for interacting with the sensitive data, in which case the API request comprises a function indication, indicating the at least one function to be performed on the sensitive data.
[0009] The API request may comprise a data indication, indicating a type of sensitive data to provide; in which case, in the encrypting the sensitive data, the sensitive data is in accordance with the type of sensitive data of the data indication.
[0010] The API request may comprises an identifier of the protected environment instance, and the key request may comprise an identifier of the protected environment instance, and a nonce. In this case, evaluating whether the key request is valid comprises verifying the identifier of the protected environment instance in the key request against the protected environment instance in the API request; and verifying that the nonce has not been used before for the protected environment instance.[oon] The key request may comprise an integrity indicator of the wrapper program; in which case the evaluating whether the key request is valid comprises verifying that the integrity indicator matches the transmitted wrapper program.
[0012] The receiving the API request may comprise receiving the API request from a software application executing in the user device, in which case the software application is associated with server functions executing in the server.
[0013] The generated wrapping program may comprise the encrypted sensitive data.
[0014] The method may further comprise: transmitting encrypted sensitive data to protected environment after transmitting the generated wrapper program.
[0015] The obtaining the generated wrapper program may comprise the user device generating the wrapper program.
[0016] The generating the wrapper program may comprise generating source code to perform the at least one function on the sensitive data.
[0017] The API request may comprise a requirement of the protected environment, in which case the generating source code comprises generating source code that fulfils the requirement of the protected environment.
[0018] The generating the wrapper program may comprise generating an aggregation function, in the wrapper program, to provide an aggregation of the sensitive data with input data provided as input to the aggregation function.
[0019] The wrapper program may be executable in the protected environment.
[0020] The method may further comprise: obtaining a policy indicating what functions or type of sensitive data are allowed to be included in the wrapper program; in which case, in the obtaining the generated wrapper program, the wrapper program is generated in compliance with the policy.
[0021] The policy may further indicate what sensitive data can be made available to the wrapper program.
[0022] The API request may comprise an indication of minimum functionality that needs to be included in the wrapper program, in which case the obtaining the generated wrapper program is performed conditional on the policy allowing the minimum functionality, in which the wrapper program comprises the minimum functionality.
[0023] According to a second aspect, it is provided a user device for providing an application programming interface, API, for performing at least one function on sensitive data. The user device comprises: processing circuitry; and memory circuitry storing instructions that, when executed by the processing circuitry, cause the user device to: determine at least one function to be performed on the sensitive data; encrypt the sensitive data to encrypted sensitive data; obtain a generated wrapper program, the wrapper program being generated in response to determining the at least one function to be performed on the sensitive data, to provide an API for performing at least one function on the sensitive data, in accordance with the determined function to be performed on the sensitive data; transmit the generated wrapper program to a server for execution in a protected environment of the server; receive a key request from the protected environment; evaluate whether the key request is valid; and transmit, in response to the key request being valid, a decryption key to enable the protected environment to decrypt the sensitive data from encrypted sensitive data.
[0024] The instructions to determine at least one function to be performed on the sensitive data may comprise instructions that, when executed by the processing circuitry, cause the user device to receive an API request for interacting with the sensitive data, in which case the API request comprises a function indication, indicating the at least one function to be performed on the sensitive data.
[0025] The API request may comprise a data indication, indicating a type of sensitive data to provide; in which case, in the instructions to encrypt the sensitive data, the sensitive data is in accordance with the type of sensitive data of the data indication.
[0026] The API request may comprise an identifier of the protected environment instance, and the key request may comprises an identifier of the protected environment instance, and a nonce. In this case, the instructions to evaluate whether the key request is valid comprise instructions that, when executed by the processing circuitry, cause theuser device to verify the identifier of the protected environment instance in the key request against the protected environment instance in the API request; and to verify that the nonce has not been used before for the protected environment instance.
[0027] The key request may comprise an integrity indicator of the wrapper program. In this case, the instructions to evaluate whether the key request is valid comprise instructions that, when executed by the processing circuitry, cause the user device to verify that the integrity indicator matches the transmitted wrapper program.
[0028] The instructions to receive the API request may comprise instructions that, when executed by the processing circuitry, cause the user device to receive the API request from a software application executing in the user device, in which case the software application is associated with server functions executing in the server.
[0029] The generated wrapping program may comprise the encrypted sensitive data.
[0030] The user device may further comprise instructions that, when executed by the processing circuitry, cause the user device to: transmit encrypted sensitive data to protected environment after transmitting the generated wrapper program.
[0031] The instructions to obtain the generated wrapper program may comprise instructions that, when executed by the processing circuitry, cause the user device to generate the wrapper program.
[0032] The instructions to generate the wrapper program may comprise instructions that, when executed by the processing circuitry, cause the user device to generate source code to perform the at least one function on the sensitive data.
[0033] The API request may comprise a requirement of the protected environment, in which case the instructions to generate source code comprise instructions that, when executed by the processing circuitry, cause the user device to generate source code that fulfils the requirement of the protected environment.
[0034] The instructions to generate the wrapper program may comprise instructions that, when executed by the processing circuitry, cause the user device to generate anaggregation function, in the wrapper program, to provide an aggregation of the sensitive data with input data provided as input to the aggregation function.
[0035] The wrapper program may be executable in the protected environment.
[0036] The user device may further comprise instructions that, when executed by the processing circuitry, cause the user device to: obtain a policy indicating what functions or type of sensitive data are allowed to be included in the wrapper program. In this case, the instructions to obtain the generated wrapper program comprise instructions that, when executed by the processing circuitry, cause the user device to generate the wrapper program in compliance with the policy.
[0037] The policy may further indicate what sensitive data can be made available to the wrapper program.
[0038] The API request may comprise an indication of minimum functionality that needs to be included in the wrapper program, in which case the instructions to obtain the generated wrapper program are performed conditional on the policy allowing the minimum functionality, in which the wrapper program comprises the minimum functionality.
[0039] According to a third aspect, it is provided a computer program for providing an application programming interface, API, for performing at least one function on sensitive data. The computer program comprises computer program code which, when executed on a user device causes the user device to: determine at least one function to be performed on the sensitive data; encrypt the sensitive data to encrypted sensitive data; obtain a generated wrapper program, the wrapper program being generated in response to determining the at least one function to be performed on the sensitive data, to provide an API for performing at least one function on the sensitive data, in accordance with the determined function to be performed on the sensitive data; transmit the generated wrapper program to a server for execution in a protected environment of the server; receive a key request from the protected environment; evaluate whether the key request is valid; and transmit, in response to the key request being valid, a decryptionkey to enable the protected environment to decrypt the sensitive data from encrypted sensitive data.
[0040] According to a fourth aspect, it is provided a computer program product comprising a computer program according to the third aspect and a computer readable means comprising non-transitory memory in which the computer program is stored.
[0041] Generally, all terms used in the claims are to be interpreted according to their ordinary meaning in the technical field, unless explicitly defined otherwise herein. All references to "a / an / the element, apparatus, component, means, step, etc." are to be interpreted openly as referring to at least one instance of the element, apparatus, component, means, step, etc., unless explicitly stated otherwise. The steps of any method disclosed herein do not have to be performed in the exact order disclosed, unless explicitly stated.BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Aspects and embodiments are now described, by way of example, with reference to the accompanying drawings, in which:
[0043] Figs 1A-B are schematic diagrams illustrating environments in which embodiment presented and can be applied;
[0044] Figs 2A-C are swimlane diagrams illustrating embodiments of methods for providing an API for performing at least one function on sensitive data;
[0045] Fig 3 is a schematic diagram illustrating components of the user device of Fig 2;
[0046] Fig 4 is a schematic diagram showing functional modules of the user device of Figs 1A-B according to one embodiment; and
[0047] Fig 5 shows one example of a computer program product 90 comprising computer readable means.DETAILED DESCRIPTION
[0048] The aspects of the present disclosure will now be described more fully hereinafter with reference to the accompanying drawings, in which certain embodiments of the invention are shown. These aspects may, however, be embodied in many different forms and should not be construed as limiting; rather, these embodiments are provided by way of example so that this disclosure will be thorough and complete, and to fully convey the scope of all aspects of invention to those skilled in the art. Like numbers refer to like elements throughout the description.
[0049] According to embodiments presented herein, it is provided an improved way to communicate sensitive data to a server. A wrapper program is generated to provide certain functionality on the sensitive data using APIs from a protected environment of a server to untrusted code. The sensitive data is only processed in unencrypted form by the wrapper program in the protected environment. Code executing in an untrusted environment, outside the protected environment 4, uses the APIs to perform functions based on the sensitive data, e.g. for machine learning, data aggregation, etc.
[0050] Figs 1A-B are schematic diagrams illustrating environments in which embodiment presented and can be applied. First, embodiment illustrated by Fig 1A will be described.
[0051] A user 5 carries a user device 2, that can be any suitable electronic device that, at least part of the time, handles sensitive data. For instance, the user device 2 can be in the form of a smartphone, wearable device, tablet computer, laptop computer, etc. The user device makes use of, or generates, sensitive data that can be personal for the user 5. For instance, such sensitive data can include behavioural metrics, location history, and user-generated content. Exposure of the sensitive data should be limited to protect privacy of the user 5. The user device comprises a first application 7 and a second application 8. Each application is in the form of software executable by the user device 2. Sensitive data can be collected or generated by the second application 8, which can be an untrusted application. According to embodiments presented herein, the first application 7 manages how the sensitive data is exposed to a server 3. The firstapplication 7 can be provided as a controller function, such as an application or kernel module on the user device 2.
[0052] A communication network 9 is provided, and can be a wide area network, such as the Internet, to which the user device 2 can connect via Wi-Fi (e.g. any of the IEEE 802. nx standards) or a cellular network, such as LTE (Long Term Evolution), next generation mobile networks (fifth generation, 5G), sixth generation (6G) mobile network, etc.
[0053] The server 3 is comprises an untrusted environment 6 and a protected environment 4. The server 3 is also connected to the communication network 7, e.g. via Ethernet, an optical fibre and / or Wi-Fi. The server 3 can be implemented on a single physical server or over multiple physical servers, potentially over large geographic areas, also known as in the cloud.
[0054] The protected environment 4 can e.g. be implemented using a trusted execution environment (TEE), which can be implemented as a defined secure area of a processor. The TEE protects program code and data within the TEE from a confidentiality and integrity perspective. The data confidentiality prevents unauthorised entities from outside the TEE from reading data, while code integrity prevents code in the TEE from being replaced or modified by unauthorised entities outside the protected environment 4. In other words, the untrusted environment 6 is prevented from directly accessing code or data in the protected environment 4.
[0055] The protected environment 4 is thus an isolated execution environment that provides security features such as isolated execution, integrity of applications executing with the protected environment 4, and confidentiality of their data assets. The protected environment 4 offers an execution space that provides a higher level of security for trusted applications running on the device than the untrusted environment 6, which is also known as a rich execution environment (REE).
[0056] Alternatively or additionally to the TEE, the protected environment 4 can be implemented as a confidential container. A confidential container is a software container deployed within a hardware-backed TEE to ensure the confidentiality andintegrity of data and code during execution. Unlike conventional software containers, confidential containers are isolated from the host operating system and other tenants of the host, with all in-memory data and code execution occurring within an encrypted and attested environment. This architecture enables sensitive workloads to be securely executed, even in untrusted or multi-tenant infrastructures, by preventing unauthorised access to the container’s internal state and by supporting remote attestation of the container’s integrity and origin.
[0057] The untrusted environment 6 and the protected environment 4 can communicate through communication agents in their respective domains. Messages between the untrusted environment 6 and the protected environment 4 can have predetermined size and type to further control the information flows therebetween.
[0058] The protected environment 4 and the untrusted environment 6 are separated in hardware and / or software. For instance, the protected environment 4 can be provided using Intel SGX (software guard extensions), providing hardware-based memory encryption that allows user-level code to allocate private memory regions, or AMD (advanced micro devices) SEV (secure encrypted virtualisation) that encrypts the memory of entire virtual machines using a secure processor embedded in the CPU. Furthermore, acceleration peripherals, such as GPUs (graphical processing units) and FPGAs (field-programmable gate array), can also form part of the protected environment 4.
[0059] Looking now to Fig 1B, the main difference compared to Fig 1A is that a second server 3’ is here provided separate from the server 3 containing the untrusted environment 6. The second server 3’ here comprises the protected environment 4.
[0060] Figs 2A-C are swimlane diagrams illustrating embodiments of methods for providing an API, for performing at least one function on sensitive data.
[0061] The swimlane diagrams can be considered to comprise a flow chart for methods performed by the user device 2 in the two leftmost swimlanes. Communication between the various entities is also shown. The server 3 comprises the untrusted environment 6. As indicated by the dashed outline of the server 3, the server 3 may, butdoes not need to, comprise the protected environment 4, in line with the two options illustrated by Figs 1A-B
[0062] In a determine function(s) step 40, first application 7 of the user device 2 determines at least one function to be performed on the sensitive data. As explained with reference to Fig 2B below, this can be based on an API request from the second application 8. Alternatively, the at least one function can be determined based needs expressed by the second application 8 and / or the server 3.
[0063] In an encrypt data step 42, the first application 7 of the user device 2 encrypts the sensitive data, to yield encrypted sensitive data. The encryption can be based on a symmetric key or based on an asymmetric keypair. The sensitive data can be collected by the second application 8 and include, for instance, usage statistics, device metadata, environmental data regarding the device’s surroundings, etc.
[0064] In an obtain wrapper program (prog.) step 43, the first application 7 of the user device 2 obtains a generated wrapper program. The wrapper program is generated in response to determining the at least one function to be performed on the sensitive data. The wrapper program is generated to provide an API for performing at least one function on the sensitive data, in accordance with the determined function to be performed on the sensitive data. The wrapper program can be generated based on template code. The template code for the server’s processing function may comprise a public part which is intended to be populated by the server upon executing the wrapper program. For example, the server’s processing function maybe generated in form of a neural network architecture with empty weights, that are subsequently populated by the server 3.
[0065] In some embodiments, the server’s processing function is left empty and instead added at the server at a later stage. To ensure that sensitive data is not extracted from the wrapper program by the added processing, additional security functionality can then be provided. This security functionality can be implemented as the API of the wrapper program taking a function as input, which is updated with the data and returned. The function may be submitted in a script language, e.g. Python or language using Just-In-Time (JIT) compilation, e.g. Java. A security function in the wrapperprogram analyses the submitted function to ensure that it does not extract the data in cleartext but only uses it to update a function state which cannot easily be reverse engineered to obtain the data.
[0066] There are several methods to generate source code from defined intents or descriptions. One example of code generation is metaprogramming, which allows applications to treat other applications as their data. As such, the applications can read, produce, examine, alter, and adjust other programs while simultaneously running. This allows programs to create methods upfront without defining the methods within the program. Another example is Al (artificial intelligence) code generation that uses machine learning models to write code from input that describes what the code should do, based on certain inputs and parameters, such as natural language descriptions.
[0067] In one embodiment, the generated wrapping program comprises the encrypted sensitive data. This can be the case when the sensitive data is available already at the time that the wrapper program is generated. Otherwise, the sensitive data is provided later, as illustrated by Fig 2C, described in more detail below.
[0068] Optionally, the wrapper program is generated by the user device 2. The wrapper program can be generated by generating source code to perform the at least one function on the sensitive data.
[0069] In one embodiment, the generating the wrapper program comprises generating an aggregation function, in the wrapper program, to provide an aggregation of the sensitive data with input data, provided as input to the aggregation function. For instance, when applied for training a machine learning model, an input to the aggregation function can be characteristics of the current state of a machine learning model, which can be expressed as weights in a neural network of the untrusted environment 6. The function, when executed in the protected environment 4, updates input values, (e.g. the weights) by aggregating with the sensitive data. The function returns the aggregated data, for instance, in the form of updated weights, to the unprotected environment 6.
[0070] The wrapper program can be executable in the protected environment, in the form that it is generated or after compilation. The compilation can occur by the user device 2, by the untrusted environment 6, by the protected environment 4 or by another entity.
[0071] In one embodiment, instead of the user device 2 generating the wrapper program, the wrapper program is generated by an external device, such as a server (not shown) that provides this function, according to a request from the user device 2. In this case, the user device 2 sends a request to the external device with details for the generation, based on the determined function(s) and optionally the sensitive data. The external device then generates the wrapper program and sends the wrapper program back to the user device 2.
[0072] In a transmit wrapper program step 44, the first application 7 of the user device 2 transmits the generated wrapper program 22 to a server 3 for execution in a protected environment 4 of the server 3. The generated wrapper program 22 can be transmitted to the untrusted environment 6 of the server 3.
[0073] In a receive wrapper program step 244, the untrusted environment 6 receives the generated wrapper program 22.
[0074] In an initiate wrapper program step 245, the untrusted environment 6 and the protected environment 4 cooperate to install the wrapper program in the protected environment 4 and launch the wrapper program within the protected environment 4.
[0075] In order to access encrypted sensitive data within the protected environment 4, the protected environment 4 needs to obtain a decryption key. Hence, in a transmit key request step 246, the protected environment 4 transmits a key request 24 to the first application 7 of the user device 2.
[0076] In a receive key request step 46, the first application 7 of the user device 2 receives the key request 24 from the protected environment 4. Optionally, the key request 24 comprises an integrity indicator of the wrapper program. For instance, the integrity indicator can be a hash, or other one-way function based integrity indicator,that is calculated based on the wrapper program that is executed in the protected environment 4.
[0077] Optionally, the key request comprises attestation proof for the protected environment including an identifier of the wrapper program, a protected environment state, a protected environment ID and a nonce (described in more detail below). The attestation proof can include a cryptographic signature from hardware provider to prove authenticity, as well as a cryptographic signature from server and a cryptographic signature of the protected environment 4.
[0078] It is to be noted that the key request 24 does not need to comprise an explicit indication that the protected environment 4 requests a decryption key; the key request 24 can provide attestation data to the protected environment 4, which based on predefined logic, if attestation is successful, replies with the decryption key as described below.
[0079] In a conditional key request valid step 48, the first application 7 of the user device 2 evaluates whether the key request is valid. One condition for validity, when the integrity indicator is included in the key request 24, can be that the user device 2 verifies that the integrity indicator matches the transmitted wrapper program. This verification is then based on the user device 2 calculating its own integrity indicator based on the wrapper program that was transmitted to the server 3. Another condition for validity can be to verify the cryptographic signature of the hardware provider and / or the cryptographic signature of the server and / or the cryptographic signature of the protected environment 4.
[0080] If the key request is valid, the method of the user device 2 proceeds to a transmit decryption key step 50. Otherwise, the method ends.
[0081] In the transmit decryption key step 50, the first application 7 of the user device 2 transmits a decryption key 26 to the protected environment 4. The transmission occurs over a secure (encrypted) communication channel, e.g. based on TLS (transport layer security) between the first application 7 and the protectedenvironment 4. The decryption key enables the protected environment 4 to decrypt the sensitive data from encrypted sensitive data.
[0082] In a receive decryption key step 250, the protected environment 4 receives the decryption key 26 from the first application 7 of the user device 2. It is to be noted that the untrusted environment 6 never has access to the decryption key as this is communicated over the end-to-end secure channel between the first application 7 and the protected environment 4.
[0083] In a decrypt data step 252, the protected environment 4 decrypts the encrypted sensitive data using the received decryption key.
[0084] In an A I based processing step 254, the untrusted environment 6 and the protected environment 4 cooperate by the protected environment 4 executing the wrapper program to expose functions of the API to the untrusted environment 6. This allows the untrusted environment 6 to perform functions on the sensitive data in accordance with the API without ever having direct access to the sensitive data. This can e.g. be used for federated learning, to update Al models based on the sensitive data.
[0085] Looking now to Fig 2B, only new or modified steps compared to those illustrated by Fig 2A will be described.
[0086] In an optional transmit API request step 140, a second application 8 of the user device 2 transmits an API request 20 to the first application 7 of the user device 2. In this case, the determine function's) step 40 comprises receiving the API request 20 for interacting with the sensitive data. The API request 20 comprises a function indication, indicating the at least one function to be performed on the sensitive data. The function indication can be in the form of specific function definitions, or in a more abstract manner. Optionally, the API request also comprises a specification of the sensitive data to be collected from the user device 2.
[0087] Optionally, the API request 20 comprises an identifier of the protected environment instance. In this case, the subsequent key request 24 from the protected environment 4 comprises an identifier of the protected environment instance, and a nonce. The nonce can be generated by the protected environment 4 when the wrapperprogram is initiated in the initiate wrapper program step 245. The identifier of the protected environment instance can be in the form of certificate. Furthermore a certificate for the server 3 can optionally be provided in the API request 20. This allows the first application 7, in the conditional key request valid step 48 to verify that the identifier of the protected environment instance in the key request matches the protected environment instance in the API request. When provided, the identity of the server 3 can be verified in the same manner. Moreover, the user device 2 can verify that the nonce has not been used before for the protected environment instance, to prevent a replay attack. Hence, only if the identifiers of the protected environment instance (and optionally also the server) match and the nonce has not been seen before is the key request 24 considered to be valid.
[0088] When the API request is received from the second application 8 executing in the user device 2, the second software application 8 can be associated with server functions executing in the server 3. In other words, the second software application 8 can be provided by the same entity that controls the server 3.
[0089] The API request may comprise a requirement of the protected environment. In this case, the generating source code comprises generating source code of the wrapper program that fulfils the requirement of the protected environment.
[0090] In an optional obtain policy step 41, the first application 7 of the user device 2 obtains a policy indicating what functions or type of sensitive data that are allowed to be included in the wrapper program. The policy can be a result of user preferences. Optionally, the policy further indicates what sensitive data can be made available to the wrapper program. When a policy is obtained, in the obtain wrapper program step 43, the wrapper program is generated in compliance with the policy. The policy can thereby define restrictions on the type of functions that are exposed by the wrapper program.
[0091] Optionally, the API request 20 comprises an indication of minimum functionality that needs to be included in the wrapper program for it to be of use. This minimum functionality is applicable in combination with the policy. In this case, the obtain wrapper program step 43 comprises only proceeding to obtain the wrapper program conditional on the policy allowing the minimum functionality, in which thewrapper program comprises the minimum functionality. In other words, if the policy is more restrictive than the minimum functionality, the method ends, and no wrapper program is generated in that scenario.
[0092] Looking now to Fig 2C, only new or modified steps compared to those illustrated by Fig 2A and Fig 2B will be described.
[0093] In embodiments illustrated by Fig 2C, the encrypt data step 42 is performed by the first application 7 in the user device 2 after transmitting the wrapper program 22 in the transmit wrapper program step 44. This allows sensitive data to be obtained and encrypted after the wrapper program is generated (and sent to the server 3), allowing the wrapper program to access sensitive data that is only made available at a later point in time. Additionally, more sensitive data can be provided over time for processing by the same wrapper program in the protected environment 4.
[0094] Hence, in this case, in a transmit encrypted (encrypt.) data step 52, the first application 7 of the user device 2 transmits encrypted sensitive data 28 to protected environment 4 after transmitting 44 the generated wrapper program.
[0095] In a receive encrypted data step 256, the protected environment 4 receives the encrypted sensitive data 28 from the first application 7 of the user device 2. Since the protected environment 4 has access to the decryption key, the protected environment 4 can decrypt the encrypted sensitive data in the decrypt data step 252. Steps 42, 52, 256 and 252 can be repeated to process more sensitive data as it becomes available.
[0096] For all or some of the communication between the first application 7 and the server 3, including the wrapper program 22, the key request 24, the decryption key 26 and / or the encrypted data 28, the communication can occur from the first application 7, via the communication network 9, to the protected environment 4. Optionally, the communication between the first application 7 and the server 3 occurs also via the second application 8 which may have a prior established communication channel and / or trust.
[0097] According to embodiments presented herein, control of the sensitive data is maintained by the data owner (the user 5 of the user device 2) throughout the lifetime of the data. The control spans over how sensitive data is processed, and to whom access is provided.
[0098] By generating the data for the determined function(s), the API enables certain functions to be performed by the untrusted environment 6 while following the restrictions put by the user. The API of the wrapper program is generated by the user device for each specific combination.
[0099] The wrapper program is executed in the protected environment 4, and only the protected environment 4, when attested by the user device 2, is provided the decryption key from the user device 2 to decrypt the sensitive data. In this way, the sensitive data is never exposed to the untrusted environment 6.
[0100] If the wrapper program is forwarded to a third-party server, the attestation will fail, preventing the decryption key from being provided to the third-party server, thereby ensuring confidentiality of the sensitive data.
[0101] Fig 3 is a schematic diagram illustrating components of the user device 2 of Fig 2. Processing circuitry 60 is provided using any combination of one or more of a suitable central processing unit (CPU), graphics processing unit (GPU), multiprocessor, neural processing unit (NPU), microcontroller, digital signal processor (DSP), etc., capable of executing software instructions 67 stored in memory circuitry 64, which can thus be a computer program product. The processing circuitry 60 could alternatively be implemented using an application specific integrated circuit (ASIC), FPGA, etc. The processing circuitry 60 can be configured to execute the methods of the user device 2 described with reference to Figs 2A-C above.
[0102] The memory circuitry 64 can be any combination of random-access memory (RAM) and / or read-only memory (ROM). The memory circuitry 64 also comprises non-transitory persistent storage, which, for example, can be any single one or combination of magnetic memory, optical memory, solid-state memory or even remotely mounted memory.
[0103] A data memory 66 is also provided for reading and / or storing data during execution of software instructions in the processing circuitry 60. The data memory 66 can be any combination of RAM and / or ROM.
[0104] The user device 2 further comprises an 1 / O interface 62 for communicating with external and / or internal entities. Optionally, the I / O interface 62 also includes a user interface.
[0105] Other components of the user device 2 are omitted in order not to obscure the concepts presented herein.
[0106] Fig 4 is a schematic diagram showing functional modules of the user device 2 of Figs 1A-B according to one embodiment. The modules are implemented using software instructions such as a computer program executing in the user device 2 Alternatively or additionally, the modules are implemented using hardware, such as any one or more of an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or discrete logical circuits. The modules correspond to the steps in the methods illustrated in Figs 2A-C.
[0107] A function determiner 70 corresponds to step 40. A policy obtainer 71 corresponds to step 41. A data encrypter 72 corresponds to step 42. A wrapper program obtainer 73 corresponds to step 43. A wrapper program transmitter 74 corresponds to step 44. A key request receiver 76 corresponds to step 46. A key request validator 78 corresponds to step 48. A decryption key transmitter 80 corresponds to step 50. An encrypted data transmitter 82 corresponds to step 52.
[0108] Fig 5 shows one example of a computer program product 90 comprising computer readable means. On this computer readable means, a computer program 91 can be stored in a non-transitory memory. The computer program can cause processing circuitry to execute a method according to embodiments described herein. In this example, the computer program product 90 is in the form of a removable solid-state memory, e.g. a Universal Serial Bus (USB) drive. As explained above, the computer program product could also be embodied in a memory of a device, such as the computer program product 64 of Fig 3. While the computer program 91 is here schematicallyshown as a section of the removable solid-state memory, the computer program can be stored in any way which is suitable for the computer program product, such as another type of removable solid-state memory, or an optical disc, such as a CD (compact disc), a DVD (digital versatile disc) or a Blu-Ray disc.
[0109] The aspects of the present disclosure have mainly been described above with reference to a few embodiments. However, as is readily appreciated by a person skilled in the art, other embodiments than the ones disclosed above are equally possible within the scope of the invention, as defined by the appended patent claims. Thus, while various aspects and embodiments have been disclosed herein, other aspects and embodiments will be apparent to those skilled in the art. The various aspects and embodiments disclosed herein are for purposes of illustration and are not intended to be limiting, with the true scope being indicated by the following claims.
Claims
CLAIMS1. A method for providing an application programming interface, API, for performing at least one function on sensitive data, the method being performed by a user device (2), the method comprising:determining (40) at least one function to be performed on the sensitive data; encrypting (42) the sensitive data to encrypted sensitive data;obtaining (43) a generated wrapper program, the wrapper program being generated in response to determining (40) the at least one function to be performed on the sensitive data, to provide an API for performing at least one function on the sensitive data, in accordance with the determined function to be performed on the sensitive data;transmitting (44) the generated wrapper program to a server (3) for execution in a protected environment (4) of the server (3);receiving (46) a key request from the protected environment (4);evaluating (48) whether the key request is valid; andtransmitting (50), in response to the key request being valid, a decryption key to enable the protected environment to decrypt the sensitive data from encrypted sensitive data.
2. The method according to claim 1, wherein the determining (40) at least one function to be performed on the sensitive data comprises receiving an API request (20) for interacting with the sensitive data, wherein the API request (20) comprises a function indication, indicating the at least one function to be performed on the sensitive data.
3. The method according to claim 2, wherein the API request comprises a data indication, indicating a type of sensitive data to provide; and wherein, in the encrypting (42) the sensitive data, the sensitive data is in accordance with the type of sensitive data of the data indication.
4. The method according to claim 2 or 3, wherein the API request comprises an identifier of the protected environment instance, and the key request comprises an identifier of the protected environment instance, and a nonce;and wherein the evaluating (48) whether the key request is valid comprises verifying the identifier of the protected environment instance in the key request against the protected environment instance in the API request; and verifying that the nonce has not been used before for the protected environment instance.
5. The method according to any one of claims 2 to 4, wherein the key request (24) comprises an integrity indicator of the wrapper program;and wherein the evaluating (48) whether the key request is valid comprises verifying that the integrity indicator matches the transmitted wrapper program.
6. The method according to any one of claims 2 to 5, wherein the receiving (40) the API request comprises receiving the API request from a software application executing in the user device (2), wherein the software application is associated with server functions executing in the server (3).
7. The method according to any one of the preceding claims, wherein the generated wrapping program comprises the encrypted sensitive data.
8. The method according to any one of the preceding claims, further comprising: transmitting (52) encrypted sensitive data to protected environment (4) after transmitting (44) the generated wrapper program.
9. The method according to any one of the preceding claims, wherein the obtaining (43) the generated wrapper program comprises the user device (2) generating the wrapper program.
10. The method according to claim 9, wherein the generating the wrapper program comprises generating source code to perform the at least one function on the sensitive data.
11. The method according to claim 10, when dependent on claim 2, wherein the API request comprises a requirement of the protected environment, and wherein the generating source code comprises generating source code that fulfils the requirement of the protected environment.
12. The method according to any one of claims 9 to 11, wherein the generating the wrapper program comprises generating an aggregation function, in the wrapper program, to provide an aggregation of the sensitive data with input data provided as input to the aggregation function.
13. The method according to any one of the preceding claims, wherein the wrapper program is executable in the protected environment.
14. The method according to any one of the preceding claims, further comprising: obtaining (41) a policy indicating what functions or type of sensitive data are allowed to be included in the wrapper program; andwherein in the obtaining (43) the generated wrapper program, the wrapper program is generated in compliance with the policy.
15. The method according to claim 14, wherein the policy further indicates what sensitive data can be made available to the wrapper program.
16. The method according to claim 14 or 15 when dependent on claim 2, wherein the API request (20) comprises an indication of minimum functionality that needs to be included in the wrapper program, and wherein the obtaining (43) the generated wrapper program is performed conditional on the policy allowing the minimum functionality, in which the wrapper program comprises the minimum functionality.
17. A user device (2) for providing an application programming interface, API, for performing at least one function on sensitive data, the user device (2) comprising: processing circuitry (60); andmemory circuitry (64) storing instructions (67) that, when executed by the processing circuitry, cause the user device (2) to:determine at least one function to be performed on the sensitive data; encrypt the sensitive data to encrypted sensitive data;obtain a generated wrapper program, the wrapper program being generated in response to determining (40) the at least one function to be performed on the sensitive data, to provide an API for performing at least one function on the sensitive data, in accordance with the determined function to be performed on the sensitive data;transmit the generated wrapper program to a server (3) for execution in a protected environment (4) of the server (3);receive a key request from the protected environment (4);evaluate whether the key request is valid; andtransmit, in response to the key request being valid, a decryption key to enable the protected environment to decrypt the sensitive data from encrypted sensitive data.
18. The user device (2) according to claim 17, wherein the instructions to determine at least one function to be performed on the sensitive data comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to receive an API request (20) for interacting with the sensitive data, wherein the API request (20) comprises a function indication, indicating the at least one function to be performed on the sensitive data.
19. The user device (2) according to claim 18, wherein the API request comprises a data indication, indicating a type of sensitive data to provide; and wherein, in the instructions to encrypt the sensitive data, the sensitive data is in accordance with the type of sensitive data of the data indication.
20. The user device (2) according to claim 18 or 19, wherein the API request comprises an identifier of the protected environment instance, and the key request comprises an identifier of the protected environment instance, and a nonce;and wherein the instructions to evaluate whether the key request is valid comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to verify the identifier of the protected environment instance in the key request against the protected environment instance in the API request; and to verify that the nonce has not been used before for the protected environment instance.
21. The user device (2) according to any one of claims 18 to 20, wherein the key request (24) comprises an integrity indicator of the wrapper program;and wherein the instructions to evaluate whether the key request is valid comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to verify that the integrity indicator matches the transmitted wrapper program.
22. The user device (2) according to any one of claims 18 to 21, wherein the instructions to receive the API request comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to receive the API request from a software application executing in the user device (2), wherein the software application is associated with server functions executing in the server (3).
23. The user device (2) according to any one of claims 17 to 22, wherein the generated wrapping program comprises the encrypted sensitive data.
24. The user device (2) according to any one of claims 17 to 23, further comprising instructions (67) that, when executed by the processing circuitry, cause the user device (2) to:transmit encrypted sensitive data to protected environment (4) after transmitting (44) the generated wrapper program.
25. The user device (2) according to any one of claims 17 to 24, wherein the instructions to obtain the generated wrapper program comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to generate the wrapper program.
26. The user device (2) according to claim 25, wherein the instructions to generate the wrapper program comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to generate source code to perform the at least one function on the sensitive data.
27. The user device (2) according to claim 26, when dependent on claim 18, wherein the API request comprises a requirement of the protected environment, and wherein the instructions to generate source code comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to generate source code that fulfils the requirement of the protected environment.
28. The user device (2) according to any one of claims 25 to 27, wherein the instructions to generate the wrapper program comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to generate anaggregation function, in the wrapper program, to provide an aggregation of the sensitive data with input data provided as input to the aggregation function.
29. The user device (2) according to any one of claims 17 to 28, wherein the wrapper program is executable in the protected environment.
30. The user device (2) according to any one of claims 17 to 29, further comprising instructions (67) that, when executed by the processing circuitry, cause the user device (2) to:obtain a policy indicating what functions or type of sensitive data are allowed to be included in the wrapper program; andwherein the instructions to obtain the generated wrapper program comprise instructions (67) that, when executed by the processing circuitry, cause the user device (2) to generate the wrapper program in compliance with the policy.
31. The user device (2) according to claim 30, wherein the policy further indicates what sensitive data can be made available to the wrapper program.
32. The user device (2) according to claim 30 or 31 when dependent on claim 18, wherein the API request (20) comprises an indication of minimum functionality that needs to be included in the wrapper program, and wherein the instructions to obtain the generated wrapper program are performed conditional on the policy allowing the minimum functionality, in which the wrapper program comprises the minimum functionality.
33. A computer program (67, 91) for providing an application programming interface, API, for performing at least one function on sensitive data, the computer program comprising computer program code which, when executed on a user device (2) causes the user device (2) to:determine at least one function to be performed on the sensitive data; encrypt the sensitive data to encrypted sensitive data;obtain a generated wrapper program, the wrapper program being generated in response to determining (40) the at least one function to be performed on the sensitive data, to provide an API for performing at least one function on the sensitive data, inaccordance with the determined function to be performed on the sensitive data; transmit the generated wrapper program to a server (3) for execution in a protected environment (4) of the server (3);receive a key request from the protected environment (4);evaluate whether the key request is valid; andtransmit, in response to the key request being valid, a decryption key to enable the protected environment to decrypt the sensitive data from encrypted sensitive data.
34. A computer program product (64, 90) comprising a computer program according to claim 33 and a computer readable means comprising non-transitory memory in which the computer program is stored.
