WO2019127468A1 - Grouped application using same key for sharing data - Google Patents

Grouped application using same key for sharing data Download PDF

Info

Publication number
WO2019127468A1
WO2019127468A1 PCT/CN2017/120132 CN2017120132W WO2019127468A1 WO 2019127468 A1 WO2019127468 A1 WO 2019127468A1 CN 2017120132 W CN2017120132 W CN 2017120132W WO 2019127468 A1 WO2019127468 A1 WO 2019127468A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
data
key management
module
application process
Prior art date
Application number
PCT/CN2017/120132
Other languages
French (fr)
Chinese (zh)
Inventor
杨李军
熊晟
王奇
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2017/120132 priority Critical patent/WO2019127468A1/en
Priority to CN201780082026.7A priority patent/CN110140124B/en
Publication of WO2019127468A1 publication Critical patent/WO2019127468A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/12Protecting executable software

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a data processing method and terminal.
  • Each application on the terminal runs in its own separate process space, and the data and functions of each process are isolated from each other. If communication is required between processes, the accessed process must first perform permission checking on the access process. If the verification succeeds, indicating that the access process has access rights, the access process is allowed to access. Otherwise, it indicates that the access process does not have access rights, and the access process is not allowed to access.
  • the current terminal uses a permission mechanism to ensure communication security between processes.
  • a user may be induced to install a virus application and authorize a virus application.
  • the virus application can be verified by the permissions of other processes (accessed processes), that is, the data of other applications can be arbitrarily accessed, or even the key information, which may cause harm to the user.
  • the data processing method and terminal provided by the application can improve data security in an application process on the terminal.
  • a data processing method provided by the present application is applicable to a terminal, where the terminal runs a first application process, a second application process, and a key management process.
  • the method specifically includes: the second application process sending an access request to the first application process, the access request is used to request access to the third data of the first application process; and the key management process receives a decryption request requesting decryption of the third data; If the key management process determines that the second application process is in the process group in which the first application process is located, the key management process decrypts the third data by using the decryption key corresponding to the process group in which the first application process is located. Fourth data; in response to the decryption request, the key management process returns the fourth data.
  • the first application process is one of the processes running by the first application, and the first application may be any application on the terminal, and is a program and a data set that can perform certain business functions, for example, a short message application, a US group application, Taobao applications, etc.
  • the second application process may be another process in the first application, different from the first application process, the second application process may also be a process in the second application, and the second application is different from the second application. .
  • the second application process needs to obtain permission to access the first application process in advance.
  • the first data may be data that needs to be encrypted, for example, data determined according to the first application process or the service nature of the first application, for example, may be important in the first application process or the first application, Critical, sensitive data.
  • the key management module determines, according to the service type of the third application process, or the download source, the packet corresponding to the third application process, and associates the identifier of the third application process with the group identifier, and Save it locally.
  • the key management process decrypts the third data by using the decryption key corresponding to the process group in which the first application process is located, so that the second application process obtains The third data after decryption, that is, the fourth data.
  • the data of the first application process can be accessed, which is beneficial to improving data security in the first application process.
  • the key management process receives a decryption request requesting decryption of the third data, specifically for the key management process to receive a decryption request sent by the first application process according to the access request.
  • the key management process returns the fourth data specifically: the key management process returns the fourth data to the first application process.
  • the first application process sends the fourth data to the second application process.
  • the terminal may be the second application process accessing the first application process, and the first application process requests the key management process to decrypt the third data.
  • the decrypted third data that is, the fourth data
  • the embodiment of the present application provides a method for a second application process to access third data of a first application process.
  • the key management process determines that the second application process is not in the process group in which the first application process is located, the key management process sends the third data to the first application process; The second application process sends the third data.
  • the key management process does not decrypt the third data, and the third data is directly sent to the second application process by using the first application process. Conducive to including the data security of the first application process.
  • the key management module may directly reject the decryption request of the first application process for the third data, and end the process.
  • the method further includes: receiving, by the second application process The third data sent by the application process; the decryption request received by the key management process to decrypt the third data is specifically: the key management process receives the decryption request sent by the second application process; and the key management process returns the fourth data specifically: The key management process returns the fourth data to the second application process.
  • the terminal when the second application process accesses the data of the first application process, the terminal first acquires the data encrypted by the first application process, that is, the third data, and then the second application process requests the third data from the key management process. Decrypt. After the third data is decrypted by the key management process, the decrypted third data, that is, the fourth data, may be sent to the second application process. Therefore, the embodiment of the present application provides a method for a second application process to access third data of a first application process.
  • the key management process determines that the second application process is not in the process group in which the first application process is located, the key management process sends the third data to the second application process.
  • the key management process does not decrypt the third data, and directly sends the third data to the second application process, which is beneficial to include the first application.
  • the data security of the process is beneficial to include the first application.
  • the method further includes: the key management process obtains the first An identifier of an application process; the key management process determines an identifier of a process group in which the first application process is located according to the identifier of the first application process; the key management process acquires the first application according to the identifier of the process group in which the first application process is located The decryption key corresponding to the process group in which the process resides.
  • the present application provides a method for a terminal to acquire a decryption key corresponding to a process group in which a first application process is located.
  • the first application process requests the key management process to encrypt the first data; the key management process determines the process group in which the first application process is located according to the request; the key management process uses the first application process
  • the encryption key corresponding to the process group is encrypted to encrypt the first data to generate second data; the N process packets correspond to M encryption keys, and each process group corresponds to one encryption key; the key management process is The first application process sends the second data.
  • the present application implements a method for encrypting an application process in the same process group by using the same encryption key, which is beneficial to improving data security in an application process.
  • the first application process saves the second data.
  • the first application process saves the second data in an encrypted storage area in the first application process.
  • the encrypted storage area is a specific storage space in the first application process, and is dedicated to storing data encrypted by the key management module.
  • the key management process determines, according to the request, the process group in which the first application process is located: the key management process acquires the identifier of the first application process; and the key management process is based on the identifier of the first application process. The identifier of the process group in which the first application process is located is determined. The key management process obtains the encryption key corresponding to the process group in which the first application process is located according to the identifier of the process group in which the first application process is located.
  • a terminal in a second aspect, includes a first application module, a second application module, and a key management module, and a second application module, configured to send an access request to the first application module, where the access request is used to request access a third data of the first application process; a key management module, configured to receive a decryption request for decrypting the third data; and a key management module, configured to determine, according to the decryption request, that the second application process is first After the process group in which the application process is located, the third data is decrypted by using the decryption key corresponding to the process group in which the first application process is located, and the fourth data is obtained; the key management module is further configured to return to the first request in response to the decryption request.
  • the key management module is further configured to receive a decryption request sent by the first application module according to the access request: the key management module is further configured to return the fourth data to the first application module; An application module, configured to send fourth data to the second application module.
  • the key management module is further configured to: if the key management module determines that the second application process is not in the process group in which the first process is located, send the third data to the first application module; the first application The program module is further configured to send the third data to the second application module.
  • the second application module is further configured to receive third data sent by the first application module, and the key management module is further configured to receive a decryption request sent by the second application module; The module is further configured to return fourth data to the second application module.
  • the key management module is further configured to: if the key management module determines that the second application process is not in the process group in which the first application process is located, send the third data to the second application module.
  • the key management module is further configured to obtain an identifier of the first application module, and the key management module is further configured to determine, according to the identifier of the first application module, a process in which the first application module is located. And a key management module, configured to obtain a decryption key corresponding to the process group in which the first application module is located according to the identifier of the process group in which the first application module is located.
  • the first application module is further configured to request the key management module to encrypt the first data
  • the key management module is further configured to determine, according to the request, a process group in which the first application module is located;
  • the key management module is further configured to encrypt the first data by using an encryption key corresponding to the process group in which the first application module is located, to generate second data;
  • the N process groups correspond to M encryption keys, and each process The packet corresponds to an encryption key;
  • the key management module is further configured to send the second data to the first application module.
  • the first application module is also used to save the second data.
  • the key management module is further configured to obtain an identifier of the first application module, and the key management module is further configured to determine, according to the identifier of the first application module, a process in which the first application module is located. And a key management module, configured to obtain an encryption key corresponding to the process group in which the first application module is located according to the identifier of the process group in which the first application module is located.
  • a third aspect a terminal, comprising: a processor, a memory and a touch screen, the memory, the touch screen being coupled to the processor, the memory for storing the computer program code, the computer program code comprising computer instructions, and the terminal executing when the processor executes the computer instruction A method of data processing in a possible design method of any of the first aspects.
  • a fourth aspect a computer storage medium comprising computer instructions for causing a terminal to perform a method of data processing of a possible design method of any of the first aspects when the computer instructions are run on the terminal.
  • a fifth aspect a computer program product, when a computer program product is run on a computer, causing the computer to perform a method of data processing of a possible design method of any of the first aspects.
  • FIG. 1 is a schematic structural diagram of hardware of a terminal provided by the present application.
  • FIG. 2 is a schematic flowchart 1 of a data processing method provided by the present application.
  • FIG. 3 is a schematic diagram of a storage space of a process provided by the present application.
  • FIG. 4 is a schematic flowchart 2 of a data processing method provided by the present application.
  • FIG. 5 is a schematic flowchart 3 of a data processing method provided by the present application.
  • FIG. 6 is a schematic structural diagram of software of a terminal provided by the present application.
  • FIG. 7 is a schematic flowchart 4 of a data processing method provided by the present application.
  • FIG. 8 is a schematic flowchart 5 of a data processing method provided by the present application.
  • FIG. 9 is a schematic flowchart 6 of a data processing method provided by the present application.
  • FIG. 10 is a schematic flowchart 7 of a data processing method provided by the present application.
  • FIG. 11 is a schematic flowchart 8 of a data processing method provided by the present application.
  • FIG. 12 is a schematic diagram 1 of a composition of a terminal provided by the present application.
  • FIG. 13 is a schematic diagram 2 of a composition of a terminal provided by the present application.
  • first and second are used for descriptive purposes only, and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining “first” and “second” may include one or more of the features either explicitly or implicitly. In the description of the present application, "a plurality” means two or more unless otherwise stated.
  • each application When the terminal installs the application, each application is assigned a unique user identifier (UID) or Process Identifier (PID) and is permanently maintained.
  • a binder mechanism is used when communicating between different applications.
  • the Binder mechanism is based on the client/server (C/S) architecture. Specifically, the accessed application is used as a service (Sever) end, and the accessed application is used as a client (Client). The client sends the accessed task to the server. The server controls the policy according to the permission. The UID/PID determines whether the client meets the access rights. Only the client that has applied for a specific permission can access the server.
  • Permissions are divided into installation permissions and dynamic permissions.
  • Installation permission means that when the application is first installed, all the permissions involved in the entire application will be asked once, for example: Android 6.0, also known as Android M, previous versions of Android.
  • Dynamic permissions are in the process of running the application, which permission is required to ask the user whether to give the corresponding permissions, for example: Android M and later versions of Android.
  • the present application provides a method of data processing, by which an application installed on a terminal is grouped, and an application in the same group encrypts key data using the same key at runtime. In this way, the encrypted data of the application in the same group can only be decrypted by other applications in the group. Then, even if the malicious application obtains the access right of the application, since the encrypted data cannot be decrypted because it is not in the same group, the data security of the user is guaranteed.
  • the terminal in the present application may be a mobile phone (such as the mobile phone 100 shown in FIG. 1), a tablet computer, a personal computer (PC), a personal digital assistant (personal), which can install an application and display an application icon.
  • Digital assistant (PDA) smart watch, netbook, wearable electronic device, Augmented Reality (AR) device, Virtual Reality (VR) device, etc.
  • the application does not impose any special restrictions on the specific form of the terminal. .
  • the mobile phone 100 is used as the terminal example.
  • the mobile phone 100 may specifically include:
  • the processor 101 is a control center of the mobile phone 100, and connects various parts of the mobile phone 100 by using various interfaces and lines, and executes the mobile phone 100 by running or executing an application stored in the memory 103 and calling data stored in the memory 103.
  • the processor 101 may include one or more processing units; for example, the processor 101 may be a Kirin 960 chip manufactured by Huawei Technologies Co., Ltd.
  • the radio frequency circuit 102 can be used to receive and transmit wireless signals during transmission or reception of information or calls.
  • the radio frequency circuit 102 can process the downlink data of the base station and then process it to the processor 101; in addition, transmit the data related to the uplink to the base station.
  • radio frequency circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
  • the radio frequency circuit 102 can also communicate with other devices through wireless communication.
  • the wireless communication can use any communication standard or protocol, including but not limited to global mobile communication systems, general packet radio services, code division multiple access, wideband code division multiple access, long term evolution, email, short message service, and the like.
  • the memory 103 is used to store applications and data, and the processor 101 executes various functions and data processing of the mobile phone 100 by running applications and data stored in the memory 103.
  • the memory 103 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.); the storage data area can be stored according to the use of the mobile phone. Data created at 100 o'clock (such as audio data, phone book, etc.).
  • the memory 103 may include a high speed random access memory (RAM), and may also include a nonvolatile memory such as a magnetic disk storage device, a flash memory device, or other volatile solid state storage device.
  • the memory 103 can store various operating systems, for example, developed by Apple. Operating system, developed by Google Inc. Operating system, etc.
  • the above memory 103 may be independent and connected to the processor 101 via the above communication bus; the memory 103 may also be integrated with the processor 101.
  • the touch screen 104 may specifically include a touch panel 104-1 and a display 104-2.
  • the touch panel 104-1 can collect touch events on or near the user of the mobile phone 100 (for example, the user uses any suitable object such as a finger, a stylus, or the like on the touch panel 104-1 or on the touchpad 104.
  • the operation near -1), and the collected touch information is sent to other devices (for example, processor 101).
  • the touch event of the user in the vicinity of the touch panel 104-1 may be referred to as a hovering touch; the hovering touch may mean that the user does not need to directly touch the touchpad in order to select, move or drag a target (eg, an icon, etc.) , and only the user is located near the device to perform the desired function.
  • the touch panel 104-1 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • a display (also referred to as display) 104-2 can be used to display information entered by the user or information provided to the user as well as various menus of the mobile phone 100.
  • the display 104-2 can be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the touchpad 104-1 can be overlaid on the display 104-2, and when the touchpad 104-1 detects a touch event on or near it, it is transmitted to the processor 101 to determine the type of touch event, and then the processor 101 may provide a corresponding visual output on display 104-2 depending on the type of touch event.
  • the touchpad 104-1 and the display 104-2 are implemented as two separate components to implement the input and output functions of the handset 100, in some embodiments, the touchpad 104- 1 is integrated with the display screen 104-2 to implement the input and output functions of the mobile phone 100. It is to be understood that the touch screen 104 is formed by stacking a plurality of layers of materials. In the embodiment of the present application, only the touch panel (layer) and the display screen (layer) are shown, and other layers are not described in the embodiment of the present application. .
  • the touch panel 104-1 may be disposed on the front surface of the mobile phone 100 in the form of a full-board
  • the display screen 104-2 may also be disposed on the front surface of the mobile phone 100 in the form of a full-board, so that the front of the mobile phone can be borderless. Structure.
  • the mobile phone 100 can also have a fingerprint recognition function.
  • the fingerprint reader 112 can be configured on the back of the handset 100 (eg, below the rear camera) or on the front side of the handset 100 (eg, below the touch screen 104).
  • the fingerprint collection device 112 can be configured in the touch screen 104 to implement the fingerprint recognition function, that is, the fingerprint collection device 112 can be integrated with the touch screen 104 to implement the fingerprint recognition function of the mobile phone 100.
  • the fingerprint capture device 112 is disposed in the touch screen 104 and may be part of the touch screen 104 or may be otherwise disposed in the touch screen 104.
  • the main component of the fingerprint collection device 112 in the embodiment of the present application is a fingerprint sensor, which can employ any type of sensing technology, including but not limited to optical, capacitive, piezoelectric or ultrasonic sensing technologies.
  • the mobile phone 100 may also include a Bluetooth device 105 for enabling data exchange between the handset 100 and other short-range devices (eg, mobile phones, smart watches, etc.).
  • a Bluetooth device 105 for enabling data exchange between the handset 100 and other short-range devices (eg, mobile phones, smart watches, etc.).
  • the handset 100 can also include at least one type of sensor 106, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display of the touch screen 104 according to the brightness of the ambient light, and the proximity sensor may turn off the power of the display when the mobile phone 100 moves to the ear.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.
  • the mobile phone 100 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
  • the WiFi device 107 is configured to provide the mobile phone 100 with network access complying with the WiFi-related standard protocol, and the mobile phone 100 can access the WiFi access point through the WiFi device 107, thereby helping the user to send and receive emails, browse web pages, and access streaming media. It provides users with wireless broadband Internet access.
  • the WiFi device 107 can also function as a WiFi wireless access point, and can provide WiFi network access for other devices.
  • the positioning device 108 is configured to provide a geographic location for the mobile phone 100. It can be understood that the positioning device 108 can be specifically a receiver of a positioning system such as a Global Positioning System (GPS) or a Beidou satellite navigation system, or a Russian GLONASS. After receiving the geographical location transmitted by the positioning system, the positioning device 108 sends the information to the processor 101 for processing, or sends it to the memory 103 for storage. In some other embodiments, the positioning device 108 can also be a receiver of an Assisted Global Positioning System (AGPS), which assists the positioning device 108 in performing ranging and positioning services by acting as an auxiliary server.
  • AGPS Assisted Global Positioning System
  • the secondary location server provides location assistance over a wireless communication network in communication with a location device 108 (i.e., a GPS receiver) of the device, such as handset 100.
  • a location device 108 i.e., a GPS receiver
  • the positioning device 108 can also be a WiFi access point based positioning technology. Since each WiFi access point has a globally unique (Media Access Control, MAC) address, the device can scan and collect the broadcast signal of the surrounding WiFi access point when the WiFi is turned on, so that the WiFi connection can be obtained.
  • MAC Media Access Control
  • the MAC address broadcasted by the inbound point the device sends the data (such as the MAC address) capable of indicating the WiFi access point to the location server through the wireless communication network, and the location server retrieves the geographical location of each WiFi access point and combines The strength of the WiFi broadcast signal is calculated, and the geographic location of the device is calculated and sent to the location device 108 of the device.
  • the data such as the MAC address
  • the location server retrieves the geographical location of each WiFi access point and combines
  • the strength of the WiFi broadcast signal is calculated, and the geographic location of the device is calculated and sent to the location device 108 of the device.
  • the audio circuit 109, the speaker 113, and the microphone 114 can provide an audio interface between the user and the handset 100.
  • the audio circuit 109 can transmit the converted electrical data of the received audio data to the speaker 113 for conversion to the sound signal output by the speaker 113; on the other hand, the microphone 114 converts the collected sound signal into an electrical signal by the audio circuit 109. After receiving, it is converted into audio data, and then the audio data is output to the RF circuit 102 for transmission to, for example, another mobile phone, or the audio data is output to the memory 103 for further processing.
  • the peripheral interface 110 is used to provide various interfaces for external input/output devices (such as a keyboard, a mouse, an external display, an external memory, a subscriber identity module card, etc.). For example, it is connected to the mouse through a Universal Serial Bus (USB) interface, and is connected to a Subscriber Identification Module (SIM) card provided by the service provider through a metal contact on the card slot of the subscriber identity module. . Peripheral interface 110 can be used to couple the external input/output peripherals described above to processor 101 and memory 103.
  • USB Universal Serial Bus
  • SIM Subscriber Identification Module
  • the mobile phone 100 may further include a power supply device 111 (such as a battery and a power management chip) that supplies power to the various components.
  • the battery may be logically connected to the processor 101 through the power management chip to manage charging, discharging, and power management through the power supply device 111. And other functions.
  • the mobile phone 100 may further include a camera (front camera and/or rear camera), a flash, a micro projection device, a near field communication (NFC) device, and the like, and details are not described herein.
  • a camera front camera and/or rear camera
  • a flash a flash
  • micro projection device a micro projection device
  • NFC near field communication
  • a flow chart of a data processing method provided by the present application includes an encryption process for data, the method being applicable to a terminal, where the terminal runs a first application process and a key management process, The method specifically includes:
  • the first application process generates first data.
  • the first application process is one of the processes running by the first application, and the first application may be any application on the terminal, and is a program and a data set that can perform certain business functions, for example, a short message application, a US group application, Taobao applications, etc.
  • the first data may be data that needs to be encrypted, for example, data determined according to the first application process or the service nature of the first application, for example, may be important in the first application process or the first application, Critical, sensitive data.
  • the first application is a short message application
  • the first data may be information such as an account number, a password, a verification code, and a short message content.
  • the first data may be the entire short message content including the key data, or may be part of the content of the short message content, and only the key data, which is not limited in the embodiment of the present application. If the first data is such data that needs to be encrypted, the first application process needs to request the key management module to encrypt the first data, that is, step S102 is performed.
  • the first data may be data that does not need to be encrypted, for example, determining data that does not need to be encrypted according to the service nature of the first application process or the first application, and the first application process directly stores the first data. , that is, no need to perform the following steps.
  • the first application process requests the key management module to encrypt the first data, where the request message carries the first data.
  • the key management module is mainly used to perform encryption and decryption processes on specific data in each application process, and to create and manage encryption and decryption keys of each packet.
  • the key management module When the key management module is running, it can also be called a key management process.
  • the key management module encrypts the first data to generate second data.
  • the key management module when the key management module is invoked by the first application process, the binder-based inter-process communication mechanism is known, and the key management module can obtain the identifier of the caller, that is, the identifier of the first application process.
  • the identifier of the first application process may be the PID of the first application process or the UID of the first application.
  • the key management module may determine, according to the identifier of the first application process, the packet corresponding to the first application process, and obtain the identifier of the packet corresponding to the first application process.
  • the encryption key corresponding to the first application process is obtained according to the identifier of the packet corresponding to the first application process.
  • the key management module encrypts the first data according to the obtained encryption key to obtain the second data.
  • the second data is the data encrypted by the first data, and is a ciphertext.
  • the first application process may correspond to one packet, and the one packet corresponds to one encryption key, and then the first application process corresponds to one encryption key.
  • the key management module encrypts the first data using the one encryption key.
  • the first application process may also correspond to multiple packets, and the multiple packets correspond to multiple encryption keys, and then the first application process corresponds to multiple encryption keys.
  • the key management module encrypts the first data using the plurality of encryption keys.
  • the embodiment of the present application is not limited.
  • grouping here may also be referred to as a process grouping.
  • One or more processes running in the terminal may be grouped into one or more processes.
  • the one or more process packets respectively correspond to one or more encryption keys.
  • an application process running on a terminal can be divided into three process groups, namely, process group A, process group B, and process group C.
  • the process packet A, the process packet B, and the process packet C may respectively correspond to different encryption keys, or the process packet A and the process packet B may correspond to one same encryption key, and the process packet C corresponds to another different encryption key.
  • process group A, process group B, and process group C respectively correspond to one and the same encryption key.
  • the correspondence between the process grouping and the encryption key is not limited in the embodiment of the present application.
  • the key management module sends the second data to the first application process.
  • the first application process saves the second data.
  • the first application process saves the second data in an encrypted storage area in the first application process.
  • the encrypted storage area is a specific storage space in the first application process, and is dedicated to storing data encrypted by the key management module.
  • FIG. 3 is a spatial schematic diagram of a first application process.
  • the space of the first application process includes: a stack, a heap, a BBS (Block Started by Symbol) segment, a data segment segment, and a code segment (code/text segment).
  • BBS Block Started by Symbol
  • the BBS segment, the data segment and the code segment are static memory allocations, which are used to store code, global variables and static variables, and have a fixed effect.
  • the stack is automatically allocated and freed by the operating system to store local variables of the first application process, and can also be used to pass parameters and return values.
  • the heap is allocated and released by the first application process, and is used to store a dynamically allocated memory space segment in the first application process.
  • the first application process may allocate a memory space in the heap for the first time to store the data encrypted by the key encryption module, that is, the encrypted storage area.
  • the first application process in the running process, first determines a packet corresponding to the first application process, and then obtains an encryption key corresponding to the packet, and uses the encryption key to data of the first application process. Encryption and storage in a specific encrypted storage area helps to improve the security of critical data for the application.
  • FIG. 4 a flowchart of a method for data processing according to an embodiment of the present application, where the method includes a process for decrypting data, specifically includes:
  • the second application process requests the first application process to access the third data of the first application process.
  • the second application process may be another process in the first application, different from the first application process, the second application process may also be a process in the second application, and the second application is different from the second application. .
  • the second application process needs to obtain permission to access the first application process in advance, as shown in S201a. Specifically, the second application process sends a request for applying for access rights to the first application process, and the first application process authorizes the second application process. It is also possible that the first application process directly authorizes the second application process, and allows the second application process to access data of the first application process. It is also possible that the first application process defaults that the second application process has the right to access the first application process, which is not limited in this embodiment.
  • the second application process can read the data of the first application process, including the third data.
  • the second application process can read all the data in the first application process, and can also read the data associated with the second application process, which is not limited in this embodiment.
  • the first application process is a process in the short message application
  • the second application process is a process in the US group application
  • the US group application has the access right of the short message application.
  • the US group application can read all the SMS content in the SMS application, or the US group application can read the SMS content associated with the US group application in the SMS application, for example, the verification of the US group application sent to the SMS application. Code information, etc.
  • the first application process determines that the third data is stored in the encrypted storage area.
  • the first application process determines, according to the index corresponding to the third data, whether the third data is stored in the encrypted storage area. If the third data is not stored in the encrypted storage area, the third data is plaintext, and the first application process sends the third data to the second application process. If the third data is stored in the encrypted storage area, the third data is cipher text, and the first application process further needs to decrypt the third data, that is, step S203 is performed.
  • the first application process requests the key management module to decrypt the third data, where the request carries the identifier of the second application process and the third data.
  • the first application process may obtain the identifier of the calling program, that is, the identifier of the second application process.
  • the key management module determines, according to the identifier of the second application process, whether the second application process is a packet corresponding to the first application process, and if yes, executing S205; otherwise, the key management module does not decrypt the third data. Return the third data directly.
  • the key management module may obtain the identifier of the caller, that is, the identifier of the first application process.
  • the key management module may determine, according to the identifier of the first application process, a packet corresponding to the first application process, and an identifier of the application included in the packet. Further, the key management module may determine, according to the identifier of the second application process, whether the second application process is in the packet. If the second application process is in the group, the key management module decrypts the third data, that is, step S205 is performed. If the second application process is not in the packet, the key management module does not decrypt the third data, and directly returns the third data to the first application process. If the second application process is not in the packet, the key management module may directly reject the decryption request of the first application process for the third data, and end the process.
  • the second application process accesses the first application process, even if the second application process has access rights, the second application process and the first application process do not belong to the same group, and the second application process cannot obtain the same.
  • the first application process stores the plaintext of the data in the encrypted storage area. In this way, if the second application process is a malicious program, even if the user is authorized to access the first application process to access the first application process, the second application process cannot obtain the data encrypted by the first application process, thereby improving the first application process. Encrypted data security.
  • the key management module decrypts the third data to obtain fourth data.
  • the key management module acquires a decryption key corresponding to the packet according to the packet corresponding to the first application process.
  • the third data is decrypted by using the obtained decryption key to obtain fourth data.
  • the fourth data is data after the third data is decrypted, and is plaintext.
  • the first application process may correspond to one packet, and the one packet corresponds to one decryption key, and then the first application process corresponds to one decryption key.
  • the key management module decrypts the third data using the one decryption key.
  • the first application process may also correspond to multiple packets, and each of the multiple packets corresponds to a decryption key, and the first application process corresponds to multiple decryption keys.
  • the key management module decrypts the third data using the plurality of decryption keys.
  • the embodiment of the present application is not limited.
  • the key management module sends fourth data to the first application process.
  • the first application process sends fourth data to the second application process.
  • the first application process when the second application process needs to access the encrypted data of the first application process, the first application process is required to apply for the key management module to decrypt the encrypted data.
  • the key management module needs to first determine whether the second application process is in a corresponding group of the first application process, and if so, decrypt the encrypted data and return the decrypted data to the first application process. Therefore, the second application process can directly read the data of the first application process after obtaining the permission to access the first application process, and improve the security of the data of the first application process.
  • the second application process may apply to the key management module to decrypt the third data by using the first application process.
  • the second application process may also directly apply to the key management module to decrypt the third data, that is, steps S202 to S207 may be replaced with steps S301 to S305.
  • FIG. 5 it is a flowchart of a data processing method provided by an embodiment of the present application, where the method includes steps S201 and S301 to S305, as follows:
  • the first application process returns third data to the second application process.
  • the third data is stored in the encrypted storage area of the first application process, the third data is cipher text, and the first application process needs to decrypt the third data, that is, step S302 is performed. If the third data is stored in the non-encrypted storage area of the first application process, the third data is plaintext, that is, the data to be finally acquired by the first application process.
  • the second application process requests the key management module to decrypt the third data, where the request carries the third data and the identifier of the first application process.
  • the second application process may obtain the identifier of the caller, that is, the identifier of the first application process.
  • the key management module determines, according to whether the second application process is a packet corresponding to the first application process. If yes, execute S304; otherwise, the key management module does not decrypt the third data, and directly returns the third data to the first application process.
  • the key management module may also obtain the identifier of the second application process. Then, the key management module determines, according to the identifier of the first application process carried in the request, the packet corresponding to the first application process and the identifier of the application process included in the packet. Further, the key management module may determine whether the second application process is in the packet according to the identifier of the second application process. If the second application process is in the group, the key management module decrypts the third data, that is, step S304 is performed. If the second application process is not in the packet, the key management module does not decrypt the third data, and directly returns the third data to the first application process. If the second application process is not in the packet, the key management module may directly reject the decryption request of the second application process for the third data, and end the process.
  • the key management module decrypts the third data to obtain fourth data.
  • This step can refer to step S205, and details are not repeatedly described.
  • the key management module sends fourth data to the second application process.
  • the second application process may apply to the key management module to decrypt the encrypted data.
  • the key management module needs to first determine whether the second application process is in a corresponding group of the first application process, and if so, decrypt the encrypted data and return the decrypted data to the first application process. Therefore, the second application process can directly read the data of the first application process after obtaining the permission to access the first application process, and improve the security of the data of the first application process.
  • FIG. 6 it is a schematic diagram of a composition of a terminal provided by an embodiment of the present application.
  • the terminal includes multiple application processes 601 - 604 , a key management module 605 , and a secure storage module 606 .
  • the terminal groups the multiple application processes, and the application processes in the same group use the same key to encrypt and decrypt specific data, that is, the application processes in the same group can access specific data.
  • the grouping method will be specifically described below.
  • the application process 601 and the application process 602 are processes of the first group.
  • Application process 603 and application process 604 are processes of the second group.
  • the key management module 605 is configured to perform an encryption and decryption process on specific data in each application process, and an encryption and decryption key and the like for creating and managing each packet. Specifically, the key management module 605 further includes a packet management module 60501 and an encryption module 60502.
  • the group management module 60501 is configured to group the application process according to the grouping policy.
  • the group management module 60502 can automatically generate a grouping policy, and can also receive the user's settings and update the grouping policy. The present application does not limit the grouping policy.
  • the packet management module 60502 can also request the encryption module 60502 to create a key for the packet, establish a correspondence between the application and the packet, and/or the key, and the like.
  • the encryption module 60502 is configured to create a new key pair for the packet, encrypt and decrypt the data of the application process, and the like.
  • the security storage module 606 is configured to store the encrypted and decrypted key generated by the key management module 605 to ensure the security of the key storage.
  • the terminal can group the application processes according to the source of the application corresponding to the application process, the service type, and the like.
  • the grouping strategy can be grouped according to the download source of the application.
  • the applications downloaded from the application market in the terminal because the applications are reviewed by the shelves, can be regarded as trusted applications, and can be divided into one group. Downloaded from other methods, not downloaded through the application market, can be considered as an untrusted application that can be divided into another group.
  • the grouping policy may also be grouped according to the specific service type of the application. Specifically, when the applications downloaded from the application market are on the shelves, the application market will classify these applications, such as: office, shopping, social, entertainment, news, and so on. Then, the application can be grouped according to the classification, for example, the application of the same type is divided into one group, or the application of several types is divided into one group, which is not limited in the embodiment of the present application.
  • the application market also sends the source information and service type of the application to the terminal, so that the terminal groups the information according to the information, or the application market sends the classified information of the application to the application.
  • Figure 7 it is a schematic diagram of the process of publishing, reviewing, sorting, and downloading applications.
  • the application developer or user when the application developer or user discovers that the application has malicious behavior, it can be reported to the application market, and the application market is re-reviewed and re-grouped. As shown in Figure 8, the application is re-reviewed for the process flow.
  • the grouping policy may also be to specify that certain applications are divided into one group according to the user's settings.
  • the grouping policy may also be a combination of the above various grouping policies, which is not limited in the embodiment of the present application.
  • the terminal groups each application according to the grouping policy and determines a key for each group.
  • the terminal groups each application according to the grouping policy and determines a key for each group.
  • FIG. 9 a schematic flowchart of a method for data processing according to an embodiment of the present application, where the method specifically includes:
  • the terminal After detecting that the third application is installed, the terminal notifies the group management module to group the third application process corresponding to the third application.
  • the third application is a new application that the terminal needs to install, and the third application is different from the first application and the second application.
  • the terminal may also notify the group management module after detecting that the user requests to install the third application, which is not limited in the embodiment of the present application.
  • a terminal-preferred application such as a short message application, a photography application, a browser application, and the like.
  • These applications can be installed by the system trigger terminal when the terminal is first turned on.
  • the other type is downloaded and installed by the user himself, for example, the US group application, the Alipay application, etc., which are triggered by the user's operation to install the terminal.
  • the terminal can notify the group management module after the application is installed or after the installation is started.
  • the packet management module groups the third application process according to the grouping policy.
  • the group management determines the packet corresponding to the third application process according to the service type of the third application process, or the download source, and associates the identifier of the third application process with the group identifier, and saves the local.
  • the packet management module requests the encryption module to create a new packet key pair for the packet, that is, step S403 is performed. If the third application process is not the first installed application in the group, the group management module directly establishes a correspondence between the third application process and the packet and the key, that is, step S406 is performed.
  • the third application process is a US group application
  • the group corresponding to the third application process is a shopping group. Then, when the installation of the Meituan application is completed, or when the terminal receives the user request to install the Meituan application, the packet management module is notified.
  • the group management module divides the group application into a shopping group. If the group application is the first installed application within the shopping group, the group management module requests the encryption module to create a key pair for the shopping group. If the group application is not the first application installed in the shopping group, the group management module directly associates the group application with the key of the shopping group and the shopping group.
  • the packet management module sends a request to the encryption module to create a key pair for the packet corresponding to the third application process.
  • the request carries the identifier of the packet corresponding to the third application process.
  • the encryption module creates a key pair for the packet corresponding to the third application process.
  • the encryption module stores the created key pair in a secure storage module.
  • the secure storage module may include a keystore and a keymaster.
  • the keystore is used to store an index of a key pair, and is used to provide an interface for other applications to use a key pair.
  • the keymaster is used to store the contents of the key pair and encrypt and decrypt the data.
  • the encryption module can store the created key pair in the keymaster through the keystore. Since the keymaster is physically isolated from the keystore, the security of the key pair can be improved.
  • the encryption module returns information of the created key pair to the group management module.
  • the information of the key pair may include a correspondence between the group identifier and the index of the key pair.
  • the encryption module may return the correspondence between the packet identifier and the index of the key pair to the packet management module.
  • the corresponding encryption key can be found from the secure storage module according to the index of the key pair, and the encrypted key is used for encryption.
  • the corresponding decryption key can be found from the secure storage module according to the index of the key pair, and the decrypted secret key is used for decryption.
  • the step S405 can also be performed before or at the same time as S404.
  • the embodiment of the present application does not limit the order relationship between the steps S404 and S405.
  • the packet management module associates the third application process with the packet and the key pair.
  • the group management module establishes the identifier and grouping of the third application process according to the correspondence between the packet identifier and the key pair index returned by the encryption module, and the correspondence between the identifier of the third application process and the group identifier that are already existing in the local device.
  • the correspondence between the identifier and the key pair index is a registered trademark of the group management module.
  • the packet management module needs to update the correspondence between the application and the packet and the key pair.
  • a malicious application can be removed from the packet and switched to another packet, and the malicious application is no longer allowed to access data of other applications in the packet.
  • the malicious application can be removed from the packet and switched to another packet, and the malicious application is no longer allowed to access data of other applications in the packet.
  • an application may not need to be within a certain group, and may also be removed from the group and switched to another group.
  • the embodiment of the present application provides a data processing method, which can group an application, create a key pair for the packet, and establish a correspondence between the application and the packet and the key pair, thereby enabling the same packet to be implemented.
  • the application uses the same key for encryption and decryption.
  • the steps S102 to S104 are refined. Then, the steps S102 to S104 can be replaced with S501 to S507.
  • the data processing method provided by the embodiment of the present application further includes:
  • the packet management module receives the first data sent by the first application process.
  • the group management module is invoked by the first application process, and the group management module can obtain the identifier of the first application process.
  • the packet management module acquires an index of an encryption key or a key pair corresponding to the first application process according to the identifier of the first application process.
  • the group management module searches for the group identifier corresponding to the identifier of the first application process according to the identifier of the first application process, and further determines an index of the encryption key or the key pair corresponding to the group identifier according to the group identifier.
  • the index of the found encryption key or key pair corresponds to the encryption key or key pair corresponding to the first application process.
  • the packet management module sends the first data and the obtained encryption key or an index of the key pair to the encryption module.
  • the encryption module reads the encryption key corresponding to the first application process from the secure storage module according to the encryption key or the index of the key pair.
  • the encryption module encrypts the first data according to the obtained encryption key to obtain the second data.
  • the cryptographic module sends the obtained second data to the packet management module.
  • the packet management module sends the second data to the first application process.
  • the steps S203 to S206 are performed in the process of decrypting the data. Then, the steps S203 to S206 can be replaced with S601 to S607. As shown in FIG. 11, the data processing method provided by the embodiment of the present application further includes:
  • the first application process requests the packet management module to decrypt the third data, where the request carries the identifier of the second application process and the third data.
  • the first application process may obtain the identifier of the calling program, that is, the identifier of the second application process.
  • the packet management module determines, according to the identifier of the second application process, whether the second application process is in a packet corresponding to the first application process. If yes, step S603 is performed. Otherwise, the packet management module does not request the encryption module to decrypt the third data, but directly returns the third data to the first application process.
  • the group management module may obtain the identifier of the caller, that is, the identifier of the first application process.
  • the packet management module may determine, according to the identifier of the first application process, a packet corresponding to the first application process and an identifier of the application included in the packet. Further, the packet management module may determine, according to the identifier of the second application process, whether the second application process is in the packet. If the second application process is in the group, the packet management module requests the encryption module to decrypt the third data, that is, step S603 is performed. If the second application process is not in the packet, the packet management module does not request the encryption module to decrypt the third data, but directly returns the third data to the first application process, and the first application process returns the third application process to the second application process. data.
  • the packet management module acquires an index of a decryption key or a key pair corresponding to the first application process according to the identifier of the first application process.
  • the group management module searches for the group identifier corresponding to the identifier of the first application process according to the identifier of the first application process, and further determines an index of the decryption key or the key pair corresponding to the group identifier according to the group identifier.
  • the index of the decrypted key or key pair found corresponds to the encryption key or key pair corresponding to the first application process.
  • the packet management module sends the third data and the obtained decryption key or an index of the key pair to the encryption module.
  • the encryption module reads the decryption key corresponding to the first application process from the secure storage module according to the decryption key or the index of the key pair.
  • the encryption module decrypts the third data according to the obtained decryption key to obtain fourth data.
  • the fourth data is data after the third data is decrypted, and is plaintext.
  • the encryption module sends the obtained fourth data to the packet management module.
  • the packet management module sends the fourth data to the first application process.
  • the above terminal and the like include hardware structures and/or software modules corresponding to each function.
  • the embodiments of the present application can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the embodiments of the invention.
  • the embodiment of the present application may perform the division of the function modules on the terminal or the like according to the foregoing method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • FIG. 12 shows a possible structural diagram of the terminal involved in the above embodiment in the case where the respective functional modules are divided by corresponding functions.
  • the terminal 1200 includes a first application module 1201, a second application module 1202, and a key management module 1203.
  • the first application module 1201 is configured to support the terminal to execute S101, S102, and S105 in FIG. 2, S202, S203, and S207 in FIG. 4, S302 in FIG. 5, S501 in FIG. 10, and S601 in FIG. And/or other processes for the techniques described herein.
  • the second application module 1202 is for supporting the terminal to perform S201a and S201 in FIG. 4, and/or other processes for the techniques described herein.
  • the key management module 1203 is configured to support the terminal to execute S103 and S104 in FIG. 2, S204-S206 in FIG. 4, S303-S305 in FIG. 5, S402-S406 in FIG. 9, and S502-S507 in FIG. S602-S608 in Figure 11, and/or other processes for the techniques described herein.
  • the terminal 1200 may further include a secure storage unit 1204 for storing group information, an encryption key, a decryption key, and the like in the present application.
  • the terminal 1200 may further include a communication unit for the terminal to interact with other devices.
  • the specific functions that can be implemented by the foregoing functional units include, but are not limited to, the functions corresponding to the method steps described in the foregoing examples.
  • the first application module 1201, the second application module 1202, and the key management module 1203 may be integrated together, and may be a processing module of the terminal.
  • the communication unit described above may be a communication module of the terminal, such as an RF circuit, a WiFi module, or a Bluetooth module.
  • the above secure storage unit may be a storage module of the terminal.
  • FIG. 13 is a schematic diagram showing a possible structure of a terminal involved in the above embodiment.
  • the terminal 1300 includes: a processing module 1301, a storage module 1302, and a communication module 1303.
  • the processing module 1301 is configured to control and manage the actions of the terminal.
  • the storage module 1302 is configured to save program codes and data of the terminal.
  • the communication module 1303 is for communicating with other terminals.
  • the processing module 1301 may be a processor or a controller, and may be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), and an application-specific integrated circuit (Application-Specific).
  • CPU central processing unit
  • DSP digital signal processor
  • Application-Specific Application-Specific
  • the processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like.
  • the communication module 1303 may be a transceiver, a transceiver circuit, a communication interface, or the like.
  • the storage module 1302 can be a memory.
  • the processing module 1301 is a processor (such as the processor 101 shown in FIG. 1)
  • the communication module 1303 is an RF transceiver circuit (such as the RF circuit 102 shown in FIG. 1)
  • the storage module 1302 is a memory (as shown in FIG. 1).
  • the terminal provided by the embodiment of the present application may be the terminal 100 shown in FIG. 1.
  • the communication module 1303 may include not only an RF circuit but also a WiFi module and a Bluetooth module. Communication modules such as RF circuits, WiFi modules, and Bluetooth modules can be collectively referred to as communication interfaces. Wherein, the above processor, communication interface and memory can be coupled together by a bus.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a flash memory, a mobile hard disk, a read only memory, a random access memory, a magnetic disk, or an optical disk, and the like, which can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)
  • Storage Device Security (AREA)

Abstract

The present application relates to the technical field of communications and provides a data processing method and a terminal, for improving the security of data in an application in a terminal. The method is applied to the terminal, and a first application process, a second application process, and a key management process run on the terminal. The method specifically comprises: the second application process sends an access request to the first application process, the access request being used for requesting access to third data of the first application process; the key management process receives a decryption request for requesting decrypting the third data; the key management process determines whether the second application process is in a process group where the first application process is according to the decryption request, if yes, the key management process uses a decryption key corresponding to the process group for decrypting the third data to obtain fourth data, and returns to the fourth data, and if not, the key management process does not perform decryption, and returns the third data.

Description

分组应用使用同一密钥共享数据Grouped apps share data using the same key 技术领域Technical field
本申请涉及通信技术领域,尤其涉及一种数据处理的方法及终端。The present application relates to the field of communications technologies, and in particular, to a data processing method and terminal.
背景技术Background technique
终端上的各个应用程序都是运行在各自独立的进程空间中,各个进程的数据和功能是相互隔离的。若进程之间需要通信,则被访问进程需先对访问进程进行权限校验。若校验成功,表明该访问进程具有访问权限,则允许该访问进程进行访问。否则,表明该访问进程不具有访问权限,则不允许该访问进程进行访问。Each application on the terminal runs in its own separate process space, and the data and functions of each process are isolated from each other. If communication is required between processes, the accessed process must first perform permission checking on the access process. If the verification succeeds, indicating that the access process has access rights, the access process is allowed to access. Otherwise, it indicates that the access process does not have access rights, and the access process is not allowed to access.
可见,目前终端是通过权限机制来保证进程之间的通信安全。然而,在被访问进程授权的过程中,很容易出现误授权的情况。例如:用户可能会被诱导而安装了病毒应用,并对病毒应用进行了授权。那么,该病毒应用可以通过其他进程(被访问进程)的权限校验,即可以任意访问其他应用的数据,甚至是关键信息,这样会对用户造成危害。It can be seen that the current terminal uses a permission mechanism to ensure communication security between processes. However, in the process of being authorized by the access process, it is easy to cause a misauthorization. For example, a user may be induced to install a virus application and authorize a virus application. Then, the virus application can be verified by the permissions of other processes (accessed processes), that is, the data of other applications can be arbitrarily accessed, or even the key information, which may cause harm to the user.
发明内容Summary of the invention
本申请提供的一种数据处理的方法及终端,可以提高终端上应用进程中的数据安全性。The data processing method and terminal provided by the application can improve data security in an application process on the terminal.
第一方面,本申请提供的一种数据处理的方法,可应用于终端,该终端运行第一应用进程、第二应用进程和密钥管理进程。该方法具体包括:第二应用进程向第一应用进程发送访问请求,该访问请求用于请求访问所述第一应用进程的第三数据;密钥管理进程接收请求解密第三数据的解密请求;若密钥管理进程根据该解密请求确定第二应用进程在第一应用进程所在的进程分组内,则密钥管理进程使用第一应用进程所在的进程分组对应的解密密钥解密第三数据,得到第四数据;响应于该解密请求,密钥管理进程返回第四数据。In a first aspect, a data processing method provided by the present application is applicable to a terminal, where the terminal runs a first application process, a second application process, and a key management process. The method specifically includes: the second application process sending an access request to the first application process, the access request is used to request access to the third data of the first application process; and the key management process receives a decryption request requesting decryption of the third data; If the key management process determines that the second application process is in the process group in which the first application process is located, the key management process decrypts the third data by using the decryption key corresponding to the process group in which the first application process is located. Fourth data; in response to the decryption request, the key management process returns the fourth data.
其中,终端具有N个进程分组;N个进程分组中的每一个包含至少一个进程,并且至少有一个进程分组包含两个或两个以上的进程;其中,N为大于1或等于1的整数;N个进程分组对应M个解密密钥,且每一个进程分组对应一个解密密钥;其中,M为正整数,N>=M。Wherein the terminal has N process packets; each of the N process packets includes at least one process, and at least one process packet includes two or more processes; wherein N is an integer greater than 1 or equal to 1; N process packets correspond to M decryption keys, and each process packet corresponds to one decryption key; wherein M is a positive integer, N>=M.
其中,第一应用进程为第一应用程序运行的其中一个进程,而第一应用程序可以为终端上任一个应用,为可执行一定业务功能的程序和数据集合,例如:短信应用、美团应用、淘宝应用等。The first application process is one of the processes running by the first application, and the first application may be any application on the terminal, and is a program and a data set that can perform certain business functions, for example, a short message application, a US group application, Taobao applications, etc.
其中,第二应用进程可以为第一应用程序中另一个进程,不同于第一应用进程,第二应用进程也可以是第二应用程序中的一个进程,第二应用程序不同于第二应用程序。The second application process may be another process in the first application, different from the first application process, the second application process may also be a process in the second application, and the second application is different from the second application. .
一些实施例中,第二应用进程需预先获取访问第一应用进程的权限。In some embodiments, the second application process needs to obtain permission to access the first application process in advance.
一些实施例中,第一数据可以是需要加密的数据,例如是根据第一应用进程或者 第一应用程序的业务性质确定的数据,例如可以是第一应用进程或第一应用程序中重要的、关键的、敏感的数据。In some embodiments, the first data may be data that needs to be encrypted, for example, data determined according to the first application process or the service nature of the first application, for example, may be important in the first application process or the first application, Critical, sensitive data.
一些实施例中,密钥管理模块根据第三应用进程的业务类型、或下载来源等信息确定第三应用进程所对应的分组,并将第三应用进程的标识与该分组标识建立对应关系,并保存在本地。In some embodiments, the key management module determines, according to the service type of the third application process, or the download source, the packet corresponding to the third application process, and associates the identifier of the third application process with the group identifier, and Save it locally.
由此可见,第二应用进程和第一应用进程属于同一进程分组时,密钥管理进程使用第一应用进程所在的进程分组对应的解密密钥对第三数据进行解密,使得第二应用进程获取到解密后的第三数据,即第四数据。实现了第二应用进程和第一应用进程属于同一进程分组时,才能访问第一应用进程的数据,有利于提高第一应用进程中的数据安全。It can be seen that, when the second application process and the first application process belong to the same process group, the key management process decrypts the third data by using the decryption key corresponding to the process group in which the first application process is located, so that the second application process obtains The third data after decryption, that is, the fourth data. When the second application process and the first application process belong to the same process group, the data of the first application process can be accessed, which is beneficial to improving data security in the first application process.
在一种可能的设计中,密钥管理进程接收请求解密第三数据的解密请求具体为密钥管理进程接收第一应用进程根据访问请求发送的解密请求。密钥管理进程返回第四数据具体为:密钥管理进程向第一应用进程返回第四数据。第一应用进程向第二应用进程发送第四数据。In one possible design, the key management process receives a decryption request requesting decryption of the third data, specifically for the key management process to receive a decryption request sent by the first application process according to the access request. The key management process returns the fourth data specifically: the key management process returns the fourth data to the first application process. The first application process sends the fourth data to the second application process.
可见,终端可以是第二应用进程访问第一应用进程,由第一应用进程向密钥管理进程请求对第三数据进行解密。在密钥管理进程对第三数据进行解密后,可通过第一应用进程将解密后的第三数据,即第四数据发送给第二应用进程。由此,本申请实施例提供了一种第二应用进程访问第一应用进程第三数据的方法。It can be seen that the terminal may be the second application process accessing the first application process, and the first application process requests the key management process to decrypt the third data. After the third data is decrypted by the key management process, the decrypted third data, that is, the fourth data, may be sent to the second application process by using the first application process. Therefore, the embodiment of the present application provides a method for a second application process to access third data of a first application process.
在一种可能的设计中,若密钥管理进程确定第二应用进程不在第一应用进程所在的进程分组内,则密钥管理进程向第一应用进程发送第三数据;第一应用进程向第二应用进程发送所述第三数据。In a possible design, if the key management process determines that the second application process is not in the process group in which the first application process is located, the key management process sends the third data to the first application process; The second application process sends the third data.
可见,本申请实现了第二应用进程和第一应用进程不在同一进程分组时,密钥管理进程不对第三数据进行解密,通过第一应用进程将第三数据直接发送给第二应用进程,有利于包括第一应用进程的数据安全性。It can be seen that, when the second application process and the first application process are not in the same process grouping, the key management process does not decrypt the third data, and the third data is directly sent to the second application process by using the first application process. Conducive to including the data security of the first application process.
在一种可能的设计中,若第二应用进程不在分组中,则密钥管理模块也可以直接拒绝第一应用进程对第三数据的解密请求,结束流程。In a possible design, if the second application process is not in the packet, the key management module may directly reject the decryption request of the first application process for the third data, and end the process.
在一种可能的设计中,在第二应用进程向第一应用进程发送访问请求之后,密钥管理进程接收请求解密第三数据的解密请求之前,所述方法还包括:第二应用进程接收第一应用进程发送的第三数据;密钥管理进程接收请求解密第三数据的解密请求具体为:密钥管理进程接收第二应用进程发送的解密请求;密钥管理进程返回第四数据具体为:密钥管理进程向第二应用进程返回所述第四数据。In a possible design, after the second application process sends an access request to the first application process, and before the key management process receives the decryption request for decrypting the third data, the method further includes: receiving, by the second application process The third data sent by the application process; the decryption request received by the key management process to decrypt the third data is specifically: the key management process receives the decryption request sent by the second application process; and the key management process returns the fourth data specifically: The key management process returns the fourth data to the second application process.
可见,终端可以是第二应用进程访问第一应用进程的数据时,先获取到第一应用进程加密的数据,即第三数据,再由第二应用进程向密钥管理进程请求对第三数据进行解密。在密钥管理进程对第三数据进行解密后,可将解密后的第三数据,即第四数据发送给第二应用进程。由此,本申请实施例提供了一种第二应用进程访问第一应用进程第三数据的方法。It can be seen that, when the second application process accesses the data of the first application process, the terminal first acquires the data encrypted by the first application process, that is, the third data, and then the second application process requests the third data from the key management process. Decrypt. After the third data is decrypted by the key management process, the decrypted third data, that is, the fourth data, may be sent to the second application process. Therefore, the embodiment of the present application provides a method for a second application process to access third data of a first application process.
在一种可能的设计中,若密钥管理进程确定第二应用进程不在第一应用进程所在的进程分组内,则密钥管理进程向第二应用进程发送第三数据。In a possible design, if the key management process determines that the second application process is not in the process group in which the first application process is located, the key management process sends the third data to the second application process.
可见,本申请实现了第二应用进程和第一应用进程不在同一进程分组时,密钥管 理进程不对第三数据进行解密,直接将第三数据发送给第二应用进程,有利于包括第一应用进程的数据安全性。It can be seen that, when the second application process and the first application process are not in the same process grouping, the key management process does not decrypt the third data, and directly sends the third data to the second application process, which is beneficial to include the first application. The data security of the process.
在一种可能的设计中,在密钥管理进程使用第一应用进程所在的进程分组对应的解密密钥解密第三数据,得到第四数据之前,所述方法还包括:密钥管理进程获取第一应用进程的标识;密钥管理进程根据第一应用进程的标识,确定第一应用进程所在的进程分组的标识;密钥管理进程根据第一应用进程所在的进程分组的标识,获取第一应用进程所在的进程分组对应的解密密钥。In a possible design, before the key management process uses the decryption key corresponding to the process group in which the first application process is located to decrypt the third data to obtain the fourth data, the method further includes: the key management process obtains the first An identifier of an application process; the key management process determines an identifier of a process group in which the first application process is located according to the identifier of the first application process; the key management process acquires the first application according to the identifier of the process group in which the first application process is located The decryption key corresponding to the process group in which the process resides.
由此,本申请提供了一种终端获取第一应用进程所在的进程分组对应的解密密钥的方法。Therefore, the present application provides a method for a terminal to acquire a decryption key corresponding to a process group in which a first application process is located.
在一种可能的设计中,第一应用进程请求密钥管理进程对第一数据进行加密;密钥管理进程根据该请求确定第一应用进程所在的进程分组;密钥管理进程使用第一应用进程所在的进程分组对应的加密密钥对所述第一数据进行加密,生成第二数据;N个进程分组对应M个加密密钥,且每一个进程分组对应一个加密密钥;密钥管理进程向第一应用进程发送第二数据。In a possible design, the first application process requests the key management process to encrypt the first data; the key management process determines the process group in which the first application process is located according to the request; the key management process uses the first application process The encryption key corresponding to the process group is encrypted to encrypt the first data to generate second data; the N process packets correspond to M encryption keys, and each process group corresponds to one encryption key; the key management process is The first application process sends the second data.
由此,本申请实现了为同一进程分组中的应用进程使用相同的加密密钥进行加密的方法,有利于提升应用进程中的数据安全性。Therefore, the present application implements a method for encrypting an application process in the same process group by using the same encryption key, which is beneficial to improving data security in an application process.
在一种可能的设计中,第一应用进程保存第二数据。In one possible design, the first application process saves the second data.
一些实施例中,第一应用进程将第二数据保存在第一应用进程中的加密存储区。其中,加密存储区为第一应用进程中一片特定存储空间,专用于存储经过密钥管理模块加密后的数据。In some embodiments, the first application process saves the second data in an encrypted storage area in the first application process. The encrypted storage area is a specific storage space in the first application process, and is dedicated to storing data encrypted by the key management module.
在一种可能的设计中,密钥管理进程根据该请求确定第一应用进程所在的进程分组包括:密钥管理进程获取第一应用进程的标识;密钥管理进程根据第一应用进程的标识,确定第一应用进程所在的进程分组的标识;密钥管理进程根据第一应用进程所在的进程分组的标识,获取第一应用进程所在的进程分组对应的加密密钥。In a possible design, the key management process determines, according to the request, the process group in which the first application process is located: the key management process acquires the identifier of the first application process; and the key management process is based on the identifier of the first application process. The identifier of the process group in which the first application process is located is determined. The key management process obtains the encryption key corresponding to the process group in which the first application process is located according to the identifier of the process group in which the first application process is located.
第二方面,一种终端,包括第一应用程序模块、第二应用程序模块和密钥管理模块,第二应用程序模块,用于向第一应用程序模块发送访问请求,访问请求用于请求访问第一应用进程的第三数据;密钥管理模块,用于接收请求解密第三数据的解密请求;密钥管理模块,还用于若密钥管理模块根据解密请求确定第二应用进程在第一应用进程所在的进程分组内,则使用第一应用进程所在的进程分组对应的解密密钥解密所述第三数据,得到第四数据;密钥管理模块,还用于响应于解密请求,返回第四数据。In a second aspect, a terminal includes a first application module, a second application module, and a key management module, and a second application module, configured to send an access request to the first application module, where the access request is used to request access a third data of the first application process; a key management module, configured to receive a decryption request for decrypting the third data; and a key management module, configured to determine, according to the decryption request, that the second application process is first After the process group in which the application process is located, the third data is decrypted by using the decryption key corresponding to the process group in which the first application process is located, and the fourth data is obtained; the key management module is further configured to return to the first request in response to the decryption request. Four data.
其中,终端具有N个进程分组;N个进程分组中的每一个包含至少一个进程,并且至少有一个进程分组包含两个或两个以上的进程;其中,N为大于1或等于1的整数;N个进程分组对应M个解密密钥,且每一个进程分组对应一个解密密钥;其中,M为正整数,N>=M。Wherein the terminal has N process packets; each of the N process packets includes at least one process, and at least one process packet includes two or more processes; wherein N is an integer greater than 1 or equal to 1; N process packets correspond to M decryption keys, and each process packet corresponds to one decryption key; wherein M is a positive integer, N>=M.
一种可能的设计中,密钥管理模块,还用于接收第一应用程序模块根据访问请求发送的解密请求:密钥管理模块,还用于向第一应用程序模块返回第四数据;第一应用程序模块,用于向第二应用程序模块发送第四数据。In a possible design, the key management module is further configured to receive a decryption request sent by the first application module according to the access request: the key management module is further configured to return the fourth data to the first application module; An application module, configured to send fourth data to the second application module.
一种可能的设计中,密钥管理模块,还用于若密钥管理模块确定第二应用进程不 在第一进程所在的进程分组内,则向第一应用程序模块发送第三数据;第一应用程序模块,还用于向第二应用程序模块发送第三数据。In a possible design, the key management module is further configured to: if the key management module determines that the second application process is not in the process group in which the first process is located, send the third data to the first application module; the first application The program module is further configured to send the third data to the second application module.
一种可能的设计中,第二应用程序模块,还用于接收第一应用程序模块发送的第三数据;密钥管理模块,还用于接收第二应用程序模块发送的解密请求;密钥管理模块,还用于向第二应用程序模块返回第四数据。In a possible design, the second application module is further configured to receive third data sent by the first application module, and the key management module is further configured to receive a decryption request sent by the second application module; The module is further configured to return fourth data to the second application module.
一种可能的设计中,密钥管理模块,还用于若密钥管理模块确定第二应用进程不在第一应用进程所在的进程分组内,则向第二应用程序模块发送第三数据。In a possible design, the key management module is further configured to: if the key management module determines that the second application process is not in the process group in which the first application process is located, send the third data to the second application module.
一种可能的设计中,密钥管理模块,还用于获取第一应用程序模块的标识;密钥管理模块,还用于根据第一应用程序模块的标识,确定第一应用程序模块所在的进程分组的标识;密钥管理模块,还用于根据第一应用程序模块所在的进程分组的标识,获取第一应用程序模块所在的进程分组对应的解密密钥。In a possible design, the key management module is further configured to obtain an identifier of the first application module, and the key management module is further configured to determine, according to the identifier of the first application module, a process in which the first application module is located. And a key management module, configured to obtain a decryption key corresponding to the process group in which the first application module is located according to the identifier of the process group in which the first application module is located.
一种可能的设计中,第一应用程序模块,还用于请求密钥管理模块对第一数据进行加密;密钥管理模块,还用于根据该请求确定第一应用程序模块所在的进程分组;密钥管理模块,还用于使用第一应用程序模块所在的进程分组对应的加密密钥对第一数据进行加密,生成第二数据;N个进程分组对应M个加密密钥,且每一个进程分组对应一个加密密钥;密钥管理模块,还用于向第一应用程序模块发送第二数据。In a possible design, the first application module is further configured to request the key management module to encrypt the first data, and the key management module is further configured to determine, according to the request, a process group in which the first application module is located; The key management module is further configured to encrypt the first data by using an encryption key corresponding to the process group in which the first application module is located, to generate second data; the N process groups correspond to M encryption keys, and each process The packet corresponds to an encryption key; the key management module is further configured to send the second data to the first application module.
一种可能的设计中,第一应用程序模块,还用于保存第二数据。In a possible design, the first application module is also used to save the second data.
一种可能的设计中,密钥管理模块,还用于获取第一应用程序模块的标识;密钥管理模块,还用于根据第一应用程序模块的标识,确定第一应用程序模块所在的进程分组的标识;密钥管理模块,还用于根据第一应用程序模块所在的进程分组的标识,获取第一应用程序模块所在的进程分组对应的加密密钥。In a possible design, the key management module is further configured to obtain an identifier of the first application module, and the key management module is further configured to determine, according to the identifier of the first application module, a process in which the first application module is located. And a key management module, configured to obtain an encryption key corresponding to the process group in which the first application module is located according to the identifier of the process group in which the first application module is located.
第三方面、一种终端,包括:处理器、存储器和触摸屏,存储器、触摸屏与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当处理器执行计算机指令时,终端执行如第一方面中任一任一种可能的设计方法中的数据处理的方法。A third aspect, a terminal, comprising: a processor, a memory and a touch screen, the memory, the touch screen being coupled to the processor, the memory for storing the computer program code, the computer program code comprising computer instructions, and the terminal executing when the processor executes the computer instruction A method of data processing in a possible design method of any of the first aspects.
第四方面、一种计算机存储介质,包括计算机指令,当计算机指令在终端上运行时,使得终端执行如第一方面中任一任一种可能的设计方法数据处理的方法。A fourth aspect, a computer storage medium comprising computer instructions for causing a terminal to perform a method of data processing of a possible design method of any of the first aspects when the computer instructions are run on the terminal.
第五方面、一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面中任一任一种可能的设计方法数据处理的方法。A fifth aspect, a computer program product, when a computer program product is run on a computer, causing the computer to perform a method of data processing of a possible design method of any of the first aspects.
附图说明DRAWINGS
图1为本申请提供的一种终端的硬件结构示意图;1 is a schematic structural diagram of hardware of a terminal provided by the present application;
图2为本申请提供的一种数据处理方法的流程示意图一;2 is a schematic flowchart 1 of a data processing method provided by the present application;
图3为本申请提供的一种进程的存储空间的示意图;3 is a schematic diagram of a storage space of a process provided by the present application;
图4为本申请提供的一种数据处理方法的流程示意图二;4 is a schematic flowchart 2 of a data processing method provided by the present application;
图5为本申请提供的一种数据处理方法的流程示意图三;FIG. 5 is a schematic flowchart 3 of a data processing method provided by the present application; FIG.
图6为本申请提供的一种终端的软件结构示意图;6 is a schematic structural diagram of software of a terminal provided by the present application;
图7为本申请提供的一种数据处理方法的流程示意图四;FIG. 7 is a schematic flowchart 4 of a data processing method provided by the present application; FIG.
图8为本申请提供的一种数据处理方法的流程示意图五;FIG. 8 is a schematic flowchart 5 of a data processing method provided by the present application; FIG.
图9为本申请提供的一种数据处理方法的流程示意图六;9 is a schematic flowchart 6 of a data processing method provided by the present application;
图10为本申请提供的一种数据处理方法的流程示意图七;10 is a schematic flowchart 7 of a data processing method provided by the present application;
图11为本申请提供的一种数据处理方法的流程示意图八;11 is a schematic flowchart 8 of a data processing method provided by the present application;
图12为本申请提供的一种终端的组成示意图一;12 is a schematic diagram 1 of a composition of a terminal provided by the present application;
图13为本申请提供的一种终端的组成示意图二。FIG. 13 is a schematic diagram 2 of a composition of a terminal provided by the present application.
具体实施方式Detailed ways
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the following, the terms "first" and "second" are used for descriptive purposes only, and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, features defining "first" and "second" may include one or more of the features either explicitly or implicitly. In the description of the present application, "a plurality" means two or more unless otherwise stated.
首先,为了更好的理解本申请的技术方案,先对应用程序之间的通信机制进行简要介绍。First, in order to better understand the technical solution of the present application, a brief introduction to the communication mechanism between applications is first introduced.
终端在安装应用程序时,为每个应用程序都分配了唯一的用户标识(user Identifier,UID)或者进程标识(Process Identifier,PID),并永久保持。在不同应用程序之间进行通信时,采用粘合剂(Binder)机制。Binder机制是基于客户端/服务端(Client/Sever,C/S)架构的。具体的,被访问的应用程序作为服务(Sever)端,访问的应用程序作为客户(Client)端。Client端将访问的任务发送给Server端,Server端会根据权限控制策略,根据UID/PID判断Client端是否满足访问权限。只有申请了特定权限的Client端才能访问Server端。When the terminal installs the application, each application is assigned a unique user identifier (UID) or Process Identifier (PID) and is permanently maintained. A binder mechanism is used when communicating between different applications. The Binder mechanism is based on the client/server (C/S) architecture. Specifically, the accessed application is used as a service (Sever) end, and the accessed application is used as a client (Client). The client sends the accessed task to the server. The server controls the policy according to the permission. The UID/PID determines whether the client meets the access rights. Only the client that has applied for a specific permission can access the server.
目前,权限控制很多时候是通过弹出权限询问对话框,让用户选择是否运行。权限分为安装权限和动态权限。安装权限是指应用程序在第一次安装时,会将整个应用程序所涉及的所有权限一次询问,例如:在Android 6.0,也称为Android M,之前版本的安卓系统。动态权限则是在应用程序运行过程中,需要哪个权限再弹框询问用户是否给相应的权限,例如:Android M及之后版本的安卓系统。At present, the permission control is often through the pop-up permission query dialog box, allowing the user to choose whether to run. Permissions are divided into installation permissions and dynamic permissions. Installation permission means that when the application is first installed, all the permissions involved in the entire application will be asked once, for example: Android 6.0, also known as Android M, previous versions of Android. Dynamic permissions are in the process of running the application, which permission is required to ask the user whether to give the corresponding permissions, for example: Android M and later versions of Android.
需要说明的是,对于某些恶意应用,可能会通过申明为不支持动态权限的应用程序,而避开用户的同意而直接获取某些重要应用程序的访问权限,获取这些重要应用程序的关键数据,给用户带来损失。为此,本申请提供了一种数据处理的方法,通过终端对安装在其上的应用程序进行分组,同一分组内的应用程序在运行时,使用相同的密钥对关键数据进行加密。这样,同一分组内的应用程序加密后的数据,只能由该分组内其他的应用程序进行解密。那么,即使恶意应用程序获得了该应用程序的访问权限,由于不在同一分组内,也不能对加密的数据进行解密,有利于保证用户的数据安全。It should be noted that for some malicious applications, access to certain important applications may be obtained directly by an application that is not supporting dynamic permissions, and the key data of these important applications may be obtained by avoiding the user's consent. , bringing losses to users. To this end, the present application provides a method of data processing, by which an application installed on a terminal is grouped, and an application in the same group encrypts key data using the same key at runtime. In this way, the encrypted data of the application in the same group can only be decrypted by other applications in the group. Then, even if the malicious application obtains the access right of the application, since the encrypted data cannot be decrypted because it is not in the same group, the data security of the user is guaranteed.
示例性的,本申请中的终端可以为可以安装应用程序并显示应用程序图标的手机(如图1所示的手机100)、平板电脑、个人计算机(Personal Computer,PC)、个人数字助理(personal digital assistant,PDA)、智能手表、上网本、可穿戴电子设备、增强现实技术(Augmented Reality,AR)设备、虚拟现实(Virtual Reality,VR)设备等,本申请对该终端的具体形式不做特殊限制。Exemplarily, the terminal in the present application may be a mobile phone (such as the mobile phone 100 shown in FIG. 1), a tablet computer, a personal computer (PC), a personal digital assistant (personal), which can install an application and display an application icon. Digital assistant (PDA), smart watch, netbook, wearable electronic device, Augmented Reality (AR) device, Virtual Reality (VR) device, etc., the application does not impose any special restrictions on the specific form of the terminal. .
如图1所示,以手机100作为上述终端举例,手机100具体可以包括:As shown in FIG. 1 , the mobile phone 100 is used as the terminal example. The mobile phone 100 may specifically include:
处理器101是手机100的控制中心,利用各种接口和线路连接手机100的各个部分,通过运行或执行存储在存储器103内的应用程序,以及调用存储在存储器103内 的数据,执行手机100的各种功能和处理数据。在一些实施例中,处理器101可包括一个或多个处理单元;举例来说,处理器101可以是华为技术有限公司制造的麒麟960芯片。The processor 101 is a control center of the mobile phone 100, and connects various parts of the mobile phone 100 by using various interfaces and lines, and executes the mobile phone 100 by running or executing an application stored in the memory 103 and calling data stored in the memory 103. Various functions and processing data. In some embodiments, the processor 101 may include one or more processing units; for example, the processor 101 may be a Kirin 960 chip manufactured by Huawei Technologies Co., Ltd.
射频电路102可用于在收发信息或通话过程中,无线信号的接收和发送。特别地,射频电路102可以将基站的下行数据接收后,给处理器101处理;另外,将涉及上行的数据发送给基站。通常,射频电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频电路102还可以通过无线通信和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统、通用分组无线服务、码分多址、宽带码分多址、长期演进、电子邮件、短消息服务等。The radio frequency circuit 102 can be used to receive and transmit wireless signals during transmission or reception of information or calls. In particular, the radio frequency circuit 102 can process the downlink data of the base station and then process it to the processor 101; in addition, transmit the data related to the uplink to the base station. Generally, radio frequency circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency circuit 102 can also communicate with other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to global mobile communication systems, general packet radio services, code division multiple access, wideband code division multiple access, long term evolution, email, short message service, and the like.
存储器103用于存储应用程序以及数据,处理器101通过运行存储在存储器103的应用程序以及数据,执行手机100的各种功能以及数据处理。存储器103主要包括存储程序区以及存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等);存储数据区可以存储根据使用手机100时所创建的数据(比如音频数据、电话本等)。此外,存储器103可以包括高速随机存取存储器(Random Access Memory,RAM),还可以包括非易失存储器,例如磁盘存储器件、闪存器件或其他易失性固态存储器件等。存储器103可以存储各种操作系统,例如,苹果公司所开发的
Figure PCTCN2017120132-appb-000001
操作系统,谷歌公司所开发的
Figure PCTCN2017120132-appb-000002
操作系统等。上述存储器103可以是独立的,通过上述通信总线与处理器101相连接;存储器103也可以和处理器101集成在一起。
The memory 103 is used to store applications and data, and the processor 101 executes various functions and data processing of the mobile phone 100 by running applications and data stored in the memory 103. The memory 103 mainly includes a storage program area and a storage data area, wherein the storage program area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.); the storage data area can be stored according to the use of the mobile phone. Data created at 100 o'clock (such as audio data, phone book, etc.). Further, the memory 103 may include a high speed random access memory (RAM), and may also include a nonvolatile memory such as a magnetic disk storage device, a flash memory device, or other volatile solid state storage device. The memory 103 can store various operating systems, for example, developed by Apple.
Figure PCTCN2017120132-appb-000001
Operating system, developed by Google Inc.
Figure PCTCN2017120132-appb-000002
Operating system, etc. The above memory 103 may be independent and connected to the processor 101 via the above communication bus; the memory 103 may also be integrated with the processor 101.
触摸屏104具体可以包括触控板104-1和显示器104-2。The touch screen 104 may specifically include a touch panel 104-1 and a display 104-2.
其中,触控板104-1可采集手机100的用户在其上或附近的触摸事件(比如用户使用手指、触控笔等任何适合的物体在触控板104-1上或在触控板104-1附近的操作),并将采集到的触摸信息发送给其他器件(例如处理器101)。其中,用户在触控板104-1附近的触摸事件可以称之为悬浮触控;悬浮触控可以是指,用户无需为了选择、移动或拖动目标(例如图标等)而直接接触触控板,而只需用户位于设备附近以便执行所想要的功能。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型来实现触控板104-1。The touch panel 104-1 can collect touch events on or near the user of the mobile phone 100 (for example, the user uses any suitable object such as a finger, a stylus, or the like on the touch panel 104-1 or on the touchpad 104. The operation near -1), and the collected touch information is sent to other devices (for example, processor 101). The touch event of the user in the vicinity of the touch panel 104-1 may be referred to as a hovering touch; the hovering touch may mean that the user does not need to directly touch the touchpad in order to select, move or drag a target (eg, an icon, etc.) , and only the user is located near the device to perform the desired function. In addition, the touch panel 104-1 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
显示器(也称为显示屏)104-2可用于显示由用户输入的信息或提供给用户的信息以及手机100的各种菜单。可以采用液晶显示器、有机发光二极管等形式来配置显示器104-2。触控板104-1可以覆盖在显示器104-2之上,当触控板104-1检测到在其上或附近的触摸事件后,传送给处理器101以确定触摸事件的类型,随后处理器101可以根据触摸事件的类型在显示器104-2上提供相应的视觉输出。虽然在图1中,触控板104-1与显示屏104-2是作为两个独立的部件来实现手机100的输入和输出功能,但是在某些实施例中,可以将触控板104-1与显示屏104-2集成而实现手机100的输入和输出功能。可以理解的是,触摸屏104是由多层的材料堆叠而成,本申请实施例中只展示出了触控板(层)和显示屏(层),其他层在本申请实施例中不予记载。另外,触控板104-1可以以全面板的形式配置在手机100的正面,显示屏104-2也可以以全面板的形式配置在手机100的正面,这样在手机的正面就能够实现无边框的结构。A display (also referred to as display) 104-2 can be used to display information entered by the user or information provided to the user as well as various menus of the mobile phone 100. The display 104-2 can be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The touchpad 104-1 can be overlaid on the display 104-2, and when the touchpad 104-1 detects a touch event on or near it, it is transmitted to the processor 101 to determine the type of touch event, and then the processor 101 may provide a corresponding visual output on display 104-2 depending on the type of touch event. Although in FIG. 1, the touchpad 104-1 and the display 104-2 are implemented as two separate components to implement the input and output functions of the handset 100, in some embodiments, the touchpad 104- 1 is integrated with the display screen 104-2 to implement the input and output functions of the mobile phone 100. It is to be understood that the touch screen 104 is formed by stacking a plurality of layers of materials. In the embodiment of the present application, only the touch panel (layer) and the display screen (layer) are shown, and other layers are not described in the embodiment of the present application. . In addition, the touch panel 104-1 may be disposed on the front surface of the mobile phone 100 in the form of a full-board, and the display screen 104-2 may also be disposed on the front surface of the mobile phone 100 in the form of a full-board, so that the front of the mobile phone can be borderless. Structure.
另外,手机100还可以具有指纹识别功能。例如,可以在手机100的背面(例如后置摄像头的下方)配置指纹识别器112,或者在手机100的正面(例如触摸屏104的下方)配置指纹识别器112。又例如,可以在触摸屏104中配置指纹采集器件112来实现指纹识别功能,即指纹采集器件112可以与触摸屏104集成在一起来实现手机100的指纹识别功能。在这种情况下,该指纹采集器件112配置在触摸屏104中,可以是触摸屏104的一部分,也可以以其他方式配置在触摸屏104中。本申请实施例中的指纹采集器件112的主要部件是指纹传感器,该指纹传感器可以采用任何类型的感测技术,包括但不限于光学式、电容式、压电式或超声波传感技术等。In addition, the mobile phone 100 can also have a fingerprint recognition function. For example, the fingerprint reader 112 can be configured on the back of the handset 100 (eg, below the rear camera) or on the front side of the handset 100 (eg, below the touch screen 104). For another example, the fingerprint collection device 112 can be configured in the touch screen 104 to implement the fingerprint recognition function, that is, the fingerprint collection device 112 can be integrated with the touch screen 104 to implement the fingerprint recognition function of the mobile phone 100. In this case, the fingerprint capture device 112 is disposed in the touch screen 104 and may be part of the touch screen 104 or may be otherwise disposed in the touch screen 104. The main component of the fingerprint collection device 112 in the embodiment of the present application is a fingerprint sensor, which can employ any type of sensing technology, including but not limited to optical, capacitive, piezoelectric or ultrasonic sensing technologies.
手机100还可以包括蓝牙装置105,用于实现手机100与其他短距离的设备(例如手机、智能手表等)之间的数据交换。The mobile phone 100 may also include a Bluetooth device 105 for enabling data exchange between the handset 100 and other short-range devices (eg, mobile phones, smart watches, etc.).
手机100还可以包括至少一种传感器106,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节触摸屏104的显示器的亮度,接近传感器可在手机100移动到耳边时,关闭显示器的电源。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机100还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The handset 100 can also include at least one type of sensor 106, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display of the touch screen 104 according to the brightness of the ambient light, and the proximity sensor may turn off the power of the display when the mobile phone 100 moves to the ear. . As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc. As for the mobile phone 100 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
WiFi装置107,用于为手机100提供遵循WiFi相关标准协议的网络接入,手机100可以通过WiFi装置107接入到WiFi接入点,进而帮助用户收发电子邮件、浏览网页和访问流媒体等,它为用户提供了无线的宽带互联网访问。在其他一些实施例中,该WiFi装置107也可以作为WiFi无线接入点,可以为其他设备提供WiFi网络接入。The WiFi device 107 is configured to provide the mobile phone 100 with network access complying with the WiFi-related standard protocol, and the mobile phone 100 can access the WiFi access point through the WiFi device 107, thereby helping the user to send and receive emails, browse web pages, and access streaming media. It provides users with wireless broadband Internet access. In some other embodiments, the WiFi device 107 can also function as a WiFi wireless access point, and can provide WiFi network access for other devices.
定位装置108,用于为手机100提供地理位置。可以理解的是,该定位装置108具体可以是全球定位系统(Global Positioning System,GPS)或北斗卫星导航系统、俄罗斯GLONASS等定位系统的接收器。定位装置108在接收到上述定位系统发送的地理位置后,将该信息发送给处理器101进行处理,或者发送给存储器103进行保存。在另外的一些实施例中,该定位装置108还可以是辅助全球卫星定位系统(Assisted Global Positioning System,AGPS)的接收器,AGPS系统通过作为辅助服务器来协助定位装置108完成测距和定位服务,在这种情况下,辅助定位服务器通过无线通信网络与设备例如手机100的定位装置108(即GPS接收器)通信而提供定位协助。在另外的一些实施例中,该定位装置108也可以是基于WiFi接入点的定位技术。由于每一个WiFi接入点都有一个全球唯一的(Media Access Control,MAC)地址,设备在开启WiFi的情况下即可扫描并收集周围的WiFi接入点的广播信号,因此可以获取到WiFi接入点广播出来的MAC地址;设备将这些能够标示WiFi接入点的数据(例如MAC地址)通过无线通信网络发送给位置服务器,由位置服务器检索出每一个WiFi接入点的地理位置,并结合WiFi广播信号的强弱程度,计算出该设备的地理位置并发送到该设备的定位装置108中。The positioning device 108 is configured to provide a geographic location for the mobile phone 100. It can be understood that the positioning device 108 can be specifically a receiver of a positioning system such as a Global Positioning System (GPS) or a Beidou satellite navigation system, or a Russian GLONASS. After receiving the geographical location transmitted by the positioning system, the positioning device 108 sends the information to the processor 101 for processing, or sends it to the memory 103 for storage. In some other embodiments, the positioning device 108 can also be a receiver of an Assisted Global Positioning System (AGPS), which assists the positioning device 108 in performing ranging and positioning services by acting as an auxiliary server. In this case, the secondary location server provides location assistance over a wireless communication network in communication with a location device 108 (i.e., a GPS receiver) of the device, such as handset 100. In still other embodiments, the positioning device 108 can also be a WiFi access point based positioning technology. Since each WiFi access point has a globally unique (Media Access Control, MAC) address, the device can scan and collect the broadcast signal of the surrounding WiFi access point when the WiFi is turned on, so that the WiFi connection can be obtained. The MAC address broadcasted by the inbound point; the device sends the data (such as the MAC address) capable of indicating the WiFi access point to the location server through the wireless communication network, and the location server retrieves the geographical location of each WiFi access point and combines The strength of the WiFi broadcast signal is calculated, and the geographic location of the device is calculated and sent to the location device 108 of the device.
音频电路109、扬声器113、麦克风114可提供用户与手机100之间的音频接口。音频电路109可将接收到的音频数据转换后的电信号,传输到扬声器113,由扬声器 113转换为声音信号输出;另一方面,麦克风114将收集的声音信号转换为电信号,由音频电路109接收后转换为音频数据,再将音频数据输出至RF电路102以发送给比如另一手机,或者将音频数据输出至存储器103以便进一步处理。The audio circuit 109, the speaker 113, and the microphone 114 can provide an audio interface between the user and the handset 100. The audio circuit 109 can transmit the converted electrical data of the received audio data to the speaker 113 for conversion to the sound signal output by the speaker 113; on the other hand, the microphone 114 converts the collected sound signal into an electrical signal by the audio circuit 109. After receiving, it is converted into audio data, and then the audio data is output to the RF circuit 102 for transmission to, for example, another mobile phone, or the audio data is output to the memory 103 for further processing.
外设接口110,用于为外部的输入/输出设备(例如键盘、鼠标、外接显示器、外部存储器、用户识别模块卡等)提供各种接口。例如通过通用串行总线(Universal Serial Bus,USB)接口与鼠标连接,通过用户识别模块卡卡槽上的金属触点与电信运营商提供的用户识别模块卡(Subscriber Identification Module,SIM)卡进行连接。外设接口110可以被用来将上述外部的输入/输出外围设备耦接到处理器101和存储器103。The peripheral interface 110 is used to provide various interfaces for external input/output devices (such as a keyboard, a mouse, an external display, an external memory, a subscriber identity module card, etc.). For example, it is connected to the mouse through a Universal Serial Bus (USB) interface, and is connected to a Subscriber Identification Module (SIM) card provided by the service provider through a metal contact on the card slot of the subscriber identity module. . Peripheral interface 110 can be used to couple the external input/output peripherals described above to processor 101 and memory 103.
手机100还可以包括给各个部件供电的电源装置111(比如电池和电源管理芯片),电池可以通过电源管理芯片与处理器101逻辑相连,从而通过电源装置111实现管理充电、放电、以及功耗管理等功能。The mobile phone 100 may further include a power supply device 111 (such as a battery and a power management chip) that supplies power to the various components. The battery may be logically connected to the processor 101 through the power management chip to manage charging, discharging, and power management through the power supply device 111. And other functions.
尽管图1未示出,手机100还可以包括摄像头(前置摄像头和/或后置摄像头)、闪光灯、微型投影装置、近场通信(Near Field Communication,NFC)装置等,在此不再赘述。Although not shown in FIG. 1, the mobile phone 100 may further include a camera (front camera and/or rear camera), a flash, a micro projection device, a near field communication (NFC) device, and the like, and details are not described herein.
以下实施例中的方法均可以在具有上述硬件结构的手机100中实现。The methods in the following embodiments can all be implemented in the mobile phone 100 having the above hardware structure.
如图2所示,为本申请提供的一种数据处理的方法流程图,该方法包括对数据的加密过程,该方法可应用于终端,该终端运行第一应用进程和密钥管理进程,该方法具体包括:As shown in FIG. 2, a flow chart of a data processing method provided by the present application includes an encryption process for data, the method being applicable to a terminal, where the terminal runs a first application process and a key management process, The method specifically includes:
S101、第一应用进程生成第一数据。S101. The first application process generates first data.
其中,第一应用进程为第一应用程序运行的其中一个进程,而第一应用程序可以为终端上任一个应用,为可执行一定业务功能的程序和数据集合,例如:短信应用、美团应用、淘宝应用等。The first application process is one of the processes running by the first application, and the first application may be any application on the terminal, and is a program and a data set that can perform certain business functions, for example, a short message application, a US group application, Taobao applications, etc.
一些实施例中,第一数据可以是需要加密的数据,例如是根据第一应用进程或者第一应用程序的业务性质确定的数据,例如可以是第一应用进程或第一应用程序中重要的、关键的、敏感的数据。举例说明,若第一应用程序是短信应用,则第一数据可以是账号、密码、验证码、短信内容等信息。具体的,第一数据可以是包含关键数据的整条短信内容,也可以是一条短信内容中部分内容,仅关键数据,本申请实施例不做限定。若第一数据是这类需要加密的数据,则第一应用进程需要向密钥管理模块请求对第一数据进行加密,即执行步骤S102。In some embodiments, the first data may be data that needs to be encrypted, for example, data determined according to the first application process or the service nature of the first application, for example, may be important in the first application process or the first application, Critical, sensitive data. For example, if the first application is a short message application, the first data may be information such as an account number, a password, a verification code, and a short message content. Specifically, the first data may be the entire short message content including the key data, or may be part of the content of the short message content, and only the key data, which is not limited in the embodiment of the present application. If the first data is such data that needs to be encrypted, the first application process needs to request the key management module to encrypt the first data, that is, step S102 is performed.
一些实施例中,第一数据可以是不需要加密的数据,例如是根据第一应用进程或第一应用程序的业务性质确定不需要加密的数据,则第一应用进程直接存储第一数据即可,即不需执行下面步骤。In some embodiments, the first data may be data that does not need to be encrypted, for example, determining data that does not need to be encrypted according to the service nature of the first application process or the first application, and the first application process directly stores the first data. , that is, no need to perform the following steps.
S102、第一应用进程向密钥管理模块请求对第一数据进行加密,请求消息中携带第一数据。S102. The first application process requests the key management module to encrypt the first data, where the request message carries the first data.
其中,密钥管理模块主要用于执行对各个应用进程中的特定数据进行加解密过程,以及创建与管理各个分组的加解密密钥等。密钥管理模块在运行时,也可以称为密钥管理进程。The key management module is mainly used to perform encryption and decryption processes on specific data in each application process, and to create and manage encryption and decryption keys of each packet. When the key management module is running, it can also be called a key management process.
S103、密钥管理模块对第一数据进行加密,生成第二数据。S103. The key management module encrypts the first data to generate second data.
具体的,密钥管理模块被第一应用进程调用时,基于binder的进程间通信机制可 知,密钥管理模块可获取调用者的标识,即第一应用进程的标识。第一应用进程的标识可以是第一应用进程的PID,也可以是第一应用程序的UID。那么,密钥管理模块可根据第一应用进程的标识确定第一应用进程所对应的分组,获取第一应用进程所对应的分组的标识。然后,根据第一应用进程所对应的分组的标识获取第一应用进程对应的加密密钥。最后,密钥管理模块根据获取的加密密钥对第一数据进行加密,得到第二数据。其中,第二数据为第一数据加密后的数据,为密文。Specifically, when the key management module is invoked by the first application process, the binder-based inter-process communication mechanism is known, and the key management module can obtain the identifier of the caller, that is, the identifier of the first application process. The identifier of the first application process may be the PID of the first application process or the UID of the first application. Then, the key management module may determine, according to the identifier of the first application process, the packet corresponding to the first application process, and obtain the identifier of the packet corresponding to the first application process. Then, the encryption key corresponding to the first application process is obtained according to the identifier of the packet corresponding to the first application process. Finally, the key management module encrypts the first data according to the obtained encryption key to obtain the second data. The second data is the data encrypted by the first data, and is a ciphertext.
需要说明的是,第一应用进程可以对应一个分组,这一个分组对应一个加密密钥,那么第一应用进程对应一个加密密钥。于是,密钥管理模块采用这一个加密密钥对第一数据进行加密。第一应用进程也可以对应多个分组,这多个分组对应多个加密密钥,那么第一应用进程对应多个加密密钥。于是,密钥管理模块采用这多个加密密钥对第一数据进行加密。本申请实施例不做限定。It should be noted that the first application process may correspond to one packet, and the one packet corresponds to one encryption key, and then the first application process corresponds to one encryption key. Thus, the key management module encrypts the first data using the one encryption key. The first application process may also correspond to multiple packets, and the multiple packets correspond to multiple encryption keys, and then the first application process corresponds to multiple encryption keys. Thus, the key management module encrypts the first data using the plurality of encryption keys. The embodiment of the present application is not limited.
还需要说明的是,这里的分组,也可称为进程分组。终端中运行的一个或多个进程可以对应一个或多个进程分组。而这一个或多个进程分组分别对应一个或多个加密密钥。It should also be noted that the grouping here may also be referred to as a process grouping. One or more processes running in the terminal may be grouped into one or more processes. The one or more process packets respectively correspond to one or more encryption keys.
举例说明,假设终端上运行的应用进程可以划分为三个进程分组,分别为进程分组A、进程分组B和进程分组C。那么,进程分组A、进程分组B和进程分组C可以分别对应不同的加密密钥,也可以进程分组A和进程分组B对应一个相同的加密密钥,进程分组C对应另一个不同的加密密钥,还可以是进程分组A、进程分组B和进程分组C分别对应一个相同的加密密钥。本申请实施例对进程分组和加密密钥的对应关系不做限定。For example, it is assumed that an application process running on a terminal can be divided into three process groups, namely, process group A, process group B, and process group C. Then, the process packet A, the process packet B, and the process packet C may respectively correspond to different encryption keys, or the process packet A and the process packet B may correspond to one same encryption key, and the process packet C corresponds to another different encryption key. It is also possible that process group A, process group B, and process group C respectively correspond to one and the same encryption key. The correspondence between the process grouping and the encryption key is not limited in the embodiment of the present application.
S104、密钥管理模块将第二数据发送给第一应用进程。S104. The key management module sends the second data to the first application process.
S105、第一应用进程保存第二数据。S105. The first application process saves the second data.
具体的,第一应用进程将第二数据保存在第一应用进程中的加密存储区。其中,加密存储区为第一应用进程中一片特定存储空间,专用于存储经过密钥管理模块加密后的数据。Specifically, the first application process saves the second data in an encrypted storage area in the first application process. The encrypted storage area is a specific storage space in the first application process, and is dedicated to storing data encrypted by the key management module.
示例性的,如图3所示,为第一应用进程的空间示意图。第一应用进程的空间包括:栈(stack)、堆(heap)、BBS(Block Started by Symbol)段、数据段(data segment)段、代码段(code/text segment)。Exemplarily, as shown in FIG. 3, is a spatial schematic diagram of a first application process. The space of the first application process includes: a stack, a heap, a BBS (Block Started by Symbol) segment, a data segment segment, and a code segment (code/text segment).
其中,BBS段、数据段和代码段都属于静态内存分配,用于保存代码、全局变量和静态变量的,是具有固定作用的。stack是由操作系统自动分配和释放的,用于存放第一应用进程的局部变量,还可以用于传递参数和返回值。Among them, the BBS segment, the data segment and the code segment are static memory allocations, which are used to store code, global variables and static variables, and have a fixed effect. The stack is automatically allocated and freed by the operating system to store local variables of the first application process, and can also be used to pass parameters and return values.
heap为由第一应用进程分配和释放的,用于存放第一应用进程运行中被动态分配的内存空间段。在本申请实施例中,第一应用进程可以在第一次运行时,在heap分配一段内存空间,用于专门存储经密钥加密模块加密后的数据,即加密存储区。The heap is allocated and released by the first application process, and is used to store a dynamically allocated memory space segment in the first application process. In the embodiment of the present application, the first application process may allocate a memory space in the heap for the first time to store the data encrypted by the key encryption module, that is, the encrypted storage area.
可见,在本申请实施例中,第一应用进程在运行过程中,先确定第一应用进程对应的分组,再获取该分组对应的加密密钥,使用该加密密钥对第一应用进程的数据进行加密,并存储于特定的加密存储区,有利于提高应用程序的关键数据的安全性。It can be seen that, in the embodiment of the present application, in the running process, the first application process first determines a packet corresponding to the first application process, and then obtains an encryption key corresponding to the packet, and uses the encryption key to data of the first application process. Encryption and storage in a specific encrypted storage area helps to improve the security of critical data for the application.
如图4所示,为本申请实施例提供的一种数据处理的方法流程图,该方法包括对数据的解密过程,具体包括:As shown in FIG. 4, a flowchart of a method for data processing according to an embodiment of the present application, where the method includes a process for decrypting data, specifically includes:
S201、第二应用进程向第一应用进程请求访问第一应用进程的第三数据。S201. The second application process requests the first application process to access the third data of the first application process.
其中,第二应用进程可以为第一应用程序中另一个进程,不同于第一应用进程,第二应用进程也可以是第二应用程序中的一个进程,第二应用程序不同于第二应用程序。The second application process may be another process in the first application, different from the first application process, the second application process may also be a process in the second application, and the second application is different from the second application. .
一些实施例中,第二应用进程需预先获取访问第一应用进程的权限,图中以S201a示出。具体的,可以是第二应用进程向第一应用进程发送申请访问权限的请求,第一应用进程对第二应用进程进行授权。也可以是第一应用进程直接向第二应用进程进行授权,允许第二应用进程访问第一应用进程的数据。还可以是第一应用进程默认第二应用进程具有访问第一应用进程的权限,本申请实施例不做限定。In some embodiments, the second application process needs to obtain permission to access the first application process in advance, as shown in S201a. Specifically, the second application process sends a request for applying for access rights to the first application process, and the first application process authorizes the second application process. It is also possible that the first application process directly authorizes the second application process, and allows the second application process to access data of the first application process. It is also possible that the first application process defaults that the second application process has the right to access the first application process, which is not limited in this embodiment.
然后,第二应用进程可读取第一应用进程的数据,包括第三数据。示例性的,第二应用进程可以读取第一应用进程中全部数据,也可以读取到与第二应用进程相关联的数据,本申请实施例不做限定。Then, the second application process can read the data of the first application process, including the third data. Exemplarily, the second application process can read all the data in the first application process, and can also read the data associated with the second application process, which is not limited in this embodiment.
示例性,假设第一应用进程为短信应用中的进程,第二应用进程为美团应用中的进程,美团应用具有短信应用的访问权限。那么美团应用可以读取到短信应用中的全部短信内容,或者美团应用可以读取到短信应用中的,与美团应用相关联的短信内容,例如:美团应用发送给短信应用的验证码信息等。Exemplarily, it is assumed that the first application process is a process in the short message application, and the second application process is a process in the US group application, and the US group application has the access right of the short message application. Then the US group application can read all the SMS content in the SMS application, or the US group application can read the SMS content associated with the US group application in the SMS application, for example, the verification of the US group application sent to the SMS application. Code information, etc.
S202、第一应用进程确定第三数据存储在加密存储区。S202. The first application process determines that the third data is stored in the encrypted storage area.
具体的,第一应用进程根据获取到第三数据所对应的索引确定第三数据是否存储在加密存储区。若第三数据没有存储在加密存储区,则第三数据为明文,第一应用进程将第三数据发送给第二应用进程即可。若第三数据存储在加密存储区,则第三数据为密文,第一应用进程还需要对第三数据进行解密,即执行步骤S203。Specifically, the first application process determines, according to the index corresponding to the third data, whether the third data is stored in the encrypted storage area. If the third data is not stored in the encrypted storage area, the third data is plaintext, and the first application process sends the third data to the second application process. If the third data is stored in the encrypted storage area, the third data is cipher text, and the first application process further needs to decrypt the third data, that is, step S203 is performed.
S203、第一应用进程向密钥管理模块请求对第三数据进行解密,请求中携带第二应用进程的标识和第三数据。S203. The first application process requests the key management module to decrypt the third data, where the request carries the identifier of the second application process and the third data.
具体的,第一应用进程被第二应用进程调用时,第一应用进程可获取调用程序的标识,即第二应用进程的标识。Specifically, when the first application process is invoked by the second application process, the first application process may obtain the identifier of the calling program, that is, the identifier of the second application process.
S204、密钥管理模块根据第二应用进程的标识,确定第二应用进程是否在第一应用进程所对应的分组,若是,则执行S205;否则,则密钥管理模块不对第三数据进行解密,直接返回第三数据。S204: The key management module determines, according to the identifier of the second application process, whether the second application process is a packet corresponding to the first application process, and if yes, executing S205; otherwise, the key management module does not decrypt the third data. Return the third data directly.
具体的,密钥管理模块被第一应用进程调用时,密钥管理模块可获取调用者的标识,即第一应用进程的标识。密钥管理模块可以根据第一应用进程的标识确定第一应用进程所对应的分组,以及该分组中包含的应用程序的标识。进一步的,密钥管理模块可以根据第二应用进程的标识确定第二应用进程是否在该分组中。若第二应用进程在分组中,则密钥管理模块对第三数据进行解密,即执行步骤S205。若第二应用进程不在分组中,则密钥管理模块不对第三数据进行解密,直接向第一应用进程返回第三数据。若第二应用进程不在分组中,则密钥管理模块也可以直接拒绝第一应用进程对第三数据的解密请求,结束流程。Specifically, when the key management module is invoked by the first application process, the key management module may obtain the identifier of the caller, that is, the identifier of the first application process. The key management module may determine, according to the identifier of the first application process, a packet corresponding to the first application process, and an identifier of the application included in the packet. Further, the key management module may determine, according to the identifier of the second application process, whether the second application process is in the packet. If the second application process is in the group, the key management module decrypts the third data, that is, step S205 is performed. If the second application process is not in the packet, the key management module does not decrypt the third data, and directly returns the third data to the first application process. If the second application process is not in the packet, the key management module may directly reject the decryption request of the first application process for the third data, and end the process.
换句话来说,第二应用进程访问第一应用进程时,即使第二应用进程具有访问权限,但第二应用进程和第一应用进程并不属于同一个分组,第二应用进程也不能获得第一应用进程存储在加密存储区的数据的明文。这样,若第二应用进程为恶意程序时, 即使诱导用户对第二应用进程访问第一应用进程进行授权,第二应用进程也不能获得第一应用进程加密的数据,提高了第一应用进程中加密数据的安全性。In other words, when the second application process accesses the first application process, even if the second application process has access rights, the second application process and the first application process do not belong to the same group, and the second application process cannot obtain the same. The first application process stores the plaintext of the data in the encrypted storage area. In this way, if the second application process is a malicious program, even if the user is authorized to access the first application process to access the first application process, the second application process cannot obtain the data encrypted by the first application process, thereby improving the first application process. Encrypted data security.
S205、密钥管理模块对第三数据进行解密,得到第四数据。S205. The key management module decrypts the third data to obtain fourth data.
具体的,密钥管理模块根据第一应用进程对应的分组,获取该分组对应的解密密钥。采用获取到的解密密钥对第三数据进行解密,得到第四数据。其中,第四数据为第三数据解密后的数据,为明文。Specifically, the key management module acquires a decryption key corresponding to the packet according to the packet corresponding to the first application process. The third data is decrypted by using the obtained decryption key to obtain fourth data. The fourth data is data after the third data is decrypted, and is plaintext.
还需要说明的是,第一应用进程可以对应一个分组,这一个分组对应一个解密密钥,那么第一应用进程对应一个解密密钥。于是,密钥管理模块采用这一个解密密钥对第三数据进行解密。第一应用进程也可以对应多个分组,这多个分组中每一个分组又对应一个解密密钥,那么第一应用进程对应多个解密密钥。于是,密钥管理模块采用这多个解密密钥对第三数据进行解密。本申请实施例不做限定。It should also be noted that the first application process may correspond to one packet, and the one packet corresponds to one decryption key, and then the first application process corresponds to one decryption key. Thus, the key management module decrypts the third data using the one decryption key. The first application process may also correspond to multiple packets, and each of the multiple packets corresponds to a decryption key, and the first application process corresponds to multiple decryption keys. Thus, the key management module decrypts the third data using the plurality of decryption keys. The embodiment of the present application is not limited.
S206、密钥管理模块向第一应用进程发送第四数据。S206. The key management module sends fourth data to the first application process.
S207、第一应用进程向第二应用进程发送第四数据。S207. The first application process sends fourth data to the second application process.
可见,在本申请实施例中,第二应用进程需要访问第一应用进程的加密数据时,需要第一应用进程申请密钥管理模块对加密数据进行解密。而密钥管理模块需先确定第二应用进程是否在第一应用进程的对应的分组内,若在,则对加密数据进行解密,并向第一应用进程返回解密后数据。由此,避免了第二应用进程在误获取访问第一应用进程的权限后,就直接能读取第一应用进程的数据的情况发生,提升了第一应用进程的数据的安全性。It can be seen that, in the embodiment of the present application, when the second application process needs to access the encrypted data of the first application process, the first application process is required to apply for the key management module to decrypt the encrypted data. The key management module needs to first determine whether the second application process is in a corresponding group of the first application process, and if so, decrypt the encrypted data and return the decrypted data to the first application process. Therefore, the second application process can directly read the data of the first application process after obtaining the permission to access the first application process, and improve the security of the data of the first application process.
还需要说明的是,在本申请实施例中,第二应用进程可以通过第一应用进程向密钥管理模块申请解密第三数据的。第二应用进程也可以直接向密钥管理模块申请解密第三数据,即步骤S202~S207可替换为步骤S301~S305。It should be noted that, in the embodiment of the present application, the second application process may apply to the key management module to decrypt the third data by using the first application process. The second application process may also directly apply to the key management module to decrypt the third data, that is, steps S202 to S207 may be replaced with steps S301 to S305.
如图5所示,为本申请实施例提供的一种数据处理的方法流程图,该方法包括步骤S201、S301~S305,具体如下:As shown in FIG. 5, it is a flowchart of a data processing method provided by an embodiment of the present application, where the method includes steps S201 and S301 to S305, as follows:
S301、第一应用进程向第二应用进程返回第三数据。S301. The first application process returns third data to the second application process.
其中,若第三数据存储在第一应用进程的加密存储区中,则第三数据为密文,则需要第一应用进程需要对第三数据进行解密,即执行步骤S302。若第三数据存储在第一应用进程的非加密存储区中,则第三数据为明文,即为第一应用进程最终要获取的数据。If the third data is stored in the encrypted storage area of the first application process, the third data is cipher text, and the first application process needs to decrypt the third data, that is, step S302 is performed. If the third data is stored in the non-encrypted storage area of the first application process, the third data is plaintext, that is, the data to be finally acquired by the first application process.
S302、第二应用进程向密钥管理模块请求解密第三数据,该请求中携带第三数据和第一应用进程的标识。S302. The second application process requests the key management module to decrypt the third data, where the request carries the third data and the identifier of the first application process.
需要说明的是,第二应用进程被第一应用进程调用时,第二应用进程可获取调用者的标识,即第一应用进程的标识。It should be noted that, when the second application process is invoked by the first application process, the second application process may obtain the identifier of the caller, that is, the identifier of the first application process.
S303、密钥管理模块根据确定第二应用进程是否在第一应用进程所对应的分组。若是,则执行S304;否则,密钥管理模块不对第三数据进行解密,直接向第一应用进程返回第三数据。S303. The key management module determines, according to whether the second application process is a packet corresponding to the first application process. If yes, execute S304; otherwise, the key management module does not decrypt the third data, and directly returns the third data to the first application process.
具体的,密钥管理模块被第二应用进程调用时,密钥管理模块也可获取第二应用进程的标识。那么,密钥管理模块根据请求中携带的第一应用进程的标识,确定第一应用进程所对应的分组以及该分组中包含的应用进程的标识。进一步的,密钥管理模 块可以根据第二应用进程的标识确定第二应用进程是否在该分组中。若第二应用进程在分组中,则密钥管理模块对第三数据进行解密,即执行步骤S304。若第二应用进程不在分组中,则密钥管理模块不对第三数据进行解密,直接向第一应用进程返回第三数据。若第二应用进程不在分组中,则密钥管理模块也可以直接拒绝第二应用进程对第三数据的解密请求,结束流程。Specifically, when the key management module is invoked by the second application process, the key management module may also obtain the identifier of the second application process. Then, the key management module determines, according to the identifier of the first application process carried in the request, the packet corresponding to the first application process and the identifier of the application process included in the packet. Further, the key management module may determine whether the second application process is in the packet according to the identifier of the second application process. If the second application process is in the group, the key management module decrypts the third data, that is, step S304 is performed. If the second application process is not in the packet, the key management module does not decrypt the third data, and directly returns the third data to the first application process. If the second application process is not in the packet, the key management module may directly reject the decryption request of the second application process for the third data, and end the process.
S304、密钥管理模块对第三数据进行解密,得到第四数据。S304. The key management module decrypts the third data to obtain fourth data.
本步骤可参考步骤S205,不再重复赘述。This step can refer to step S205, and details are not repeatedly described.
S305、密钥管理模块向第二应用进程发送第四数据。S305. The key management module sends fourth data to the second application process.
由此,本申请实施例中,第二应用进程在获取到第一应用进程加密数据后,可向密钥管理模块申请对该加密数据进行解密。而密钥管理模块需先确定第二应用进程是否在第一应用进程的对应的分组内,若在,则对加密数据进行解密,并向第一应用进程返回解密后数据。由此,避免了第二应用进程在误获取访问第一应用进程的权限后,就直接能读取第一应用进程的数据的情况发生,提升了第一应用进程的数据的安全性。Therefore, in the embodiment of the present application, after acquiring the encrypted data of the first application process, the second application process may apply to the key management module to decrypt the encrypted data. The key management module needs to first determine whether the second application process is in a corresponding group of the first application process, and if so, decrypt the encrypted data and return the decrypted data to the first application process. Therefore, the second application process can directly read the data of the first application process after obtaining the permission to access the first application process, and improve the security of the data of the first application process.
示例性的,如图6所示,为本申请实施例提供的一种终端的组成示意图,该终端包括多个应用进程601~604、密钥管理模块605和安全存储模块606。For example, as shown in FIG. 6 , it is a schematic diagram of a composition of a terminal provided by an embodiment of the present application. The terminal includes multiple application processes 601 - 604 , a key management module 605 , and a secure storage module 606 .
其中,终端对这多个应用进程进行了分组,同一分组内的应用进程采用相同的密钥对特定数据进行加解密,即同一分组内的应用进程之间可以相互访问特定数据。其中,分组方法将在下文具体介绍。例如:应用进程601和应用进程602为第一分组的进程。应用进程603和应用进程604为第二分组的进程。The terminal groups the multiple application processes, and the application processes in the same group use the same key to encrypt and decrypt specific data, that is, the application processes in the same group can access specific data. Among them, the grouping method will be specifically described below. For example, the application process 601 and the application process 602 are processes of the first group. Application process 603 and application process 604 are processes of the second group.
密钥管理模块605,用于执行对各个应用进程中的特定数据进行加解密过程,以及创建与管理各个分组的加解密密钥等。具体的,密钥管理模块605还包括分组管理模块60501和加密模块60502。The key management module 605 is configured to perform an encryption and decryption process on specific data in each application process, and an encryption and decryption key and the like for creating and managing each packet. Specifically, the key management module 605 further includes a packet management module 60501 and an encryption module 60502.
其中,分组管理模块60501,用于按照分组策略对应用进程进行分组,分组管理模块60502可以自动生成分组策略,也可以接收用户的设置,更新分组策略,本申请对分组策略不做限定。分组管理模块60502还可以请求加密模块60502为分组创建密钥,建立应用与分组、和/或密钥的对应关系等。其中加密模块60502,用于为分组创建新的密钥对,对应用进程的数据进行加密、解密等。The group management module 60501 is configured to group the application process according to the grouping policy. The group management module 60502 can automatically generate a grouping policy, and can also receive the user's settings and update the grouping policy. The present application does not limit the grouping policy. The packet management module 60502 can also request the encryption module 60502 to create a key for the packet, establish a correspondence between the application and the packet, and/or the key, and the like. The encryption module 60502 is configured to create a new key pair for the packet, encrypt and decrypt the data of the application process, and the like.
安全存储模块606,用于存储密钥管理模块605生成的加解密的密钥,保证密钥存储的安全。The security storage module 606 is configured to store the encrypted and decrypted key generated by the key management module 605 to ensure the security of the key storage.
下面以本申请提供的数据处理方法运用于如图6所示的终端为例,对本申请提供的技术方案进行详细阐述。In the following, the data processing method provided by the present application is applied to the terminal shown in FIG. 6 as an example, and the technical solution provided by the present application is elaborated.
首先,对于应用进程的分组策略进行说明。终端可以根据应用进程对应的应用程序的来源、业务类型等,对应用进程进行分组。First, explain the grouping strategy of the application process. The terminal can group the application processes according to the source of the application corresponding to the application process, the service type, and the like.
示例性的,分组策略可以是根据应用程序的下载来源进行分组。具体的,从终端中的应用市场中下载的应用程序,由于这些应用程序是通过上架审核的,可认为是可信的应用程序,可划分到为一个分组。从其他的方式下载的,不是通过应用市场下载的,可认为是不可信的应用程序,可划分到另一个分组。Illustratively, the grouping strategy can be grouped according to the download source of the application. Specifically, the applications downloaded from the application market in the terminal, because the applications are reviewed by the shelves, can be regarded as trusted applications, and can be divided into one group. Downloaded from other methods, not downloaded through the application market, can be considered as an untrusted application that can be divided into another group.
示例性的,分组策略还可以是根据应用程序的具体业务类型进行分组。具体的,从应用市场下载的应用程序在上架时,应用市场会对这些应用程序进行分类,例如: 办公、购物、社交、娱乐、新闻等。那么,可以根据这些分类对应用程序进行分组,例如同一类型的应用程序划分到一个分组内,也可以是几个类型的应用程序划分到一个分组内,本申请实施例不做限定。Exemplarily, the grouping policy may also be grouped according to the specific service type of the application. Specifically, when the applications downloaded from the application market are on the shelves, the application market will classify these applications, such as: office, shopping, social, entertainment, news, and so on. Then, the application can be grouped according to the classification, for example, the application of the same type is divided into one group, or the application of several types is divided into one group, which is not limited in the embodiment of the present application.
需要说明的是,应用市场在终端下载应用程序时,也将该应用程序的来源信息、业务类型下发给终端,以便终端根据这些信息进行分组,或者应用市场将其对应用程序的分类信息发送给终端。如图7所示,为应用程序的发布、上架审核、分类、下载的流程示意图。It should be noted that when the application downloads the application, the application market also sends the source information and service type of the application to the terminal, so that the terminal groups the information according to the information, or the application market sends the classified information of the application to the application. Give the terminal. As shown in Figure 7, it is a schematic diagram of the process of publishing, reviewing, sorting, and downloading applications.
在一些实施例中,当应用开发者或用户发现应用程序有恶意行为后,可以上报给应用市场,应用市场重新进行审核,重新分组。如图8所示,为应用程序被重新审核上架的流程示意图。In some embodiments, when the application developer or user discovers that the application has malicious behavior, it can be reported to the application market, and the application market is re-reviewed and re-grouped. As shown in Figure 8, the application is re-reviewed for the process flow.
示例性的,分组策略还可以是根据用户的设置,指定将某些应用程序划分到一个分组内。分组策略还可以是以上各种分组策略的组合,本申请实施例不做限定。Exemplarily, the grouping policy may also be to specify that certain applications are divided into one group according to the user's settings. The grouping policy may also be a combination of the above various grouping policies, which is not limited in the embodiment of the present application.
在终端确定分组策略后,终端根据分组策略对各个应用程序进行分组,以及为各个分组确定密钥。具体的,如图9所示,为本申请实施例提供的一种数据处理的方法流程示意图,该方法具体包括:After the terminal determines the grouping policy, the terminal groups each application according to the grouping policy and determines a key for each group. Specifically, as shown in FIG. 9 , a schematic flowchart of a method for data processing according to an embodiment of the present application, where the method specifically includes:
S401、终端检测到第三应用程序安装完成后,通知分组管理模块为第三应用程序对应的第三应用进程分组。S401. After detecting that the third application is installed, the terminal notifies the group management module to group the third application process corresponding to the third application.
其中,第三应用程序为终端需要安装的新的应用程序,第三应用程序不同于第一应用程序和第二应用程序。The third application is a new application that the terminal needs to install, and the third application is different from the first application and the second application.
需要说明的是,终端也可以是检测到用户要求安装第三应用程序的操作后,就通知分组管理模块,本申请实施例不做限定。It should be noted that the terminal may also notify the group management module after detecting that the user requests to install the third application, which is not limited in the embodiment of the present application.
还需要说明的是,终端上安装应用程序通常有两类,一类是终端预置的应用程序,例如短信应用、照相应用、浏览器应用等。这些应用程序可以是终端首次开机时,由系统触发终端自行安装的。另一类是用户自己下载安装的,例如:美团应用、支付宝应用等,这些应用是有用户的操作触发终端安装的。无论是哪种安装方式,终端都可以在应用程序安装完成后,或开始安装后,通知分组管理模块。It should also be noted that there are usually two types of applications installed on the terminal, one is a terminal-preferred application, such as a short message application, a photography application, a browser application, and the like. These applications can be installed by the system trigger terminal when the terminal is first turned on. The other type is downloaded and installed by the user himself, for example, the US group application, the Alipay application, etc., which are triggered by the user's operation to install the terminal. Regardless of the installation method, the terminal can notify the group management module after the application is installed or after the installation is started.
S402、分组管理模块根据分组策略将第三应用进程进行分组。S402. The packet management module groups the third application process according to the grouping policy.
具体的,分组管理根据第三应用进程的业务类型、或下载来源等信息确定第三应用进程所对应的分组,并将第三应用进程的标识与该分组标识建立对应关系,并保存在本地。Specifically, the group management determines the packet corresponding to the third application process according to the service type of the third application process, or the download source, and associates the identifier of the third application process with the group identifier, and saves the local.
进一步的,若第三应用进程为该分组中的第一个安装的应用程序时,分组管理模块请求加密模块为该分组创建新的分组密钥对,即执行步骤S403。若第三应用进程不是该分组中的第一个安装的应用程序时,分组管理模块直接建立第三应用进程与分组、密钥之间的对应关系,即执行步骤S406。Further, if the third application process is the first installed application in the packet, the packet management module requests the encryption module to create a new packet key pair for the packet, that is, step S403 is performed. If the third application process is not the first installed application in the group, the group management module directly establishes a correspondence between the third application process and the packet and the key, that is, step S406 is performed.
举例说明,假设第三应用进程为美团应用,第三应用进程所对应的分组为购物分组。那么,在美团应用安装完成时,或者在终端接收用户要求安装美团应用时,通知分组管理模块。分组管理模块将美团应用划分到购物分组。若美团应用是购物分组内的第一个安装的应用程序,在分组管理模块请求加密模块为该购物分组创建密钥对。若美团应用不是购物分组中第一个安装的应用程序,则分组管理模块直接将美团应用 与购物分组及购物分组的密钥建立对应关系。For example, it is assumed that the third application process is a US group application, and the group corresponding to the third application process is a shopping group. Then, when the installation of the Meituan application is completed, or when the terminal receives the user request to install the Meituan application, the packet management module is notified. The group management module divides the group application into a shopping group. If the group application is the first installed application within the shopping group, the group management module requests the encryption module to create a key pair for the shopping group. If the group application is not the first application installed in the shopping group, the group management module directly associates the group application with the key of the shopping group and the shopping group.
S403、分组管理模块向加密模块发送请求为第三应用进程所对应的分组创建密钥对。S403. The packet management module sends a request to the encryption module to create a key pair for the packet corresponding to the third application process.
其中,该请求中携带第三应用进程所对应的分组的标识。The request carries the identifier of the packet corresponding to the third application process.
S403a、加密模块为第三应用进程所对应的分组创建密钥对。S403. The encryption module creates a key pair for the packet corresponding to the third application process.
S404、加密模块将创建的密钥对存储在安全存储模块中。S404. The encryption module stores the created key pair in a secure storage module.
示例的,在安卓系统中,安全存储模块可以包括密钥库(keystore)和keymaster。其中,keystore用于存储的是密钥对的索引,用于提供其他应用使用密钥对的接口。keymaster用于存储密钥对的内容、及对数据进行加密解密处理。具体的,加密模块可以通过keystore将创建的密钥对存储在keymaster,由于keymaster与keystore物理隔离,能够提高密钥对的存储安全。For example, in the Android system, the secure storage module may include a keystore and a keymaster. The keystore is used to store an index of a key pair, and is used to provide an interface for other applications to use a key pair. The keymaster is used to store the contents of the key pair and encrypt and decrypt the data. Specifically, the encryption module can store the created key pair in the keymaster through the keystore. Since the keymaster is physically isolated from the keystore, the security of the key pair can be improved.
S405、加密模块将创建的密钥对的信息返回给分组管理模块。S405. The encryption module returns information of the created key pair to the group management module.
其中,密钥对的信息可以包括分组标识和密钥对的索引的对应关系。The information of the key pair may include a correspondence between the group identifier and the index of the key pair.
示例性的,加密模块可以将分组标识和密钥对的索引的对应关系返回给分组管理模块。当加密模块需要加密时,可以根据密钥对的索引从安全存储模块中查找到对应的加密密钥,采用查找到的加密密钥进行加密。当加密模块需要解密时,可以根据密钥对的索引从安全存储模块中查找到对应的解密密钥,采用查找到的解密密密钥进行解密。Exemplarily, the encryption module may return the correspondence between the packet identifier and the index of the key pair to the packet management module. When the encryption module needs to be encrypted, the corresponding encryption key can be found from the secure storage module according to the index of the key pair, and the encrypted key is used for encryption. When the encryption module needs to decrypt, the corresponding decryption key can be found from the secure storage module according to the index of the key pair, and the decrypted secret key is used for decryption.
其中,步骤S405也可以在S404之前或同时执行,本申请实施例不限定步骤S404和S405之间的顺序关系。The step S405 can also be performed before or at the same time as S404. The embodiment of the present application does not limit the order relationship between the steps S404 and S405.
S406、分组管理模块将第三应用进程与分组、密钥对建立对应关系。S406. The packet management module associates the third application process with the packet and the key pair.
示例性的,分组管理模块根据加密模块返回的分组标识和密钥对索引的对应关系,以及本地已有的第三应用进程的标识与分组标识的对应关系,建立第三应用进程的标识、分组标识和密钥对索引的对应关系。Exemplarily, the group management module establishes the identifier and grouping of the third application process according to the correspondence between the packet identifier and the key pair index returned by the encryption module, and the correspondence between the identifier of the third application process and the group identifier that are already existing in the local device. The correspondence between the identifier and the key pair index.
需要说明的是,如果某个分组中的应用程序发送变化,例如某个应用程序从一个分组变化到另一分组,分组管理模块需要更新应用程序与分组、密钥对的对应关系。It should be noted that if an application in a certain packet sends a change, for example, an application changes from one packet to another, the packet management module needs to update the correspondence between the application and the packet and the key pair.
举例说明,假设在某个分组内发送有恶意应用,可以将该恶意应用从该分组中剔除,换到另一个分组,不再允许该恶意应用访问本分组内其他应用的数据。或者,经过对业务性质的评估,发现某个应用可不必在某个分组内,则也可以从该分组中剔除,换到另一个分组。For example, if a malicious application is sent within a certain packet, the malicious application can be removed from the packet and switched to another packet, and the malicious application is no longer allowed to access data of other applications in the packet. Or, after evaluating the nature of the service, it is found that an application may not need to be within a certain group, and may also be removed from the group and switched to another group.
由此,本申请实施例提供一种数据处理的方法,能够对应用程序进行分组,并为该分组创建密钥对,建立应用程序与分组、密钥对的对应关系,从而能够实现同一分组内的应用程序使用同一密钥进行加解密。Therefore, the embodiment of the present application provides a data processing method, which can group an application, create a key pair for the packet, and establish a correspondence between the application and the packet and the key pair, thereby enabling the same packet to be implemented. The application uses the same key for encryption and decryption.
进一步的,对数据的加密过程中步骤S102~S104进行细化,那么,步骤S102~S104可替换为S501~S507,如图10所示,本申请实施例提供的数据处理方法还具体包括:Further, in the encryption process of the data, the steps S102 to S104 are refined. Then, the steps S102 to S104 can be replaced with S501 to S507. As shown in FIG. 10, the data processing method provided by the embodiment of the present application further includes:
S501、分组管理模块接收第一应用进程发送的第一数据。S501. The packet management module receives the first data sent by the first application process.
具体的,分组管理模块被第一应用进程调用,分组管理模块可以获取第一应用进程的标识。Specifically, the group management module is invoked by the first application process, and the group management module can obtain the identifier of the first application process.
S502、分组管理模块根据第一应用进程的标识,获取第一应用进程对应的加密密 钥或密钥对的索引。S502. The packet management module acquires an index of an encryption key or a key pair corresponding to the first application process according to the identifier of the first application process.
示例的,分组管理模块根据第一应用进程的标识,查找第一应用进程的标识对应的分组标识,进一步根据该分组标识确定该分组标识对应的加密密钥或密钥对的索引。而查找到的加密密钥或密钥对的索引对应着第一应用进程对应的加密密钥或密钥对。For example, the group management module searches for the group identifier corresponding to the identifier of the first application process according to the identifier of the first application process, and further determines an index of the encryption key or the key pair corresponding to the group identifier according to the group identifier. The index of the found encryption key or key pair corresponds to the encryption key or key pair corresponding to the first application process.
S503、分组管理模块将第一数据和获取到的加密密钥或密钥对的索引发送给加密模块。S503. The packet management module sends the first data and the obtained encryption key or an index of the key pair to the encryption module.
S504、加密模块根据加密密钥或密钥对的索引,从安全存储模块读取第一应用进程对应的加密密钥。S504. The encryption module reads the encryption key corresponding to the first application process from the secure storage module according to the encryption key or the index of the key pair.
S505、加密模块根据获取的加密密钥对第一数据进行加密,得到第二数据。S505. The encryption module encrypts the first data according to the obtained encryption key to obtain the second data.
S506、加密模块将得到的第二数据发送给分组管理模块。S506. The cryptographic module sends the obtained second data to the packet management module.
S507、分组管理模块将第二数据发送给第一应用进程。S507. The packet management module sends the second data to the first application process.
进一步的,对数据的解密过程中步骤S203~S206进行细化,那么,步骤S203~S206可替换为S601~S607,如图11所示,本申请实施例提供的数据处理方法还具体包括:Further, the steps S203 to S206 are performed in the process of decrypting the data. Then, the steps S203 to S206 can be replaced with S601 to S607. As shown in FIG. 11, the data processing method provided by the embodiment of the present application further includes:
S601、第一应用进程向分组管理模块请求对第三数据进行解密,请求中携带第二应用进程的标识和第三数据。S601. The first application process requests the packet management module to decrypt the third data, where the request carries the identifier of the second application process and the third data.
具体的,第一应用进程被第二应用进程调用时,第一应用进程可获取调用程序的标识,即第二应用进程的标识。Specifically, when the first application process is invoked by the second application process, the first application process may obtain the identifier of the calling program, that is, the identifier of the second application process.
S602、分组管理模块根据第二应用进程的标识,确定第二应用进程是否在第一应用进程所对应的分组。若是,则执行步骤S603。否则,分组管理模块不请求加密模块对第三数据进行解密,而是直接向第一应用进程返回第三数据。S602. The packet management module determines, according to the identifier of the second application process, whether the second application process is in a packet corresponding to the first application process. If yes, step S603 is performed. Otherwise, the packet management module does not request the encryption module to decrypt the third data, but directly returns the third data to the first application process.
具体的,分组管理模块被第一应用进程调用时,分组管理模块可获取调用者的标识,即第一应用进程的标识。分组管理模块可以根据第一应用进程的标识确定第一应用进程所对应的分组,以及该分组中包含的应用程序的标识。进一步的,分组管理模块可以根据第二应用进程的标识确定第二应用进程是否在该分组中。若第二应用进程在分组中,则分组管理模块请求加密模块对第三数据进行解密,即执行步骤S603。若第二应用进程不在分组中,则分组管理模块不请求加密模块对第三数据进行解密,而是直接向第一应用进程返回第三数据,而第一应用进程向第二应用进程返回第三数据。Specifically, when the group management module is invoked by the first application process, the group management module may obtain the identifier of the caller, that is, the identifier of the first application process. The packet management module may determine, according to the identifier of the first application process, a packet corresponding to the first application process and an identifier of the application included in the packet. Further, the packet management module may determine, according to the identifier of the second application process, whether the second application process is in the packet. If the second application process is in the group, the packet management module requests the encryption module to decrypt the third data, that is, step S603 is performed. If the second application process is not in the packet, the packet management module does not request the encryption module to decrypt the third data, but directly returns the third data to the first application process, and the first application process returns the third application process to the second application process. data.
S603、分组管理模块根据第一应用进程的标识,获取第一应用进程对应的解密密钥或密钥对的索引。S603. The packet management module acquires an index of a decryption key or a key pair corresponding to the first application process according to the identifier of the first application process.
示例的,分组管理模块根据第一应用进程的标识,查找第一应用进程的标识对应的分组标识,进一步根据该分组标识确定该分组标识对应的解密密钥或密钥对的索引。而查找到的解密密钥或密钥对的索引对应着第一应用进程对应的加密密钥或密钥对。For example, the group management module searches for the group identifier corresponding to the identifier of the first application process according to the identifier of the first application process, and further determines an index of the decryption key or the key pair corresponding to the group identifier according to the group identifier. The index of the decrypted key or key pair found corresponds to the encryption key or key pair corresponding to the first application process.
S604、分组管理模块将第三数据和获取到的解密密钥或密钥对的索引发送给加密模块。S604. The packet management module sends the third data and the obtained decryption key or an index of the key pair to the encryption module.
S605、加密模块根据解密密钥或密钥对的索引,从安全存储模块读取第一应用进程对应的解密密钥。S605. The encryption module reads the decryption key corresponding to the first application process from the secure storage module according to the decryption key or the index of the key pair.
S606、加密模块根据获取的解密密钥对第三数据进行解密,得到第四数据。S606. The encryption module decrypts the third data according to the obtained decryption key to obtain fourth data.
其中,第四数据为第三数据解密后的数据,为明文。The fourth data is data after the third data is decrypted, and is plaintext.
S607、加密模块将得到的第四数据发送给分组管理模块。S607. The encryption module sends the obtained fourth data to the packet management module.
S608、分组管理模块将第四数据发送给第一应用进程。S608. The packet management module sends the fourth data to the first application process.
可以理解的是,上述终端等为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明实施例的范围。It can be understood that, in order to implement the above functions, the above terminal and the like include hardware structures and/or software modules corresponding to each function. Those skilled in the art will readily appreciate that the embodiments of the present application can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the embodiments of the invention.
本申请实施例可以根据上述方法示例对上述终端等进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may perform the division of the function modules on the terminal or the like according to the foregoing method example. For example, each function module may be divided according to each function, or two or more functions may be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
在采用对应各个功能划分各个功能模块的情况下,图12示出了上述实施例中所涉及的终端的一种可能的结构示意图。如图12所示,终端1200包括:第一应用程序模块1201、第二应用程序模块1202和密钥管理模块1203。FIG. 12 shows a possible structural diagram of the terminal involved in the above embodiment in the case where the respective functional modules are divided by corresponding functions. As shown in FIG. 12, the terminal 1200 includes a first application module 1201, a second application module 1202, and a key management module 1203.
其中,第一应用程序模块1201用于支持终端执行图2中的S101、S102和S105,图4中的S202、S203和S207,图5中的S302,图10中的S501,图11中的S601和/或用于本文所描述的技术的其它过程。第二应用程序模块1202用于支持终端执行图4中的S201a和S201,和/或用于本文所描述的技术的其它过程。密钥管理模块1203用于支持终端执行图2中的S103和S104,图4中的S204-S206,图5中的S303-S305,图9中的S402-S406,图10中的S502-S507,图11中的S602-S608,和/或用于本文所描述的技术的其它过程。The first application module 1201 is configured to support the terminal to execute S101, S102, and S105 in FIG. 2, S202, S203, and S207 in FIG. 4, S302 in FIG. 5, S501 in FIG. 10, and S601 in FIG. And/or other processes for the techniques described herein. The second application module 1202 is for supporting the terminal to perform S201a and S201 in FIG. 4, and/or other processes for the techniques described herein. The key management module 1203 is configured to support the terminal to execute S103 and S104 in FIG. 2, S204-S206 in FIG. 4, S303-S305 in FIG. 5, S402-S406 in FIG. 9, and S502-S507 in FIG. S602-S608 in Figure 11, and/or other processes for the techniques described herein.
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。All the related content of the steps involved in the foregoing method embodiments may be referred to the functional descriptions of the corresponding functional modules, and details are not described herein again.
当然,终端1200还可以包括安全存储单元1204,用于存储本申请中的分组信息、加密密钥和解密密钥等。终端1200还可以包括通信单元,用于终端与其他设备进行交互。并且,上述功能单元的具体所能够实现的功能也包括但不限于上述实例所述的方法步骤对应的功能,终端1200的其他单元的详细描述可以参考其所对应方法步骤的详细描述,本申请实施例这里不再赘述。Of course, the terminal 1200 may further include a secure storage unit 1204 for storing group information, an encryption key, a decryption key, and the like in the present application. The terminal 1200 may further include a communication unit for the terminal to interact with other devices. The specific functions that can be implemented by the foregoing functional units include, but are not limited to, the functions corresponding to the method steps described in the foregoing examples. For detailed descriptions of other units of the terminal 1200, reference may be made to the detailed description of the corresponding method steps. The examples are not described here.
在采用集成的单元的情况下,上述第一应用程序模块1201、第二应用程序模块1202和密钥管理模块1203可以集成在一起,可以是终端的处理模块。上述的通信单元可以是终端的通信模块,如RF电路、WiFi模块或者蓝牙模块。上述安全存储单元可以是终端的存储模块。In the case of adopting an integrated unit, the first application module 1201, the second application module 1202, and the key management module 1203 may be integrated together, and may be a processing module of the terminal. The communication unit described above may be a communication module of the terminal, such as an RF circuit, a WiFi module, or a Bluetooth module. The above secure storage unit may be a storage module of the terminal.
图13示出了上述实施例中所涉及的终端的一种可能的结构示意图。该终端1300包括:处理模块1301、存储模块1302和通信模块1303。处理模块1301用于对终端的动作进行控制管理。存储模块1302,用于保存终端的程序代码和数据。通信模块1303用于与其他终端通信。其中,处理模块1301可以是处理器或控制器,例如可以是中央处理器(Central Processing Unit,CPU),通用处理器,数字信号处理器(Digital Signal Processor,DSP),专用集成电路(Application-Specific Integrated Circuit,ASIC), 现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本发明公开内容所描述的各种示例性的逻辑方框,模块和电路。所述处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等等。通信模块1303可以是收发器、收发电路或通信接口等。存储模块1302可以是存储器。FIG. 13 is a schematic diagram showing a possible structure of a terminal involved in the above embodiment. The terminal 1300 includes: a processing module 1301, a storage module 1302, and a communication module 1303. The processing module 1301 is configured to control and manage the actions of the terminal. The storage module 1302 is configured to save program codes and data of the terminal. The communication module 1303 is for communicating with other terminals. The processing module 1301 may be a processor or a controller, and may be, for example, a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), and an application-specific integrated circuit (Application-Specific). Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It is possible to implement or carry out the various illustrative logical blocks, modules and circuits described in connection with the present disclosure. The processor may also be a combination of computing functions, for example, including one or more microprocessor combinations, a combination of a DSP and a microprocessor, and the like. The communication module 1303 may be a transceiver, a transceiver circuit, a communication interface, or the like. The storage module 1302 can be a memory.
当处理模块1301为处理器(如图1所示的处理器101),通信模块1303为RF收发电路(如图1所示的射频电路102),存储模块1302为存储器(如图1所示的存储器103)时,本申请实施例所提供的终端可以为图1所示的终端100。其中,上述通信模块1303不仅可以包括RF电路,还可以包括WiFi模块和蓝牙模块。RF电路、WiFi模块和蓝牙模块等通信模块可以统称为通信接口。其中,上述处理器、通信接口和存储器可以通过总线耦合在一起。When the processing module 1301 is a processor (such as the processor 101 shown in FIG. 1), the communication module 1303 is an RF transceiver circuit (such as the RF circuit 102 shown in FIG. 1), and the storage module 1302 is a memory (as shown in FIG. 1). In the memory 103), the terminal provided by the embodiment of the present application may be the terminal 100 shown in FIG. 1. The communication module 1303 may include not only an RF circuit but also a WiFi module and a Bluetooth module. Communication modules such as RF circuits, WiFi modules, and Bluetooth modules can be collectively referred to as communication interfaces. Wherein, the above processor, communication interface and memory can be coupled together by a bus.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above functional modules is illustrated. In practical applications, the above functions can be allocated according to needs. It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the system, the device and the unit described above, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a flash memory, a mobile hard disk, a read only memory, a random access memory, a magnetic disk, or an optical disk, and the like, which can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any changes or substitutions within the technical scope of the present application should be covered by the scope of the present application. . Therefore, the scope of protection of the present application should be determined by the scope of the claims.

Claims (21)

  1. 一种数据处理的方法,其特征在于,应用于终端,所述终端运行第一应用进程、第二应用进程和密钥管理进程,所述方法包括:A data processing method is applied to a terminal, where the terminal runs a first application process, a second application process, and a key management process, and the method includes:
    所述第二应用进程向所述第一应用进程发送访问请求,所述访问请求用于请求访问所述第一应用进程的第三数据;The second application process sends an access request to the first application process, where the access request is used to request access to the third data of the first application process;
    所述密钥管理进程接收请求解密所述第三数据的解密请求;The key management process receives a decryption request requesting decryption of the third data;
    若所述密钥管理进程根据所述解密请求确定所述第二应用进程在所述第一应用进程所在的进程分组内,则所述密钥管理进程使用所述第一应用进程所在的进程分组对应的解密密钥解密所述第三数据,得到第四数据;If the key management process determines that the second application process is in the process group in which the first application process is located according to the decryption request, the key management process uses the process group in which the first application process is located. Decrypting the third data by the corresponding decryption key to obtain fourth data;
    响应于所述解密请求,所述密钥管理进程返回所述第四数据;Responding to the decryption request, the key management process returns the fourth data;
    其中,所述终端具有N个进程分组;所述N个进程分组中的每一个包含至少一个进程,并且至少有一个进程分组包含两个或两个以上的进程;其中,N为大于1或等于1的整数;所述N个进程分组对应M个解密密钥,且每一个进程分组对应一个解密密钥;其中,M为正整数,N>=M。Wherein the terminal has N process packets; each of the N process packets includes at least one process, and at least one process packet includes two or more processes; wherein N is greater than 1 or equal to An integer of 1; the N process packets correspond to M decryption keys, and each process packet corresponds to a decryption key; wherein M is a positive integer, N>=M.
  2. 根据权利要求1所述的方法,其特征在于,所述密钥管理进程接收请求解密所述第三数据的解密请求具体为The method according to claim 1, wherein the decryption request received by the key management process to request decryption of the third data is specifically
    所述密钥管理进程接收第一应用进程根据所述访问请求发送的所述解密请求;The key management process receives the decryption request sent by the first application process according to the access request;
    所述密钥管理进程返回所述第四数据具体为:The key management process returns the fourth data specifically:
    所述密钥管理进程向所述第一应用进程返回所述第四数据;The key management process returns the fourth data to the first application process;
    所述方法还包括:The method further includes:
    所述第一应用进程向所述第二应用进程发送所述第四数据。The first application process sends the fourth data to the second application process.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    若所述密钥管理进程确定所述第二应用进程不在所述第一应用进程所在的进程分组内,则所述密钥管理进程向所述第一应用进程发送所述第三数据;If the key management process determines that the second application process is not in the process group in which the first application process is located, the key management process sends the third data to the first application process;
    所述第一应用进程向所述第二应用进程发送所述第三数据。The first application process sends the third data to the second application process.
  4. 根据权利要求1所述的方法,其特征在于,所述第二应用进程向所述第一应用进程发送访问请求之后,所述密钥管理进程接收请求解密所述第三数据的解密请求之前,所述方法还包括:The method according to claim 1, wherein after the second application process sends an access request to the first application process, the key management process receives a decryption request requesting decryption of the third data, The method further includes:
    所述第二应用进程接收所述第一应用进程发送的所述第三数据;Receiving, by the second application process, the third data sent by the first application process;
    所述密钥管理进程接收请求解密所述第三数据的解密请求具体为:The decryption request received by the key management process to request decryption of the third data is specifically:
    所述密钥管理进程接收所述第二应用进程发送的所述解密请求;Receiving, by the key management process, the decryption request sent by the second application process;
    所述密钥管理进程返回所述第四数据具体为:The key management process returns the fourth data specifically:
    所述密钥管理进程向所述第二应用进程返回所述第四数据。The key management process returns the fourth data to the second application process.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, wherein the method further comprises:
    若所述密钥管理进程确定所述第二应用进程不在所述第一应用进程所在的进程分组内,则所述密钥管理进程向所述第二应用进程发送所述第三数据。And if the key management process determines that the second application process is not in the process group in which the first application process is located, the key management process sends the third data to the second application process.
  6. 根据权利要求1-5任一项所述的方法,其特征在于,在所述密钥管理进程使用所述第一应用进程所在的进程分组对应的解密密钥解密所述第三数据,得到第四数据之前,所述方法还包括:The method according to any one of claims 1 to 5, wherein the third key data is decrypted by the key management process using a decryption key corresponding to the process group in which the first application process is located, and the third data is obtained. Before the four data, the method further includes:
    所述密钥管理进程获取所述第一应用进程的标识;The key management process acquires an identifier of the first application process;
    所述密钥管理进程根据所述第一应用进程的标识,确定所述第一应用进程所在的进程分组的标识;Determining, by the key management process, an identifier of a process group in which the first application process is located, according to an identifier of the first application process;
    所述密钥管理进程根据所述第一应用进程所在的进程分组的标识,获取所述第一应用进程所在的进程分组对应的解密密钥。The key management process acquires a decryption key corresponding to the process group in which the first application process is located, according to the identifier of the process group in which the first application process is located.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 6, wherein the method further comprises:
    所述第一应用进程请求所述密钥管理进程对第一数据进行加密;The first application process requests the key management process to encrypt the first data;
    所述密钥管理进程根据所述请求确定所述第一应用进程所在的进程分组;Determining, by the key management process, a process group in which the first application process is located according to the request;
    所述密钥管理进程使用所述第一应用进程所在的进程分组对应的加密密钥对所述第一数据进行加密,生成第二数据;所述N个进程分组对应M个加密密钥,且每一个进程分组对应一个与其解密密钥相对应的加密密钥;The key management process encrypts the first data by using an encryption key corresponding to the process group in which the first application process is located, and generates second data; the N process packets correspond to M encryption keys, and Each process group corresponds to an encryption key corresponding to its decryption key;
    所述密钥管理进程向所述第一应用进程发送所述第二数据。The key management process sends the second data to the first application process.
  8. 根据权利要求7所述的方法,其特征在于,在所述密钥管理进程向所述第一应用进程发送所述第二数据之后,所述方法还包括:The method according to claim 7, wherein after the key management process sends the second data to the first application process, the method further includes:
    所述第一应用进程保存所述第二数据。The first application process saves the second data.
  9. 根据权利要求8所述的方法,其特征在于,所述密钥管理进程根据所述请求确定所述第一应用进程所在的进程分组包括:The method according to claim 8, wherein the determining, by the key management process, the process group in which the first application process is located according to the request includes:
    所述密钥管理进程获取所述第一应用进程的标识;The key management process acquires an identifier of the first application process;
    所述密钥管理进程根据所述第一应用进程的标识,确定所述第一应用进程所在的进程分组的标识;Determining, by the key management process, an identifier of a process group in which the first application process is located, according to an identifier of the first application process;
    所述密钥管理进程根据所述第一应用进程所在的进程分组的标识,获取所述第一应用进程所在的进程分组对应的加密密钥。The key management process acquires an encryption key corresponding to the process group in which the first application process is located, according to the identifier of the process group in which the first application process is located.
  10. 一种终端,其特征在于,包括第一应用程序模块、第二应用程序模块和密钥管理模块,A terminal, comprising: a first application module, a second application module, and a key management module,
    所述第二应用程序模块,用于向所述第一应用程序模块发送访问请求,所述访问请求用于请求访问第一应用进程的第三数据;The second application module is configured to send an access request to the first application module, where the access request is used to request access to third data of the first application process;
    所述密钥管理模块,用于接收请求解密所述第三数据的解密请求;The key management module is configured to receive a decryption request for decrypting the third data;
    所述密钥管理模块,还用于若所述密钥管理模块根据所述解密请求确定第二应用进程在所述第一应用进程所在的进程分组内,则使用所述第一应用进程所在的进程分组对应的解密密钥解密所述第三数据,得到第四数据;The key management module is further configured to: if the key management module determines, according to the decryption request, that the second application process is in a process group in which the first application process is located, where the first application process is located Decrypting a key corresponding to the process packet to decrypt the third data to obtain fourth data;
    所述密钥管理模块,还用于响应于所述解密请求,返回所述第四数据;The key management module is further configured to return the fourth data in response to the decryption request;
    其中,所述终端具有N个进程分组;所述N个进程分组中的每一个包含至少一个进程,并且至少有一个进程分组包含两个或两个以上的进程;其中,N为大于1或等于1的整数;所述N个进程分组对应M个解密密钥,且每一个进程分组对应一个解密密钥;其中,M为正整数,N>=M。Wherein the terminal has N process packets; each of the N process packets includes at least one process, and at least one process packet includes two or more processes; wherein N is greater than 1 or equal to An integer of 1; the N process packets correspond to M decryption keys, and each process packet corresponds to a decryption key; wherein M is a positive integer, N>=M.
  11. 根据权利要求10所述的终端,其特征在于,The terminal according to claim 10, characterized in that
    所述密钥管理模块,还用于接收第一应用程序模块根据所述访问请求发送的所述解密请求:The key management module is further configured to receive the decryption request sent by the first application module according to the access request:
    所述密钥管理模块,还用于向所述第一应用程序模块返回所述第四数据;The key management module is further configured to return the fourth data to the first application module;
    所述第一应用程序模块,用于向所述第二应用程序模块发送所述第四数据。The first application module is configured to send the fourth data to the second application module.
  12. 根据权利要求10或11所述的终端,其特征在于,所述密钥管理模块,还用于若所述密钥管理模块确定所述第二应用进程不在所述第一进程所在的进程分组内,则向所述第一应用程序模块发送所述第三数据;The terminal according to claim 10 or 11, wherein the key management module is further configured to: if the key management module determines that the second application process is not in a process group in which the first process is located Transmitting, to the first application module, the third data;
    所述第一应用程序模块,还用于向所述第二应用程序模块发送所述第三数据。The first application module is further configured to send the third data to the second application module.
  13. 根据权利要求10所述的终端,其特征在于,The terminal according to claim 10, characterized in that
    所述第二应用程序模块,还用于接收所述第一应用程序模块发送的所述第三数据;The second application module is further configured to receive the third data sent by the first application module;
    所述密钥管理模块,还用于接收所述第二应用程序模块发送的所述解密请求;The key management module is further configured to receive the decryption request sent by the second application module;
    所述密钥管理模块,还用于向所述第二应用程序模块返回所述第四数据。The key management module is further configured to return the fourth data to the second application module.
  14. 根据权利要求13所述的终端,其特征在于,所述密钥管理模块,还用于若所述密钥管理模块确定所述第二应用进程不在所述第一应用进程所在的进程分组内,则向所述第二应用程序模块发送所述第三数据。The terminal according to claim 13, wherein the key management module is further configured to: if the key management module determines that the second application process is not in a process group in which the first application process is located, And transmitting the third data to the second application module.
  15. 根据权利要求10-14任一项所述的终端,其特征在于,A terminal according to any of claims 10-14, characterized in that
    所述密钥管理模块,还用于获取所述第一应用程序模块的标识;The key management module is further configured to acquire an identifier of the first application module.
    所述密钥管理模块,还用于根据所述第一应用程序模块的标识,确定所述第一应用程序模块所在的进程分组的标识;The key management module is further configured to determine, according to the identifier of the first application module, an identifier of a process group in which the first application module is located;
    所述密钥管理模块,还用于根据所述第一应用程序模块所在的进程分组的标识,获取所述第一应用程序模块所在的进程分组对应的解密密钥。The key management module is further configured to acquire, according to the identifier of the process group in which the first application module is located, a decryption key corresponding to the process group in which the first application module is located.
  16. 根据权利要求10-15任一项所述的终端,其特征在于,A terminal according to any of claims 10-15, characterized in that
    所述第一应用程序模块,还用于请求所述密钥管理模块对第一数据进行加密;The first application module is further configured to request the key management module to encrypt the first data;
    所述密钥管理模块,还用于根据所述请求确定所述第一应用程序模块所在的进程分组;The key management module is further configured to determine, according to the request, a process group in which the first application module is located;
    所述密钥管理模块,还用于使用所述第一应用程序模块所在的进程分组对应的加密密钥对所述第一数据进行加密,生成第二数据;所述N个进程分组对应M个加密密钥,且每一个进程分组对应一个与其解密密钥相对应的加密密钥;The key management module is further configured to encrypt the first data by using an encryption key corresponding to the process group in which the first application module is located, to generate second data; and the N process groups correspond to M Encryption key, and each process packet corresponds to an encryption key corresponding to its decryption key;
    所述密钥管理模块,还用于向所述第一应用程序模块发送所述第二数据。The key management module is further configured to send the second data to the first application module.
  17. 根据权利要求16所述的终端,其特征在于,The terminal of claim 16 wherein:
    所述第一应用程序模块,还用于保存所述第二数据。The first application module is further configured to save the second data.
  18. 根据权利要求17所述的终端,其特征在于,The terminal according to claim 17, wherein
    所述密钥管理模块,还用于获取所述第一应用程序模块的标识;The key management module is further configured to acquire an identifier of the first application module.
    所述密钥管理模块,还用于根据所述第一应用程序模块的标识,确定所述第一应用程序模块所在的进程分组的标识;The key management module is further configured to determine, according to the identifier of the first application module, an identifier of a process group in which the first application module is located;
    所述密钥管理模块,还用于根据所述第一应用程序模块所在的进程分组的标识,获取所述第一应用程序模块所在的进程分组对应的加密密钥。The key management module is further configured to acquire an encryption key corresponding to the process group in which the first application module is located according to the identifier of the process group in which the first application module is located.
  19. 一种终端,其特征在于,包括:处理器、存储器和触摸屏,所述存储器、所述触摸屏与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,当所述处理器从所述存储器中读取所述计算机指令,以执行如权利要求1-9中任一项所述数据处理的方法。A terminal, comprising: a processor, a memory and a touch screen, the memory, the touch screen being coupled to the processor, the memory for storing computer program code, the computer program code comprising computer instructions, The method of reading the computer instructions from the memory to perform the data processing of any of claims 1-9.
  20. 一种计算机存储介质,其特征在于,包括计算机指令,当所述计算机指令在 终端上运行时,使得所述终端执行如权利要求1-9中任一项所述数据处理的方法。A computer storage medium comprising computer instructions for causing said terminal to perform a method of data processing according to any of claims 1-9 when said computer instructions are run on a terminal.
  21. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-9中任一项所述数据处理的方法。A computer program product, wherein the computer program product, when run on a computer, causes the computer to perform the method of data processing according to any one of claims 1-9.
PCT/CN2017/120132 2017-12-29 2017-12-29 Grouped application using same key for sharing data WO2019127468A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2017/120132 WO2019127468A1 (en) 2017-12-29 2017-12-29 Grouped application using same key for sharing data
CN201780082026.7A CN110140124B (en) 2017-12-29 2017-12-29 Packet applications share data using the same key

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/120132 WO2019127468A1 (en) 2017-12-29 2017-12-29 Grouped application using same key for sharing data

Publications (1)

Publication Number Publication Date
WO2019127468A1 true WO2019127468A1 (en) 2019-07-04

Family

ID=67063227

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/120132 WO2019127468A1 (en) 2017-12-29 2017-12-29 Grouped application using same key for sharing data

Country Status (2)

Country Link
CN (1) CN110140124B (en)
WO (1) WO2019127468A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113746777B (en) * 2020-05-27 2023-01-06 华为技术有限公司 Method for safely accessing data and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103796199A (en) * 2014-02-19 2014-05-14 郑州轻工业学院 Authenticable asymmetrical group secret key negotiation method in mobile unbalanced network
CN105260663A (en) * 2015-09-15 2016-01-20 中国科学院信息工程研究所 Secure storage service system and method based on TrustZone technology
US9361163B2 (en) * 2013-11-28 2016-06-07 Good Technology Corporation Managing containerized applications on a mobile device while bypassing operating system implemented inter process communication
CN107133498A (en) * 2017-04-20 2017-09-05 北京安云世纪科技有限公司 A kind of privacy application management method and device and mobile terminal

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7669226B2 (en) * 2004-07-30 2010-02-23 International Business Machines Corporation Generic declarative authorization scheme for Java
CN106650508A (en) * 2010-12-29 2017-05-10 凡诺尼斯系统有限公司 Method and device for determining data access permission of user group for data element group
CN103888252A (en) * 2012-12-19 2014-06-25 深圳市华营数字商业有限公司 UID, PID, and APPID-based control application access permission method
CN104980269A (en) * 2014-04-03 2015-10-14 华为技术有限公司 Secret key sharing method, device and system
CN104717232B (en) * 2015-04-09 2018-01-19 武汉理工大学 A kind of cryptographic system towards group
CN106156557B (en) * 2015-04-10 2019-08-06 海信集团有限公司 A kind of method and terminal of starting application
CN105634740A (en) * 2015-06-29 2016-06-01 宇龙计算机通信科技(深圳)有限公司 Fingerprint password verification method, system and terminal
US10747763B2 (en) * 2016-05-11 2020-08-18 International Business Machines Corporation Efficient multiple aggregation distinct processing
CN106056000B (en) * 2016-06-24 2019-12-24 北京奇虎科技有限公司 Mobile device storage partition configuration method and device based on system permission
CN107463823A (en) * 2017-07-31 2017-12-12 广东欧珀移动通信有限公司 Mobile terminal and application control method, computer-readable recording medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9361163B2 (en) * 2013-11-28 2016-06-07 Good Technology Corporation Managing containerized applications on a mobile device while bypassing operating system implemented inter process communication
CN103796199A (en) * 2014-02-19 2014-05-14 郑州轻工业学院 Authenticable asymmetrical group secret key negotiation method in mobile unbalanced network
CN105260663A (en) * 2015-09-15 2016-01-20 中国科学院信息工程研究所 Secure storage service system and method based on TrustZone technology
CN107133498A (en) * 2017-04-20 2017-09-05 北京安云世纪科技有限公司 A kind of privacy application management method and device and mobile terminal

Also Published As

Publication number Publication date
CN110140124B (en) 2021-04-20
CN110140124A (en) 2019-08-16

Similar Documents

Publication Publication Date Title
US11088836B2 (en) Key updating method, apparatus, and system
US11934505B2 (en) Information content viewing method and terminal
CN107222485B (en) Authorization method and related equipment
CN113821835B (en) Key management method, key management device and computing equipment
RU2628488C2 (en) Method, terminal device and server for nfc data transfer
WO2019061362A1 (en) Method and device for accessing device identifiers
WO2017211205A1 (en) Method and device for updating whitelist
WO2018201991A1 (en) Data processing method, system, apparatus, storage medium, and device
US11343233B2 (en) Node control method and related apparatus in distributed system
CN107145794B (en) Data processing method and device and mobile terminal
US20160301530A1 (en) Sensitive operation verification method, apparatus, and system
US20140258734A1 (en) Data security method and electronic device implementing the same
CN111357255B (en) Building a trusted application common to multiple applications
CN113821803B (en) Security architecture system, security management method and computing device
WO2019148397A1 (en) Storage of decomposed sensitive data in different application environments
EP4187422A1 (en) Security architecture system, cryptographic operation method for security architecture system, and computing device
EP4187420A1 (en) Resource management method, computing device, computing equipment, and readable storage medium
WO2019024882A1 (en) Method for automatically encrypting short message, storage device and mobile terminal
CN110825465B (en) Log data processing method and device, electronic equipment and storage medium
WO2019127468A1 (en) Grouped application using same key for sharing data
CN117171813A (en) Customized watermark adding method, device, terminal and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17936055

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17936055

Country of ref document: EP

Kind code of ref document: A1