WO2020048289A1 - System and method for processing user information - Google Patents

System and method for processing user information Download PDF

Info

Publication number
WO2020048289A1
WO2020048289A1 PCT/CN2019/099943 CN2019099943W WO2020048289A1 WO 2020048289 A1 WO2020048289 A1 WO 2020048289A1 CN 2019099943 W CN2019099943 W CN 2019099943W WO 2020048289 A1 WO2020048289 A1 WO 2020048289A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
information
terminal device
request
user information
Prior art date
Application number
PCT/CN2019/099943
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 深圳市红砖坊技术有限公司
Publication of WO2020048289A1 publication Critical patent/WO2020048289A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Definitions

  • the embodiments of the present application relate to the field of computer technology, and in particular, to a system and method for processing user information.
  • an end user uses an application installed on a terminal device or accesses a website
  • the user or user in order to obtain various services provided by the application or website, the user or user must first enter the correct user name and password to log in to the application or website.
  • To obtain the user information of the user by using the user name and password of the user, so as to customize the service for the user according to the obtained user information.
  • Service providers of applications or websites can use data mining technology to profile users based on user information, so as to provide users with more accurate services.
  • various problems such as the abuse of private data brought by the management of user information, endless advertising harassment, leakage of user information, and the prevalence of fraud have also arisen.
  • the embodiments of the present application propose a system and method for processing user information.
  • an embodiment of the present application provides a system for processing user information.
  • the system includes: at least one terminal device and a server, and the server sets a trusted execution environment, where the terminal device is configured to: To the encrypted user information addition request including the user ID, the user information to be added, and the plaintext key, perform the key and user information encryption operation in the target trusted execution environment that supports the key and user information encryption operation, and get The ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added, and the user ID including the encrypted user information addition request, the obtained user information ciphertext, and the encryption mark are encrypted marks.
  • the user information addition request is sent to the server, where the encrypted mark is used to characterize that the user information in the user information addition request is encrypted user information ciphertext.
  • the key and user information encryption operations include: using the target trusted execution environment to store The encrypted plaintext key uses the key, and the plaintext key is encrypted to obtain the same as the plaintext key.
  • the terminal device is configured to:
  • the user information to be added and the unencrypted user information addition request marked as unencrypted are sent to the server as a user information addition request.
  • the unencrypted mark is used to characterize the user information in the user information addition request as Plaintext of unencrypted user information; a server configured to: in response to receiving a user information addition request sent by the terminal device, store the user identification, user information, and encryption mark in the received user information addition request in correspondence; the terminal The device is configured to: in response to detecting a user information query request, the user information query request includes a user identification, a ciphertext key, and a transfer key, and use the transfer key command public key to query the received user information query request.
  • the ciphertext key and the turnkey are encrypted to obtain a first turnkey command.
  • the server is configured to: in response to receiving the User information transfer request, query the user information and encryption token corresponding to the user ID in the received user information transfer request; in the trusted execution environment of the server, perform the user information transfer operation to get the same
  • the user information transfer request corresponding to the user information transfer request, and the obtained user transfer request information is sent to the terminal device that sent the received user information transfer request.
  • the user information transfer operation includes: using the server ’s The private key of the cryptographic instruction corresponding to the public key of the cryptographic instruction stored in the trusted execution environment decrypts the first cryptographic instruction in the received user information cryptographic request to obtain the ciphertext key and the cryptographic password Key; in response to determining that the found encryption token is an encrypted token, utilizing the encryption key stored in the server's trusted execution environment Decrypt the ciphertext key obtained by decryption to obtain the plaintext key; use the plaintext key obtained by decryption to decrypt the found user information to obtain the user information plaintext; in response to determining that the found encrypted token is an unencrypted token , Determine the found user information as user information plaintext; encrypt the obtained user information plaintext by using the decryption key to obtain the encrypted user information corresponding to the received user information secret request; terminal
  • the device is configured to: in response to receiving the encrypted user information corresponding to the transmitted user information encrypted request sent by the server, using the transmitted user information query request corresponding to the encrypted password in
  • an embodiment of the present application provides a method for processing user information, which is applied to a server in a system for processing user information.
  • the system for processing user information includes at least one terminal device and a server, and the server is configured A trusted execution environment.
  • the method includes: in response to receiving a user information addition request sent by a terminal device, storing a user identifier, user information, and encryption mark in the received user information addition request, and storing the encryption mark in a corresponding manner.
  • the user information in the user information adding request is an encrypted mark of the encrypted user information ciphertext or the user information in the user information adding request is an encrypted mark of the unencrypted user information plaintext; in response to receiving A user information transfer request sent to a terminal device, where the user information transfer request includes a user identification and a first transfer instruction, and queries the user information and the encryption token corresponding to the user identification in the received user information transfer request ; In the trusted execution environment, perform user information encryption operation, get The encrypted user information corresponding to the received encrypted user information request, and the obtained encrypted user information is sent to the terminal device that sends the received encrypted user information request.
  • the user information encrypted operation includes: : Use the private key of the cryptographic instruction corresponding to the public key of the cryptographic instruction stored in the trusted execution environment of the server to decrypt the first cryptographic instruction in the received user information cryptographic request to obtain the ciphertext key And the cipher key; in response to determining that the found encryption token is an encrypted token, using the encryption key stored in the trusted execution environment of the server to decrypt the encrypted ciphertext key with the key to obtain the plaintext key; The decrypted user information is decrypted using the plaintext key obtained to decrypt the user information plaintext; in response to determining that the found encrypted tag is an unencrypted tag, the found user information is determined to be the user information plaintext; the decrypted The encryption key encrypts the obtained user information in plain text, and obtains the encryption user information corresponding to the received user information encryption request .
  • an embodiment of the present application provides an apparatus for processing user information, which is applied to a server in a system for processing user information.
  • the system for processing user information includes at least one terminal device and a server, and the server is configured A trusted execution environment, the device includes: a user information adding unit configured to respond to a user information adding request sent by the terminal device, and correspond to the user identification, user information, and encryption token in the received user information adding request Storage, where the encryption tag is an encrypted tag used to characterize the user information in the user information addition request as encrypted user information ciphertext or the user information used to characterize the user information in the user information addition request is unencrypted user information plaintext Unencrypted mark; the user information query unit is configured to respond to receiving a user information transfer request from the terminal device, wherein the user information transfer request includes a user identification and a first transfer instruction, and the query and the received The user information corresponding to the user ID in the user information transfer request and Secret mark; user information transfer unit, configured to perform user information transfer operation in a
  • the user information transfer operation includes: using the transfer instruction private key corresponding to the transfer instruction public key stored in the trusted execution environment of the server. Key to decrypt the first encryption instruction in the received user information encryption request to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the server ’s available encryption token is used.
  • the encryption key stored in the message execution environment uses the key to decrypt the decrypted ciphertext key to obtain the plaintext key; the decrypted user key is used to decrypt the found user information to obtain the user information plaintext; Determine the found encrypted mark as unencrypted mark, determine the found user information as user information plaintext; use the decryption key obtained by decryption User information obtained plaintext is encrypted to obtain the index information corresponding to the user encrypted with the user secret information transfer requests received.
  • an embodiment of the present application provides a server, including: one or more processors; a storage device storing one or more programs thereon, when the one or more programs are processed by the one or more programs When the processor executes, the foregoing one or more processors implement the method as described in any implementation manner of the second aspect.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by one or more processors, the computer program is implemented as described in any implementation manner in the second aspect.
  • the system and method for processing user information provided in the embodiments of the present application, by adding user information to a server in a terminal device, autonomously selecting to add encrypted user information or unencrypted user information to the server, and in the server Whether the user information added to the corresponding record is encrypted.
  • the terminal device uses the terminal device to query the user information from the server: If the user information is encrypted, the terminal device needs to provide the corresponding ciphertext key corresponding to the plaintext key used when the user information is encrypted, and the server is trusted.
  • the plaintext key can be obtained by decrypting the ciphertext key, and the plaintext key is used to decrypt the user information to obtain the plaintext user information.
  • the turnkey provided during the device query encrypts the obtained user information plaintext to obtain the turnkey user information, so that the terminal device can use the turnkey to decrypt the turnkey user information to obtain the user information plaintext. That is, for programs outside the trusted execution environment in the server, the user information plaintext of the encrypted user information cannot be obtained, and thus the data mining analysis of the user information plaintext cannot be performed, thereby protecting the security of user information and data. .
  • FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
  • FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied;
  • FIG. 2A is a sequence diagram of an embodiment of a system for processing user information according to the present application.
  • 2B is a flowchart of an embodiment of a key and user information encryption operation according to the present application.
  • 2C is a flowchart of an embodiment of a user information transfer operation according to the present application.
  • FIG. 3A, FIG. 3B, FIG. 3F, FIG. 3H and FIG. 3K are timing diagrams of another embodiment of a system for processing user information according to the present application;
  • 3C is a flowchart of an embodiment of a first user ID generating operation according to the present application.
  • 3D is a flowchart of an embodiment of a user identity verification operation according to the present application.
  • 3E is a flowchart of an embodiment of a ciphertext generating operation of user authentication information according to the present application
  • 3G is a flowchart of an embodiment of a second user identifier generating operation according to the present application.
  • 3I is a flowchart of an embodiment of a ciphertext generating operation of user identification verification information according to the present application
  • 3J is a flowchart of an embodiment of a verification information generating operation according to the present application.
  • 3L is a flowchart of an embodiment of an information encryption operation according to the present application.
  • 3M is a flowchart of an embodiment of a first information decryption operation according to the present application.
  • FIG. 3O is a flowchart of an embodiment of an information transfer operation according to the present application.
  • FIG. 4 is a flowchart of an embodiment of a method for processing user information according to the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of a device for processing user information according to the present application.
  • FIG. 6 is a schematic structural diagram of a computer system suitable for implementing a server according to an embodiment of the present application.
  • FIG. 1 illustrates an exemplary system architecture 100 of an embodiment of a system for processing user information or a method for processing user information to which the present application can be applied.
  • the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105.
  • the network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105.
  • the network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
  • the user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like.
  • Various communication client applications can be installed on the terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and so on.
  • the terminal devices 101, 102, and 103 may be hardware or software.
  • the terminal devices 101, 102, and 103 can be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
  • the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules or as a single software or software module. It is not specifically limited here.
  • the server 105 may be a server provided with a Trusted Execution Environment (TEE, Trusted Execution Environment) and providing various services, such as a background server that provides support for web pages or applications displayed on the terminal devices 101, 102, and 103.
  • TEE Trusted Execution Environment
  • the background server may analyze and process the received user information addition request, user information query request, and other data, and feed back the processing result (for example, the encrypted user information) to the terminal device.
  • TEE is an operating environment coexisting with Rich OS (usually Android, etc.) on the device, and provides security services for Rich OS.
  • Rich OS usually Android, etc.
  • TEE has its own execution space.
  • the software and hardware resources that TEE can access are separated from Rich OS.
  • TEE provides a secure execution environment for Trusted Applications (TA), while also protecting the confidentiality, integrity, and access rights of resources and data of trusted applications.
  • TA Trusted Applications
  • TEE In order to ensure the trusted root of TEE itself, TEE must be verified and isolated from RichOS during the secure boot process.
  • each trusted application is independent of each other and cannot be accessed without authorization.
  • the TEE set in the server can be implemented in the following two ways:
  • TPM Trusted Platform Module
  • TCM Trusted Cryptographic Module
  • a cryptographic lock (commonly known as a software dog) is used to implement a trusted execution environment.
  • USB Universal Serial Bus
  • the software dogs not only provide file storage, but also support running customized programs.
  • SoftDog it is not necessary to limit the device type of the server, as long as the server has a USB interface, which reduces the device requirements for the server.
  • the SoftDog can be directly connected to the server using USB, and can also use TCP / IP communication to pull USB devices remotely and access the server as a remote logical device by using technologies such as USB Over Network. It can also be understood that there can be multiple, even thousands of such remote logical devices, forming a device pool service mode.
  • the method for processing user information provided in the embodiments of the present application is generally executed by the server 105, and accordingly, a device for processing user information is generally provided in the server 105.
  • terminal devices, networks, and servers in FIG. 1 are merely exemplary. According to implementation needs, there can be any number of terminal devices, networks, and servers.
  • timing diagram 200 of one embodiment of a system for processing user information according to the present application is shown.
  • the system for processing user information in the embodiments of the present application may include a server and at least one terminal device, a network connection between the server and at least one terminal device, and a trusted execution environment is set in the server.
  • the timing sequence 200 of an embodiment of a system for processing user information according to the present application may include the following steps:
  • Step 201 In response to detecting a request for adding encrypted user information, the terminal device executes the encryption operation of the key and the user information in a target trusted execution environment that provides support for the encryption operation of the key and the user information, and obtains a key corresponding to the plaintext key. Send the ciphertext key and the user information ciphertext corresponding to the user information to be added, and send the user information including the user ID in the encrypted user information addition request, the obtained user information ciphertext, and the encrypted user information marked as encrypted. To the server.
  • the target device when the terminal device detects a request for adding encrypted user information including a user identifier, user information to be added, and a plaintext key, the target device can perform credible execution of the target to support the encryption operation of the key and user information.
  • the key and user information encryption operations are performed to obtain the ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added.
  • the obtained user information ciphertext and encrypted user information added with the encrypted mark are sent to the server.
  • the encrypted mark is used to indicate that the user information in the user information adding request is an encrypted user information ciphertext.
  • the above key and user information encryption operation may include sub-step 2011 and sub-step 2012 shown in FIG. 2B:
  • the encrypted plaintext key in the target trusted execution environment is used to encrypt the plaintext key in the detected encrypted user information addition request to obtain a ciphertext key corresponding to the plaintext key.
  • DES Data Encrytion Standard
  • 3DES / TDEA Triple Data Encryption Algorithm, Triple Data Encryption Algorithm
  • AES Advanced Encryption Standard
  • Blowfish algorithm Blowfish algorithm
  • RC2 algorithm RC4 algorithm
  • RC5 algorithm IDEA algorithm (International Data Encryption Algorithm)
  • IDEA International Data Encryption Algorithm
  • the encrypted plaintext key stored in the target trusted execution environment cannot be stored outside the trusted execution environment of the electronic device where the target trusted execution environment is located, and the program in the target trusted execution environment can access the encryption.
  • the key for the plaintext key but programs outside the trusted execution environment of the electronic device where the target trusted environment is located cannot access the key for the encrypted plaintext key, which can ensure the availability of the electronic device where the target trusted execution environment is located.
  • the ciphertext key cannot be decrypted to obtain the plaintext key.
  • Sub-step 2012 Use the plaintext key to encrypt the user information to be added in the detected encrypted user information addition request to obtain the user information password corresponding to the detected user information to be added in the encrypted user information addition request. Text.
  • the terminal device may be any terminal device among at least one terminal device.
  • the target trusted execution environment may be a trusted execution environment set in the terminal device.
  • the terminal device may perform key and user information encryption operations in the trusted execution environment set in the terminal device.
  • the target trusted execution environment may also be a trusted execution environment set in other electronic devices connected to the terminal device network.
  • the terminal device may send an encrypted user information addition request to the electronic device provided with the trusted execution environment.
  • the electronic device performs a key and user information encryption operation in the trusted execution environment of the electronic device, and obtains a ciphertext key corresponding to the plaintext key and a user information ciphertext corresponding to the user information to be added, and then the above
  • the electronic device may send the obtained ciphertext key and user information ciphertext to the terminal device, so that the terminal device may include the user identifier included in the encrypted user information addition request, the obtained user information ciphertext, and the encryption mark as A request to add encrypted user information to the server is sent.
  • the terminal device may detect the encrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user uses the terminal device to access a new user registration page for the user to enter registered user information, and the user ID, user information to be added, and plaintext key are entered in the new user registration page. Indicates that the user wishes to encrypt the input user information to be encrypted using the input plaintext key, that is, for the user, the input user information to be added is sensitive information, and the user information to be added cannot be stored in plain text. In the server, it must be encrypted and stored in the server. At this time, the terminal device can determine that an encrypted user information addition request is detected.
  • the terminal device may also detect that the user has opened a new user registration interface in the application installed on the terminal device for the user to enter registered user information, and the user identification, user information to be added, and In the case of a plaintext key, it also indicates that the user wishes to use the entered plaintext key to encrypt the user information to be added, that is, for the user, the user information to be added is sensitive information and cannot be
  • the user information to be added is stored in the server in plain text, and must be encrypted and stored in the server.
  • the terminal device may also determine that an encrypted user information addition request is detected.
  • the user information to be added may include various attribute information of the user.
  • the user information to be added may include name, age, gender, mobile phone number, certificate number, nickname, avatar image, hobbies, occupation, income status, education, Hometown, Home Address, Work Address, etc.
  • the user identifier is used to uniquely identify each user corresponding to the user information stored by the server.
  • the user ID can include at least one of the following: numbers, characters, and text.
  • the ciphertext key generation process corresponding to the plaintext key and the user information ciphertext generation process can be separated.
  • the ciphertext key must be generated in the trusted execution environment, and the user information ciphertext can be generated in the trusted execution environment. If the current program execution environment is relatively secure (the possibility of resident rogue software or phishing software is low) and the In the case of standard encryption and decryption methods, it can also be generated outside the trusted execution environment.
  • step 202 the terminal device sends an unencrypted user information addition request to the server as a user information addition request in response to detecting an unencrypted user information addition request including a user identification, user information to be added, and an encrypted mark as an unencrypted mark.
  • the unencrypted flag is used to indicate that the user information in the user information adding request is plaintext of the user information that is not encrypted.
  • the terminal device may detect the unencrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user has accessed the new user registration page for the user to enter the registered user information using the terminal device, and the user ID and the user information to be added are entered in the new user registration page but the plaintext key is not entered. In this case, it indicates that the user does not want to encrypt the input user information to be added, that is, for the user, the input user information to be added is not sensitive information, and the user information to be added can be stored in plain text in the server. At this time, the terminal device may determine that an unencrypted user information addition request is detected.
  • the terminal device may also detect that the user has opened a new user registration interface in the application installed on the terminal device for the user to enter registered user information, and the user ID and user information to be added are entered in the new user registration interface but
  • the plaintext key is not entered, it also indicates that the user does not want to encrypt the input user information to be added, that is, for the user, the input user information to be added is not sensitive information, and the user to be added can be The information is stored in the server in clear text.
  • the terminal device may also determine that an unencrypted user information addition request is detected.
  • Step 203 In response to receiving the user information adding request sent by the terminal device, the server stores the user identifier, user information, and encryption mark in the received user information adding request in a corresponding manner.
  • the server may add a request for the received user information, whether it is a request for adding user information encrypted and marked as encrypted or a request for adding user information encrypted as unencrypted, the received user information may be added
  • the user ID, user information, and encryption token in the add request are stored correspondingly.
  • the server may store the user identification, user information, and encryption mark in the received user information addition request in a distributed database.
  • Step 204 In response to detecting the user information query request, the terminal device uses the public key of the cryptographic instruction to encrypt the ciphertext key and the cryptographic key in the received user information query request to obtain the first cryptographic instruction, and The user identification in the user information query request and the obtained first transfer password instruction are sent to the server as a user information transfer password request corresponding to the user information query request.
  • the terminal device may detect a user information query request, where the user information query request includes a user identifier, a ciphertext key, and a transfer key, and the received data is transferred using the transfer key public key.
  • the ciphertext key and the transfer key in the obtained user information query request are encrypted to obtain a first transfer password instruction, and the user ID and the obtained first transfer password instruction in the received user information query request are used as A user information transfer request corresponding to the received user information query request is sent to the server.
  • the user ID in the user information query request may be a user ID input by the user using the terminal device, that is, the user wants to query user information of the user indicated by the input user ID.
  • the user information is uploaded from the terminal device and stored to the server by the user using the terminal device through steps 201, 202, and 203. If the added user information is encrypted, the terminal device needs to provide the key used to encrypt the user information if it needs to query the encrypted user information, but to ensure security, the user information cannot be encrypted here.
  • the plaintext key used is sent to the server to prevent the server from using the plaintext key to decrypt the user information, thereby causing the server to leak or abuse the user information. From the description in step 201, when encrypting the user information in step 201, a ciphertext key corresponding to the plaintext key used to encrypt the user information is also generated, and the generated ciphertext key is also the same as that in step 201.
  • the encrypted user information in the corresponding request corresponds to the plaintext key.
  • the ciphertext key in the user information query request is the ciphertext key corresponding to the plaintext key in the encrypted user information adding request whose user identifier is the user identifier in the user information query request in step 201.
  • the user needs to memorize the ciphertext key generated for the plaintext key in step 201 so as to provide it when querying the user information.
  • each user ID of the terminal device and the corresponding ciphertext key may be stored correspondingly, for example, correspondingly stored in a correspondence table, or stored in the operating system of the terminal device. In the registry. In this way, the terminal device can obtain the ciphertext key corresponding to the user identity through the foregoing corresponding storage relationship.
  • the transfer key in the user information query request may be a key string received by the terminal device from the user, or the transfer key in the user information query request may be a key randomly generated by the terminal device.
  • using the public key of the cryptographic instruction to encrypt the ciphertext key and the cryptographic key in the received user information query request may use various asymmetric encryption algorithms known now or developed in the future, including but not limited to : RSA encryption algorithm, Elgamal algorithm, backpack algorithm, DH algorithm, ECC (Elliptic Curve Encryption Algorithm), etc.
  • the public key of the turnkey instruction used for encryption is the public key used in the asymmetric encryption process.
  • Step 205 The server, in response to receiving the user information transfer request sent by the terminal device, queries the user information and the encryption token corresponding to the user ID in the received user information transfer request, and in the trusted execution environment of the server, Perform the user information transfer encryption operation to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to the terminal device that sends the received user information transfer request.
  • the server Since the server correspondingly stores the user ID, user information, and encryption mark, the server can query the corresponding user ID in the received user information transfer request when receiving the user information transfer request sent by the terminal device. User information and encryption tokens, and perform the user information transfer operation in the trusted execution environment of the server to obtain the transfer user information corresponding to the received user information transfer request, and the obtained transfer user The information is sent to the terminal device that sends the received user information transfer request.
  • the above-mentioned operation of transferring user information may include sub-steps 2051 to 2052 as shown in FIG. 2C:
  • Sub-step 2051 using the private key of the cryptographic instruction corresponding to the public key of the cryptographic instruction stored in the trusted execution environment of the server, decrypting the first cryptographic instruction in the received user information cryptographic request to obtain the secret Text key and cipher key.
  • the private key of the cryptographic instruction here is the private key used for decryption corresponding to the public key of the cryptographic instruction used to encrypt the ciphertext key and the cryptographic key in the received user information query request in step 204.
  • the cryptographic instruction public key can be stored outside the server's trusted execution environment and inside the trusted execution environment.
  • the private key of the cryptographic instruction can only be stored in the trusted execution environment of the server or the terminal device.
  • the private key of the cryptographic instruction can only be accessed by the program in the trusted execution environment of the server or the terminal device. It cannot be accessed by the server. Access to programs outside the trusted execution environment and programs outside the trusted execution environment of the terminal device.
  • Sub-step 2052 in response to determining that the found encryption token is an encrypted token, using the encryption key stored in the trusted execution environment of the server to decrypt the encrypted ciphertext key with the key to obtain a plaintext key.
  • Sub-step 2053 Decrypt the found user information by using the decrypted plaintext key to obtain the user information plaintext.
  • Sub-step 2054 in response to determining that the found encrypted tag is an unencrypted tag, determining the found user information as user information plaintext.
  • Sub-step 2055 Encrypt the obtained user information in plain text by using the decrypted transfer key to obtain the transferred user information corresponding to the received user information transfer request.
  • the user information is encrypted in the server's trusted execution environment using the encryption key.
  • Programs outside the server's trusted execution environment can only obtain the encrypted message after the encryption key is encrypted. Confidential user information cannot be obtained in plain text of user information, thereby preventing the server from revealing plain text of user information.
  • Step 206 The terminal device, in response to receiving the user information corresponding to the user information transfer request sent by the server, uses the user information corresponding to the user information transfer request to query the transfer key in the request.
  • the received encrypted user information is decrypted to obtain the user information in plain text.
  • the user identifier in the encrypted user information addition request, the user identifier in the unencrypted user information addition request, and the user identifier in the user information query request may be the user identifier in the user identifier set of the terminal device. That is, for each terminal device, a user identifier set of the terminal device is stored in the terminal device.
  • the user identifier in the encrypted user information addition request detected by the terminal device in step 201 is the user identifier set stored in the terminal device.
  • the user ID in the unencrypted user information addition request detected by the terminal device in step 202 is also the user ID in the user ID set stored in the terminal device, and the user information query request detected by the terminal device in step 204
  • the user ID in is also the user ID in the user ID set stored in the terminal device.
  • the server may be a resource server supporting the OAuth2 protocol.
  • the system for processing user information provided by the foregoing embodiments of the present application, by adding user information to a server in a terminal device, autonomously chooses to add encrypted user information or unencrypted user information to the server, and in the server Whether the user information added to the corresponding record is encrypted.
  • a user uses a terminal device to query user information from the server, if the user information is encrypted, the terminal device needs to provide a corresponding ciphertext key corresponding to the plaintext key used when the user information is encrypted, and the trusted execution of the server
  • the plaintext key can be obtained by decrypting the ciphertext key in the environment, and then the plaintext key is used to decrypt the user information to obtain the plaintext user information.
  • the user information is not encrypted, you can directly obtain the plaintext user information, and then use the terminal device.
  • the encipherment key provided in the query is used to encrypt the obtained plaintext user information to obtain the enciphered user information. Therefore, on the terminal device, the enciphered user information can be decrypted using the encipherment key to obtain the plaintext of the user information, that is, For programs outside the trusted execution environment in the server, the user information plaintext of the encrypted user information cannot be obtained, and thus the data mining analysis of the user information plaintext cannot be performed, and the user information data is protected from leakage.
  • FIG. 3A illustrates a timing sequence 300 of yet another embodiment of a system for processing user information according to the present application.
  • the system for processing user information in the embodiments of the present application may include a server and at least one terminal device, a network connection between the server and at least one terminal device, and a trusted execution environment is set in the server.
  • the timing sequence 300 may include the following steps:
  • the terminal device responds to a request for adding encrypted user information including a user identifier, a user information range identifier, user information to be added, and a plaintext key, and targets a trusted execution environment for the key and user information encryption operations. , Perform encryption operations on the key and user information to obtain the ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added, and the user ID and user information included in the encrypted user information addition request.
  • the range identifier, the obtained user information ciphertext, and the user information encryption request that is encrypted and marked as encrypted are sent to the server.
  • the terminal device may provide support for the encryption operation of the key and the user information in a case where an encrypted user information addition request including a user ID, a user information range identifier, user information to be added, and a plaintext key is detected.
  • the target trusted execution environment perform key and user information encryption operations to obtain the ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added, and add the encrypted user information to the request And send a request for adding the user ID, the user information range ID, the obtained user information ciphertext, and the user information whose encryption mark is an encrypted mark to the server.
  • the encrypted mark is used to indicate that the user information in the user information adding request is an encrypted user information ciphertext.
  • the encryption operation of the key and the user information may include sub-steps 2011 and sub-steps 2012 as shown in FIG. 2B. For details, refer to the related description in step 201 in the embodiment shown in FIG. 2A, and details are not described herein again.
  • the terminal device the target trusted execution environment, the user information to be added, and the user identifier
  • the user information range identifier is used to indicate at least one kind of attribute information among various attribute information included in the user information, and it can also be understood that the user information range identifier is used to indicate at least one of various fields included in the user information.
  • various attribute information included in the user information may be classified according to the privacy degree and / or importance degree of each attribute information, and the user information range identifier to which each attribute information belongs is marked. For example, three user information range identifiers "1", "2", and “3" may be marked, where the user information range identifier "1" is used to indicate user attribute information with a low degree of privacy and / or importance, such as, “Interests and hobbies", “avatar pictures”, “nicknames”, etc.
  • the user information range identifier "2" is used to indicate user attribute information with a higher degree of privacy and / or importance, such as “name”, “gender”, “Age”, etc.
  • the user information range identifier "3" is used to indicate the user attribute information with the highest degree of privacy and / or importance, such as “mobile phone number”, “certificate number”, “home address”, “work address” and many more.
  • the terminal device may detect the encrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user has accessed the new user registration page for the user to input the registered user information using the terminal device, and the user identification, the user information range identification, the user information to be added, and the plain text are entered in the new user registration page. In the case of a key, it indicates that the user wishes to encrypt the user information to be added using the entered plaintext key, that is, for the user, the user information to be added is sensitive information, and the user information cannot be The added user information is stored in the server in clear text and must be stored in the server after encryption. At this time, the terminal device can determine that an encrypted user information addition request is detected.
  • the terminal device may also detect that the user has opened a new user registration interface in the application installed on the terminal device for the user to enter registered user information, and the user identification, user information range identifier, In the case of the user information to be added and the plaintext key, it also indicates that the user wishes to use the entered plaintext key to encrypt the user information to be added, that is, for the user, the user information to be added belongs to For sensitive information, the user information to be added cannot be stored in the server in plain text. It must be encrypted and stored in the server. At this time, the terminal device can also determine that an encrypted user information addition request is detected.
  • Step 302 The terminal device responds to detecting an unencrypted user information addition request including a user ID, a user information range identifier, user information to be added, and an encrypted mark that is an unencrypted mark, and sends the unencrypted user information addition request as a user information addition request. To the server.
  • the unencrypted flag is used to indicate that the user information in the user information adding request is plaintext of the user information that is not encrypted.
  • the terminal device may detect the unencrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user has used the terminal device to access a new user registration webpage for the user to enter registered user information, and the user identity, user information range identifier, and user information to be added are entered in the new user registration webpage but not yet When the plaintext key is entered, it indicates that the user does not want to encrypt the user information to be added, that is, for the user, the user information to be added is not sensitive information, and the user information to be added can be plaintext. Stored in the server, at this time, the terminal device can confirm that an unencrypted user information addition request is detected.
  • the terminal device may also detect that the user has opened an application installed on the terminal device for the user to input a new user registration interface for the registered user information, and a user identifier and a user information range identifier are entered in the new user registration interface
  • the user information to be added is not entered in the clear text key, it also indicates that the user does not want to encrypt the user information to be added, that is, for the user, the user information to be added is not sensitive information
  • the user information to be added can be stored in plain text in the server.
  • the terminal device can also confirm that an unencrypted user information addition request is detected.
  • Step 303 In response to receiving the user information adding request sent by the terminal device, the server stores the user identifier, the user information range identifier, the user information, and the encryption mark in the received user information adding request in a corresponding manner.
  • the server may add a request for the received user information, whether it is a request for adding user information encrypted and marked as encrypted or a request for adding user information encrypted as unencrypted, the received user information may be added
  • the user ID, user information range ID, user information, and encryption tag in the add request are correspondingly stored.
  • the server may store the user identification, user information range identification, user information, and encryption mark in the received user information addition request in a distributed database.
  • Step 304 In response to detecting the user information query request, the terminal device uses the public key of the cryptographic instruction to encrypt the ciphertext key and the cryptographic key in the received user information query request to obtain the first cryptographic instruction, and The user identifier and user information range identifier in the user information query request and the obtained first transfer password instruction are sent to the server as a user information transfer password request corresponding to the user information query request.
  • the terminal device may detect a user information query request, where the user information query request includes a user identifier, a user information range identifier, a ciphertext key, and a cipher key.
  • the public key encrypts the ciphertext key and the turnkey in the received user information query request to obtain a first turnkey instruction, and the user identifier and the user information range identifier in the received user information query request And the obtained first encryption instruction is sent to the server as a user information encryption request corresponding to the received user information query request.
  • the user ID in the user information query request may be a user ID input by the user using the terminal device, that is, the user wants to query user information of the user indicated by the input user ID.
  • the user information range identifier in the user information query request may be the user information range identifier input by the user using the terminal device, that is, the user wishes to query the user information range identifier range of the user indicated by the input user ID.
  • User Info may be the user information range identifier input by the user using the terminal device, that is, the user wishes to query the user information range identifier range of the user indicated by the input user ID.
  • Step 305 The server, in response to receiving the user information transfer request sent by the terminal device, queries the user information and the encryption mark corresponding to the user identifier and the user information range identifier in the received user information transfer request.
  • a user information transfer operation is performed to obtain the transfer user information corresponding to the received user information transfer request, and the obtained transferred user information is transmitted to the received user information transfer request.
  • the requested end device in response to receiving the user information transfer request sent by the terminal device, queries the user information and the encryption mark corresponding to the user identifier and the user information range identifier in the received user information transfer request.
  • the server can query and receive the user information transfer request when the user information transfer request is received from the terminal device.
  • the above-mentioned operation of transferring user information may include sub-step 2051 to sub-step 2052 as shown in FIG. 2C.
  • sub-step 2051 to sub-step 2052 as shown in FIG. 2C.
  • the user information is encrypted in the server's trusted execution environment using the encryption key.
  • Programs outside the server's trusted execution environment can only obtain the encrypted message after the encryption key is encrypted. Confidential user information cannot be obtained in plain text of user information, thereby preventing the server from revealing plain text of user information.
  • Step 306 The terminal device, in response to receiving the user information corresponding to the sent user information data encryption request sent by the server, uses the user information corresponding to the sent user information data encryption request to query the data encryption key in the request. The received encrypted user information is decrypted to obtain the user information in plain text.
  • step 306 is basically the same as the specific operation of step 206 in the embodiment shown in FIG. 2A, and details are not described herein again.
  • the user identifier in the encrypted user information addition request, the user identifier in the unencrypted user information addition request, and the user identifier in the user information query request may be the user identifier in the user identifier set of the terminal device.
  • FIG. 3B Due to the limitation of page display, the following reference is continued to FIG. 3B. It should be noted that the process of FIG. 3B may include various steps shown in FIG. 3A in addition to the steps shown in FIG. 3B. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3B can perform various steps that the terminal device shown in FIG. 3A can perform in addition to the corresponding steps shown in FIG. 3B. step.
  • this embodiment may have the following optional implementations:
  • At least one terminal device in a system for processing user information may include at least one first terminal device that sets a trusted execution environment, and the above-mentioned sequence 300 may further include steps as shown in FIG. 3B 307:
  • Step 307 In response to detecting the first user ID generation request including the first user ID category ID, the first terminal device executes the first user ID generation operation in the trusted execution environment of the first terminal device, and obtains the first user ID generation request. A user ID corresponding to a user ID generation request, and adding the obtained user ID to a user ID set of the first terminal device.
  • the terminal device may detect the first user identifier generation request in various implementation manners. For example, the terminal device may detect that the user uses the terminal device to access a user identification generating page including a page element (for example, a text box or a drop-down menu) for the user to input the user identification category identification, and the user identification category is entered in the foregoing.
  • a page element for example, a text box or a drop-down menu
  • the terminal device may also detect that the user has opened a user ID generation interface in an application installed on the terminal device, entered a first user ID category ID, and clicked a control (for example, associated with a first user ID generation operation) (for example, , Button), it is determined that the first user ID generation request is detected.
  • a control for example, associated with a first user ID generation operation
  • the first user identifier category identifier is used to indicate a category of a user identifier in a user identifier set of the first terminal device.
  • user identifiers in a user identifier set can be classified in various ways, each classification corresponding to a different first user identifier category, and the first user identifier category identifier is used to indicate a different first user identifier category.
  • the classification may be performed according to the type of the application to which the generated user ID is applied. For example, if the user wishes to generate a user ID for a social application or a social website, then the user may enter or select a social application or a social website.
  • the corresponding user identifier category identifier generates a first user identifier generation request. For another example, if the user wishes to generate a user identification of a shopping application or a shopping website, then a user identification category identifier corresponding to the shopping application or a shopping website may be input or selected to generate a first user identification generating request. As an example, the first user identifier category identifier may also be determined in an incremental manner, that is, the first terminal device may store the current first user identifier category identifier.
  • the first The terminal device may obtain the current first user identification category identifier stored above, and incrementally update the acquired current first user identification category identifier, and generate a first user identification generation request using the current first user identification category identifier after the incremental update. .
  • a first user identifier generation operation is performed to obtain A user ID corresponding to the first user ID generation request, and adding the obtained user ID to a user ID set of the first terminal device.
  • the foregoing first user identifier generating operation may include sub-steps 3071 to 3073 as shown in FIG. 3C:
  • Sub-step 3071 obtaining an environment identifier including a manufacturer identifier and a product identifier, which is used to indicate the trusted execution environment of the first terminal device.
  • the environment identification of the trusted execution environment is used to uniquely identify the trusted execution environment.
  • the environment identification of the trusted execution environment may include a manufacturer identification and a product identification.
  • the manufacturer identification of the trusted execution environment is used to uniquely identify different trusted execution environments.
  • the manufacturer of the execution environment, and the product identification is used to uniquely identify the trusted execution environment produced by the same trusted execution environment manufacturer.
  • the trusted execution environment usually has a manufacturer's logo and a product logo set at the factory, and cannot be modified.
  • the environment logo of the trusted execution environment can only be stored in the trusted execution environment and within the trusted execution environment.
  • the program of the trusted execution environment can access the environment identification of the trusted execution environment, while the program of the trusted execution environment cannot access the environment identification of the trusted execution environment.
  • the environmental identification can include at least one of the following: numbers, characters, and text.
  • step 3072 a random number is generated randomly.
  • Sub-step 3073 Encrypt the first extended user identifier by using the user identifier key stored in the trusted execution environment of the first terminal device to obtain a user identifier corresponding to the first user identifier generation request.
  • the first extended user identifier may include the environment identifier obtained in sub-step 3071, the generated random number, and the first user identifier category identifier in the first user identifier generation request received in step 307.
  • the user identification key can only be stored in the trusted execution environment, and can only be accessed by programs within the trusted execution environment, and cannot be accessed by programs outside the trusted execution environment.
  • the user identification generated in step 307 is generated based on the environment identification of the trusted execution environment of the first terminal device, and the generated random number and the first user identification category identification are also added. As for the program, only the generated user ID can be obtained, but the environment ID in the generated user ID cannot be parsed.
  • the user ID in the user ID set of the terminal device can be protected from being cracked by a program outside the trusted execution environment, so that the user ID in the end user ID set is used as the user ID in the encrypted user information addition request, or, The user ID in the end user ID set is used as the user ID in the unencrypted user information addition request, and the user ID in the user information addition request sent to the server is also the user ID in the user ID set of the terminal device, that is, Corresponds to the user ID and user information stored on the server
  • the user ID in the security ID, user information, and encryption mark is also the user ID in the user ID set of the terminal device, and programs outside the trusted execution environment of the server cannot resolve the user ID in the user information stored by the server, and then It is not possible to correlate each user ID in the user ID set of the same terminal device to perform big data analysis, thereby protecting the privacy and security of user information.
  • the timing sequence 300 may further include step 308 as shown in FIG. 3B:
  • Step 308 The first terminal device responds to detecting a user identification verification request including a user identity to be verified and information to be encrypted, executes a user identity verification operation in a trusted execution environment of the first terminal device, and obtains a verification request with the user identity. Corresponding verification results.
  • the first terminal device may detect the user identity verification request in various implementation manners. For example, for example, when the first terminal device detects that the user has opened and reinstalled an application for processing user information, in order to determine that the user identifier in the user identifier set of the first terminal device is the user identifier of the first terminal device , For each user tag in the user identity set of the first terminal device, a user identity verification request may be generated by using the user identity as the user identity to be verified, and if the user identity verification result is obtained, the user is authenticated. The identity is retained in the user identity set of the first terminal device, and if a non-user identity verification result is obtained, the user identity is deleted from the user identity set of the first terminal device.
  • the first terminal device may perform a user ID verification operation in a trusted execution environment of the first terminal device when a user ID verification request including a user ID to be authenticated and information to be encrypted is detected, to obtain a user ID
  • the verification result corresponding to the verification request may be randomly generated information or any preset information content.
  • the above-mentioned user identity verification operation may include sub-steps 3081 to 3087 shown in FIG. 3D:
  • Sub-step 3081 the user identification key stored in the trusted execution environment of the first terminal device is used to decrypt the to-be-verified user ID to obtain the extended user ID to be verified.
  • the user identity to be verified is obtained by encrypting the extended user identity to be verified with the user identity key stored in the trusted execution environment of the first terminal device, here, it is stored in the trusted execution environment of the first terminal device. If the user ID key to be authenticated is decrypted, the extended user ID to be verified can be obtained.
  • Sub-step 3082 generates a first key according to a preset algorithm according to an environment identifier in the extended user identifier to be verified.
  • generating the first key according to the environment identifier in the extended user identifier to be verified may be performed as follows: combining the environment identifier in the extended user identifier to be verified and the trusted execution environment stored in the first terminal device A predetermined key component identifier (for example, it may be a preset constant) to obtain the first key.
  • generating the first key according to the environment identifier in the extended user identifier to be verified may also be performed as follows: the environment identifier in the extended user identifier to be verified and the trusted execution environment of the first terminal device An XOR operation is performed on a preset mask stored in the memory to obtain a first key.
  • Sub-step 3083 Use the generated first key to encrypt the information to be encrypted to obtain the first encrypted information.
  • Sub-step 3084 according to a preset algorithm, generating a second key according to an environment identifier of a trusted execution environment of the first terminal device.
  • the preset algorithm is the preset algorithm in sub-step 3082.
  • Sub-step 3085 Decrypt the obtained first encrypted information by using the generated second key to obtain the first plaintext information.
  • Sub-step 3086 Determine whether the obtained first plaintext information is the same as the information to be encrypted.
  • the process may go to sub-step 3087.
  • the process may go to sub-step 3088.
  • Sub-step 3087 generating a user identification verification result used to indicate that the user identification to be verified is the user identification of the first terminal device.
  • Sub-step 3088 generating a non-user identity verification result for indicating that the identity of the user to be verified is not the user identity of the first terminal device.
  • the first terminal device can verify, if necessary, whether the user identifier is the user identifier of the first terminal device.
  • Optional implementation (3) Based on the above-mentioned optional implementation (1) or optional implementation (2), the value range of the vendor identification of the first terminal device is different from that of the trusted execution environment of the first terminal device.
  • the value range of the product identifier may include at least one first terminal device with a trusted execution environment, and may include at least one non-trusted execution environment.
  • the second terminal device, and the above timing sequence 300 may further include steps 309 to 311 as shown in FIG. 3B:
  • Step 309 The second terminal device responds to detecting a registration request entered by the user to register as a user of the target application and / or the target website, and determining that the second terminal device does not set a corresponding user authentication information ciphertext to the target application and The first terminal device provided by the target website supports the registration request.
  • the first terminal device provided with the trusted execution environment may be an end user device, and may also provide support for a target application and / or a target website.
  • the target application may be any designated application, and the target website may also be any designated website.
  • the target application may be a book sales e-commerce application, and the target website may also be a book sales e-commerce website.
  • a second terminal device without a trusted execution environment in order to use a target application and / or a service provided by a target website supported by the first terminal device, it is necessary to first register as a user of the target application and / or target website.
  • the second terminal device can detect the registration request, or the user of the second terminal device can also use the second terminal device to access the target website and click on the registration page of the target website that is associated with a user operation registered as the target website. Page element, the second terminal device may also detect a registration request.
  • the second terminal device has initiated a registration request to the first terminal device supporting the target application and / or the target website and received the user authentication information ciphertext sent by the first terminal device, the second terminal device has been set Pass the corresponding user authentication information ciphertext. Only when the second terminal device has not set the corresponding user authentication information ciphertext and detects the registration request entered by the user to register as the target application and / or the user of the target website, the second terminal device will send the target application to the target application. And / or the first terminal device supported by the target website sends a registration request.
  • Step 310 In response to receiving a registration request sent by the second terminal device, the first terminal device performs a user authentication information ciphertext generation operation in a trusted execution environment of the first terminal device, obtains the user authentication information ciphertext, and sends The obtained ciphertext of the user authentication information is sent to the second terminal device that sends the received registration request.
  • the above-mentioned user authentication information ciphertext generating operation may include sub-step 3101 and sub-step 3102 as shown in FIG. 3E:
  • Sub-step 3101 Update the current user serial number with the sum of the current user serial number and the preset increment stored in the trusted execution environment of the first terminal device.
  • the current user serial number may be stored in the trusted execution environment of the first terminal device.
  • the initial value of the current user serial number can be preset to 0 and the preset increment can be 1. Then, for the first registration request received by the first terminal device, the current user serial number will be Incremented from the initial value of 0 to 1, and updated the current user serial number with 1, that is, for the first registration request received, the updated current user serial number is 1, the second received registration request, the updated current The user serial number is 2.
  • Sub-step 3102 encrypting the user authentication information by using the user authentication information key stored in the trusted execution environment of the first terminal device to obtain the user authentication information ciphertext.
  • the user authentication information key and the preset check code are stored in the trusted execution environment of the first terminal device, and only the program in the trusted execution environment of the first terminal device can access the user authentication information key and the preset verification code. If a check code is set, programs outside the trusted execution environment of the first terminal device cannot access the user authentication information key and the preset check code.
  • the preset check code usually takes an easy-to-recognize short word, such as "seed", so that the trusted execution environment decrypts the user verification information cipher text with the user verification information key, and then checks whether the preset check code is correct to This quickly determines whether the current user authentication information ciphertext is forged.
  • the user authentication information may include a preset check code stored in the trusted execution environment of the first terminal device, a current user serial number determined in step 3101, and an environment identifier of the trusted execution environment of the first terminal device. .
  • the ciphertext of the user authentication information can be regarded as the seed code of the registered user, and it can be understood that the first terminal device provides a credential for the successful registration operation for the registration request of the second terminal device.
  • the seed code is already ciphertext, it is checked against the preset check code after decryption in a trusted execution environment. Therefore, it is not necessary to add an additional signature string to the seed code ciphertext, but add a verification at the end of the seed code.
  • the code is optional, in case the keyboard input error or communication transmission error occurs, the system can automatically identify and report the error by comparing the verification code.
  • Step 311 In response to receiving the user authentication information ciphertext sent by the first terminal device, the second terminal device determines the received user authentication information ciphertext as the user authentication information ciphertext of the second terminal device.
  • FIG. 3F Due to the limitation of page display, the following continues to refer to FIG. 3F. It should be noted that the process of FIG. 3F may include various steps shown in FIG. 3A and FIG. 3B in addition to the steps shown in FIG. 3F. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3F can perform the corresponding steps shown in FIG. 3B and FIG. 3F, and can also perform the terminal device shown in FIG. 3A. Steps performed.
  • timing sequence 300 may further include steps 312 to 314 as shown in FIG. 3F:
  • Step 312 The second terminal device determines a transfer key in response to detecting a second user identifier generation instruction including a second user identifier category identifier and instructing to generate a user identifier of a target application and / or a target website.
  • Use the second user ID generation request public key to encrypt the second user ID generation request to obtain the second user ID generation request ciphertext, and send the obtained second user ID generation request cipher text to the target application and / or target
  • the website provides the first terminal device supported.
  • the second terminal device may detect, by various implementation manners, a second user ID generation instruction including a second user ID category ID and used to instruct the user ID generation of the target application and / or the target website to be input by the user.
  • a second user ID generation instruction including a second user ID category ID and used to instruct the user ID generation of the target application and / or the target website to be input by the user.
  • the second terminal device may detect that the user has entered the second user identification category identifier in the user identification category input control and clicked on the target application installed on the second terminal device to associate with the operation of generating the user identification of the target application.
  • the second terminal device may also detect that the user has visited the target website, enter the second user identification category identifier in the page element for user identification category input, and click the association in the second user identification generation page of the target website.
  • the second terminal device may also detect that the user has visited the target website, enter the second user identification category identifier in the page element for user identification category input, and click the association in the second user identification generation page of the target website.
  • the second terminal device may determine the transfer password if a second user ID generation instruction including a second user ID category identifier and used to instruct generation of the user ID of the target application and / or the target website is detected by the user. key.
  • the second user identifier category identifier is used to indicate the category of the user identifier in the user identifier set corresponding to the target application and / or the target website in the second terminal device. That is, the second terminal device stores a user identification set for the target application and / or the target website.
  • the user IDs in the user ID set for the target application and / or target website can be classified in various ways, each classification corresponding to a different second user ID category, and the second user ID category ID is used to indicate Different second user identification categories.
  • the second user identification category identifier may be determined in an incremental manner, that is, the second terminal device may store the current second user identification category identifier for the target application and / or the target website.
  • the second terminal device may obtain the current second user identifier category identifier stored above, and incrementally update the acquired current second user identifier category identifier, and use the incremental update After that, the current second user identifier category identifier generates a second user identifier generating instruction.
  • the second user identification category identifier may also be input by the user autonomously.
  • the second user identification category identifier may also be randomly generated.
  • the second terminal device may determine the turn-key by using various implementation manners.
  • the encryption key may be randomly generated, or the encryption key stored in advance in the second terminal device may be determined as the encryption key, or the encryption key input by the user may be received.
  • the second terminal device may use the second user ID generation request public key to encrypt the second user ID generation request to obtain the second user ID generation request ciphertext.
  • the second user identifier generation request includes the user authentication information cipher text of the second terminal device, the determined transfer key, and the second user identifier category identifier in the detected second user identifier generation instruction.
  • the second terminal device may send the obtained second user identifier generation request ciphertext to the first terminal device that provides support for the target application and / or the target website.
  • Step 313 The first terminal device responds to receiving the second user identifier generation request ciphertext sent by the second terminal device, executes the second user identifier generation operation in the trusted execution environment of the first terminal device, and obtains the received and received The obtained second user ID generates a request for the ciphertext corresponding to the encrypted user ID, and sends the obtained second user ID to the second terminal device that sends the received second user ID to generate the requested cipher text.
  • the above-mentioned second user identifier generating operation may include sub-steps 3131 to 3135 shown in FIG. 3G:
  • Sub-step 3131 Use the second user ID generation request private key corresponding to the second user ID generation request public key stored in the trusted execution environment of the first terminal device to generate a request ciphertext for the received second user ID. Decryption is performed to obtain user authentication information ciphertext, re-encryption key, and user identification category identification.
  • the second user ID generation request public key and the second user ID generation request private key are a pair of asymmetric encryption / decryption key pairs, wherein the second user ID generation request public key can be stored without trusted execution
  • the second terminal device of the environment may also be stored in the trusted execution environment and outside the trusted execution environment of the first terminal device in which the trusted execution environment is set.
  • the second user ID generation request private key can only be stored in the trusted execution environment of the first terminal device where the trusted execution environment is set, and can only be a program within the trusted execution environment of the first terminal device. Access cannot be accessed by programs outside the trusted execution environment of the first terminal device.
  • the decryption method used in sub-step 3131 is a decryption method corresponding to the encryption method that uses the second user ID generation request public key to encrypt the second user ID generation request in step 312.
  • Sub-step 3132 decrypting the ciphertext of the user authentication information obtained by decryption using the user authentication information key stored in the trusted execution environment of the first terminal device to obtain a verification code, a user serial number, and an environment identifier.
  • the decryption method used to decrypt the ciphertext of the user authentication information obtained here is symmetric to the user authentication information ciphertext generation operation shown in FIG. 3E, which is used to encrypt the user authentication information in substep 3102.
  • the symmetric decryption method corresponding to the encryption method.
  • Sub-step 3133 in response to determining that the verification code obtained by the decryption is the same as the preset verification code stored in the trusted execution environment of the first terminal device, and the environment identifier obtained by the decryption is the environment of the trusted execution environment of the first terminal device
  • the identifiers are the same, and the second extended user identifier is generated by using the second manufacturer identifier, the second product identifier, a randomly generated random number, and the user identifier category identifier obtained through decryption.
  • the user authentication information ciphertext obtained by decrypting the second user ID generation request ciphertext received in substep 3131 and decrypting the ciphertext in substep 3132 is authentic with the first terminal device
  • the preset verification code stored in the execution environment is the same, and the decrypted environment ID is the same as the environment ID of the trusted execution environment of the first terminal device, indicating that the second user ID received in step 3131 is generated to request the ciphertext.
  • the second terminal device is a second terminal device that is registered with the first terminal device, and the user authentication information ciphertext of the second terminal device is the user authentication information ciphertext generated by the first terminal device.
  • the second extended user identifier may be generated by using the second manufacturer identifier, the second product identifier, a randomly generated random number, and the user identifier category identifier obtained by decryption.
  • the second vendor identifier is generated according to the product identifier of the trusted execution environment of the first terminal device, and the value range of the second vendor identifier and the product identifier of the trusted execution environment of the first terminal device are obtained.
  • the value range and the value range of the vendor identification of the trusted execution environment of the first terminal device are different from each other, and the second product identification is the user serial number obtained by decryption.
  • Sub-step 3134 Encrypt the generated second extended user identifier by using the user identification key stored in the trusted execution environment of the first terminal device to obtain a second user identifier.
  • a second extended user identifier has been generated for the second terminal device.
  • the second extended user identifier directly includes the second manufacturer identifier, the second product identifier, a random number, and a user identifier category identifier.
  • Programs outside the execution environment cannot parse the above-mentioned second extended user identification, and the generated second extended user identification is encrypted by using the user identification key stored in the trusted execution environment of the first terminal device to obtain a second user.
  • logo the second user identifier is an identifier in a cipher text state.
  • the obtained second user identifier is encrypted by using the decryption transfer key to obtain a second user identifier corresponding to the received second user identifier generation request ciphertext.
  • the encrypted user ID is obtained by encrypting the second user ID in cipher text.
  • the decryption key obtained by decryption is also necessary to use the decryption key obtained by decryption in substep 3131.
  • the second user ID obtained in sub-step 3134 is encrypted to obtain a turn-key user ID corresponding to the second user ID generation request ciphertext received in sub-step 313.
  • Step 314 The second terminal device responds to receiving the encrypted user ID sent by the first terminal device and corresponding to the obtained second user ID generation request ciphertext and sent to the first terminal device, and uses the obtained second encrypted user ID.
  • the encryption key in the second user ID generation request corresponding to the user ID generation request ciphertext decrypts the received encrypted user ID, obtains the second user ID, and adds the decrypted second user ID to the
  • the user identity of the second terminal device is in a set.
  • the second user identifier obtained after decryption is a ciphertext identifier.
  • the second terminal device without a trusted execution environment generates a new terminal device that supports the target application and / or target website.
  • User ID In other words, after steps 312 to 314, the first terminal device that supports the target application and / or the target website and is provided with a trusted execution environment can develop its own "second-level user", that is, in The second terminal device develops its own “secondary user", thereby improving the function of the first terminal device, so that the first terminal device can also provide services to the outside.
  • the advantage of using this type of logo is that the expression is relatively short. Both only take up 20 bytes.
  • the disadvantage is that the two are only used to identify a user, and they cannot implement signatures and verify signatures on behalf of the user.
  • the private key is derived from Formula F according to the generated second user ID, and then the public key is further derived from the private key.
  • any 32-byte data can be used as the private key of the Bitcoin account, and its The public key is derived from the private key.
  • Formula F only needs to derive a 32-byte hash value from the second user ID.
  • Private key F (system security word, primary user security word, second user identification)
  • the system security word is preset by the manufacturer of the trusted execution environment and is a top-secret string.
  • the first-level user security word is pre-configured into the trusted execution environment by adjusting specific APIs.
  • the trusted execution environment is always The first-level user security words are not leaked to the outside, so others cannot guess, and the private key derived based on the above formula cannot be guessed either.
  • a simple implementation of formula F is: using a hash256 hash algorithm, hashing a string formed by concatenating the system security word, the first user security word, and the second user identifier, to obtain a length of 32 bytes Can be used as the private key corresponding to the second user ID.
  • the manufacturer identification of the first terminal device may be greater than or equal to the first
  • the preset positive integer is less than or equal to the sum of the first preset positive integer and the second preset positive integer.
  • the product identifier of the first terminal device is greater than the second preset positive integer and less than the first preset positive integer.
  • the preset positive integer is greater than the second preset positive integer.
  • the manufacturer ID of the first terminal device can be represented by FactoryNo
  • the product ID of the first terminal device by ProductNo
  • the first preset positive integer by I 1 and the second preset positive integer by I 2 Among them, I 1 > I 2
  • the above-mentioned optional implementation manner (five) can be expressed as follows:
  • Alternative implementation method (6) Based on the optional implementation methods (3), (4), or (5), in which the second vendor identification in the optional implementation method (4) is based on the first terminal device.
  • the generation of the product identification of the trusted execution environment may include: the second vendor identification is the sum of the product identification of the trusted execution environment of the first terminal device and the first preset positive integer.
  • the value range of the manufacturer ID is different from each other.
  • Optional implementation method (seven): Based on the above optional implementation method (six), the manufacturer identification and product identification of the first terminal device are four-byte unsigned integers, and the hexadecimal representation of the first preset positive integer is 0x80000000, the hexadecimal representation of the second preset positive integer is 0x000000FF. The following conclusions can be drawn:
  • FactoryNo is a four-byte unsigned integer with a value ranging from 0x80000000 to 0x800000FF;
  • ProductNo is a four-byte unsigned integer with a value ranging from 0x00000100 to 0x7FFFFFFF;
  • FactoryNo is a four-byte unsigned integer with a value ranging from 0x80000100 to 0xFFFFFF.
  • the value ranges of FactoryNo, ProductNo, and FactoryNo ' are different, that is, the value range of the second manufacturer's identification, the value range of the product identification of the trusted execution environment of the first terminal device, and the first terminal device.
  • the value range of the vendor ID of the trusted execution environment is different from each other.
  • FIG. 3H Due to the limitation of the page display, the following reference is continued to FIG. 3H. It should be noted that the process of FIG. 3H may include various steps shown in FIG. 3A, FIG. 3B, and FIG. 3F in addition to the steps shown in FIG. 3H. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3H can perform the corresponding steps shown in FIG. 3B, FIG. 3F, and FIG. 3H, and can also perform the steps shown in FIG. 3A. Steps that the terminal device can perform.
  • the above-mentioned sequence 300 may further include steps 315 to 319 as shown in FIG. 3H to implement the server's verification of the user identity of the first terminal device:
  • step 315 the server, in response to receiving an end user identity verification request including the user identity to be verified, sent by the first terminal device, executes a user identity verification information ciphertext generation operation in a trusted execution environment of the server to obtain verification with the end user identity. Request the corresponding user identification verification information ciphertext, and send the obtained user identification verification information ciphertext to the first terminal device that sends the received end user identification verification request.
  • the first terminal device may send an end user identity verification request including a user identity to be verified to the server under various preset conditions. For example, before sending the user information addition request to the server in steps 301 and 302, the first terminal device may first send the user ID in the user information addition request to be sent to the server as the terminal user ID generated by the user ID to be verified. Verify the request. If the end-user authentication pass result sent by the server is received, the user information addition request to be sent can be sent to the server. Conversely, if the end-user authentication pass result sent by the server is not passed, the server will not send the to-be-sent User information addition request.
  • the first terminal device may also send the user ID in the user information transfer request to be sent to the server as the terminal user ID generated by the user ID to be verified. Verify the request. If the end-user authentication pass result sent by the server is received, the user information transfer request to be sent can be sent to the server. Conversely, if the end-user authentication pass result sent by the server is not passed, the server will not send the to-be-sent User information transfer request.
  • the server may execute the cipher text generation operation of the user identity verification information in the trusted execution environment of the server, and obtain The user identification verification information ciphertext corresponding to the identification verification request, and the obtained user identification verification information ciphertext is sent to the first terminal device that sends the received end user identification verification request.
  • the ciphertext generation operation of the user identification verification information may include sub-steps 3151 to 3153 as shown in FIG. 3I:
  • Sub-step 3151 Decrypt the received user ID to be verified by using the user ID key stored in the trusted execution environment of the server to obtain the extended user ID to be verified.
  • the same user identification key is stored in the trusted execution environment of the first terminal device and the server's trusted execution environment, and by the same token, the user identification key stored in the server's trusted execution environment can only be It is accessed by programs within the server's trusted execution environment and cannot be accessed by programs outside the server's trusted execution environment. If the user identification to be authenticated is obtained by encrypting the user identification key stored in the trusted execution environment of the first terminal device to be used for verification extended user identification, then the user identification key stored in the trusted execution environment of the server is used The received user ID to be verified is decrypted to obtain the extended user ID to be verified.
  • Sub-step 3152 generating user identification verification information including a set of environment IDs that are allowed to be decrypted and information to be verified, and adding the environment ID in the extended user ID to be verified to the set of environment IDs that are allowed to be decrypted in the generated user ID verification information.
  • the information to be verified may be randomly generated information or any preset information content.
  • Sub-step 3153 The generated user identification verification information is encrypted by using the user identification verification information public key in the user identification verification information key pair stored in the trusted execution environment of the server to obtain a user corresponding to the end user identity verification request. Identifies the authentication information ciphertext.
  • the user identification verification information key includes a user identification verification information public key and a user identification verification information private key, wherein the user identification verification information public key may be stored in the trusted execution environment and trusted of the server or the first terminal device. Outside the execution environment, and the private key of the user identification verification information can only be stored in the trusted execution environment of the server or the trusted execution environment of the first terminal device, the private key of the user identification verification information can only be trusted by the server Programs within the execution environment or programs within the trusted execution environment of the first terminal device.
  • Step 316 In response to receiving the ciphertext of the user identification verification information sent by the server, the first terminal device executes an operation of generating verification information in a trusted execution environment of the first terminal device, and obtains a secret that is similar to the received user identification verification information. The verification information corresponding to the text, and send the obtained verification information to the server.
  • the verification information generating operation may include sub-steps 3161 to 3162 as shown in FIG. 3J:
  • Sub-step 3161 Decrypt the received user identification verification information cipher text by using the user identification verification information private key in the user identification verification information key pair stored in the trusted execution environment of the first terminal device to obtain the user identification. verify message.
  • the same user identification verification information private key is stored in the trusted execution environment of the first terminal device and the trusted execution environment of the server. If the received user identification verification information ciphertext is obtained by the server using the user identification verification information public key to encrypt the user identification verification information, then the user identification verification information stored in the trusted execution environment of the first terminal device is used. The private key decrypts the ciphertext of the received user identification verification information to obtain the user identification verification information.
  • Sub-step 3162 in response to determining that the environment identifier of the trusted execution environment of the first terminal device belongs to the decryption-allowed environment identifier set in the user ID verification information obtained by decryption, determining the to-be-verified information in the user ID verification information obtained by decryption Authentication information corresponding to the ciphertext of the received user authentication information.
  • the user ID verification information obtained by decryption in sub-step 3161 includes a set of environment identifiers that are allowed to be decrypted and information to be verified.
  • the decryption environment identification set indicates that the ciphertext of the user identification verification information received in step 316 was sent by the server to the first terminal device, and the information to be verified in the user identification verification information decrypted in substep 3161 can be determined Authentication information corresponding to the ciphertext of the received user authentication information.
  • Step 317 The server determines whether the received authentication information corresponds to the user corresponding to the ciphertext of the user identification verification information sent in response to receiving the authentication information corresponding to the ciphertext of the user identification verification information sent by the first terminal device.
  • the information to be verified in the identification verification information is the same.
  • the server may receive the authentication information corresponding to the sent user identification verification information cipher text sent by the first terminal device, where the sent user identification verification information cipher text and the end user identity received by the server Corresponds to the authentication request, and determines whether the received authentication information is the same as the to-be-verified information in the user identification authentication information corresponding to the ciphertext of the user identification authentication information sent.
  • step 318 the server responds to the determination that it is the same, and generates an end-user authentication pass result for indicating that the received end-user identity authentication request authentication passes.
  • the server may determine that the received authentication information is the same as the to-be-verified information in the user identification verification information corresponding to the cipher text of the user identification verification information sent, indicating that the received end user identity verification
  • the user identity to be verified in the request is the user identity of the first terminal device that sent the above-mentioned end user identity verification request, and an end user verification pass result used to indicate that the received end user identity verification request verification is passed can be generated.
  • Step 319 In response to the determination being different, the server generates an end-user verification failure result for indicating that the received end-user identity verification request verification fails.
  • the server may determine that the received authentication information is different from the to-be-verified information in the user identification verification information corresponding to the cipher text of the user identification verification information sent, indicating that the received end user identification verification
  • the user identity to be verified in the request is not the user identity of the first terminal device that sent the above-mentioned end user identity verification request, and an end user verification failure result may be generated to indicate that the received end user identity verification request fails verification.
  • the server can implement verification of the user identity of the first terminal device, and the verification process introduces complex operations in a trusted execution environment, compared with the existing Verification code method, more secure.
  • FIG. 3K Due to the limitation of the page display, the following continues to refer to FIG. 3K. It should be noted that in addition to the steps shown in FIG. 3K, the process of FIG. 3K may also include the steps shown in FIG. 3A, FIG. 3B, FIG. Each step. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3K can perform the corresponding steps shown in FIG. 3B, FIG. 3F, FIG. 3H, and FIG. 3K, and can also perform the steps shown in FIG. 3A. The various steps that the terminal device shown can perform.
  • the above-mentioned sequence 300 may further include steps 320 to 326.
  • the first terminal device is configured to send information to a designated first terminal device and / or a second terminal device:
  • Step 320 The first terminal device, in response to detecting an information encryption request including a receiver user identification set and information to be encrypted, performs an information encryption operation in a trusted execution environment of the first terminal device, and obtains a message corresponding to the information encryption request.
  • Information ciphertext
  • the first terminal device may determine that an information encryption request is detected under various preset conditions.
  • the information creator for example, the testator
  • the testator can open the targeted information encryption application installed on the first terminal device, and enter the user ID of each information receiver (for example, the user ID of each heir) as the recipient user. Identify the set, and then input the information to be encrypted (for example, will content) as the information to be encrypted, and click the control of the associated information encryption operation, so that the first terminal device can determine that an information encryption request is detected.
  • the information creator for example, the testator
  • the first terminal device can also use the first terminal device to access the website that provides the directional information encryption function, and enter the user ID of each of the information receivers (for example, the user ID of each of the heirs of the will) as the receiver.
  • Party user identification set, and then input the information to be encrypted (such as will content) as the information to be encrypted, and click the page element of the associated information encryption operation on the page, so that the first terminal device can determine that an information encryption request is detected.
  • the first terminal device can perform an information encryption operation in a trusted execution environment of the first terminal device in a case where an information encryption request including a receiver's user identity set and information to be encrypted is detected, to obtain an information encryption request.
  • the information encryption operation may include sub-step 3201 and sub-step 3202 as shown in FIG. 3L:
  • a receiver environment identifier set is generated by using a receiver environment identifier corresponding to each receiver user identifier in the receiver user identifier set.
  • the receiver's environment identifier is the environment identifier in the receiver's extended user obtained by decrypting the receiver's user ID with the user's identification key stored in the trusted execution environment of the first terminal device.
  • the user identifier of the receiver is provided within the trusted execution environment of the first terminal device outside the trusted execution environment of the first terminal device.
  • the user identification not the user identification but the environment identification is used. Therefore, it is necessary to obtain the receiver environment identifier by decrypting the receiver user identifier within the trusted execution environment of the first terminal device.
  • Sub-step 3202 encrypting the receiver's environment identification set and the information to be encrypted by using the directional information public key in the directional information key pair stored in the trusted execution environment of the first terminal device to obtain information corresponding to the information encryption request Ciphertext.
  • the directional information key pair includes a directional information public key and a directional information private key, wherein the directional information public key can be stored within the trusted information environment and outside the trusted execution environment of the first terminal device, and the directional information public key It may also be stored in a second terminal device without a trusted execution environment.
  • the private key of the directed information can only be stored in the trusted execution environment of the first terminal device. Only the program within the trusted execution environment of the first terminal device can access the private key of the directed information, and the trusted execution environment of the first terminal device. Other programs cannot access the private key of the directed information.
  • the directional information public key in the generated information ciphertext is used to encrypt the receiver's environment identification set and the information to be encrypted.
  • the information ciphertext has been created after step 320.
  • the first terminal device may not only serve as the information creator but also the information receiver.
  • the first terminal device may also be the second terminal device without a trusted execution environment.
  • the information receiver can use various implementation methods to obtain the information ciphertext created by the information creator. For example, the creator of the information can send the ciphertext of the information to the email address specified by the receiver of the information, and then the receiver of the information can obtain the ciphertext of the information by receiving the email, or the creator of the information can also provide the download The URL of the information ciphertext is linked, and then the information receiver clicks the URL link to download the information ciphertext. Alternatively, the information receiver can also copy the information ciphertext directly from the information creator through a USB flash drive.
  • the information is encrypted. That is, when the information ciphertext is generated, the receiver environmental identifier set is specified. Only when the environment identifier belongs to the receiver environmental identifier set specified in the information ciphertext, can the corresponding information ciphertext be used. Information in plain text.
  • Step 321 In response to detecting the first information decryption request including the ciphertext of the information to be decrypted, the first terminal device executes the first information decryption operation in the trusted execution environment of the first terminal device to obtain the first information decryption request.
  • the corresponding message is plain text.
  • the first terminal device when the first terminal device serves as the information receiver, in order to use the information ciphertext, the information ciphertext needs to be decrypted.
  • the first terminal device detects the first information decryption request including the ciphertext of the information to be decrypted, the first terminal device executes the first information decryption operation in the trusted execution environment of the first terminal device to obtain the first information decryption operation.
  • the first information decryption operation may include sub-step 3211 and sub-step 3212 as shown in FIG. 3M:
  • Sub-step 3211 The ciphertext of the information to be decrypted in the first information decryption request is decrypted by using the directional information private key in the directional information key pair stored in the trusted execution environment of the first terminal device to obtain a first receiver.
  • the environment identification set and the first information are in plain text.
  • the private key of the directional information stored in the trusted execution environment of the first terminal device is used to decrypt the ciphertext of the information to be decrypted in the first information decryption request.
  • the first receiver's environment identifier set and the first information plaintext can be obtained.
  • Sub-step 3212 in response to determining that the environment identifier of the trusted execution environment of the first terminal device belongs to the first receiver environment identifier set, determining the first information plaintext as the information plaintext corresponding to the first information decryption request.
  • the first receiver environmental identifier set and the first information plaintext have been decrypted in sub-step 3211. If the environment identifier of the trusted execution environment of the first terminal device belongs to the decrypted first receiver environmental identifier set, step 321 is displayed.
  • the information to be decrypted in is sent to the first terminal device, and then the first plaintext of the information decrypted in sub-step 3211 can be determined as the plaintext of the information corresponding to the first information decryption request, that is, the first terminal can be decrypted in the first terminal.
  • the device uses the plaintext of the information corresponding to the first information decryption request.
  • the environment identifier of the trusted execution environment of the first terminal device does not belong to the first receiver environmental identifier set obtained by decryption, it indicates that the information to be decrypted in step 321 is not sent to the first terminal device, although In sub-step 3211, the first information plaintext has been decrypted in the trusted execution environment of the first terminal device, but the first terminal device still cannot obtain and use the first information plaintext.
  • the implementation of distinguishing whether the information to be decrypted is sent to a specified device by using the environment identifier has a significant advantage, because the environment identifier includes the manufacturer identifier and the product identifier, and the manufacturer identifier and the product identifier can each occupy only 4 bytes.
  • the environment identifier of this solution occupies a small amount of bytes.
  • the manufacturer identification can be listed only once for multiple consecutive devices with the same manufacturer identification. After that, successively listing multiple product identifications can be automatically parsed into designated equipment with the same manufacturer identification. In this way, the byte occupancy of the first receiver environmental identifier set is further compressed.
  • the directed decryption of the information is achieved through step 321, that is, the plaintext of the information can be used only when the environmental identifier belongs to the receiver environmental identifier set specified in the information ciphertext.
  • Step 322 The second terminal device determines a transfer key in response to detecting a second information decryption request including a ciphertext of the information to be decrypted.
  • the second terminal device when the second terminal device is used as the information receiver, since the second terminal device does not have a trusted execution environment, in order to use the information plaintext corresponding to the information cipher text, it is necessary to use the first terminal device to perform information encryption. Determine the encryption key.
  • the second terminal device may receive the key string input by the user as the transfer key, and the second terminal device may also randomly generate a key as the transfer key.
  • Step 323 The second terminal device encrypts the second cipher instruction with the directional information public key in the directional information key pair to obtain the second cipher instruction.
  • the second encryption instruction includes user authentication information of the second terminal device and the encryption password determined in step 322.
  • Step 324 The second terminal device sends the obtained second ciphertext instruction ciphertext and the information ciphertext to be decrypted in the second information decryption request as an information cipher request to the first application providing support for the target application and / or the target website.
  • a terminal device sends the obtained second ciphertext instruction ciphertext and the information ciphertext to be decrypted in the second information decryption request as an information cipher request to the first application providing support for the target application and / or the target website.
  • the second terminal device since the second terminal device does not have a trusted execution environment, as the information receiver, in order to use the information ciphertext, the information needs to be encrypted by means of the first terminal device.
  • the second cipher instruction is encrypted to obtain a second cipher instruction.
  • the cipher text of the message to be decrypted is encrypted. Therefore, the second cipher instruction obtained in step 323 can be encrypted.
  • the ciphertext of the message to be decrypted in the text and the second information decryption request is sent as an information transfer request to the first terminal device that provides support for the target application and / or the target website.
  • Step 325 In response to receiving the information transfer request sent by the second terminal device, the first terminal device executes the information transfer operation in the trusted execution environment of the first terminal device, and obtains the request with the received information transfer request. The corresponding re-encryption information and the obtained re-encryption information are sent to a second terminal device that sends the received information re-encryption request.
  • the information transfer operation may include sub-step 3251 to sub-step 3254 as shown in FIG. 3O:
  • Sub-step 3251 decrypting the second ciphertext instruction ciphertext in the received information cipher request using the directional private key of the directional information key pair stored in the trusted execution environment of the first terminal device, Get user authentication information and transfer key.
  • the information transcoding request received by the first terminal device from the second terminal device includes the second ciphertext instruction ciphertext and the information to be decrypted, and the second ciphertext instruction ciphertext is encrypted by using the directional information public key. Therefore, by using the directional information private key in the directional information key pair stored in the trusted execution environment of the first terminal device to decrypt the second ciphertext instruction ciphertext in the received information cipher request, it is possible to A second encryption instruction is obtained, and the second encryption instruction includes the user authentication information and the encryption key of the second terminal device.
  • Sub-step 3252 decrypting the user authentication information obtained by decryption using the user authentication information key stored in the trusted execution environment of the first terminal device to obtain a verification code, a user serial number, and an environment identifier.
  • the user authentication information is obtained by the first terminal device using the user authentication information key in the trusted execution environment to encrypt the preset verification code, the current user serial number, and the environment identifier of the trusted execution environment of the first terminal device, Therefore, by using the user authentication information key stored in the trusted execution environment of the first terminal device to decrypt the user authentication information obtained by decryption, a verification code, a user serial number, and an environment identifier can be obtained.
  • Sub-step 3253 in response to determining that the environment identifier obtained by decryption is the same as the environment identifier of the trusted execution environment of the first terminal device and the verification code obtained by decryption is the preset verification stored in the trusted execution environment of the first terminal device The same code is used, and the directional information private key in the directional information key pair stored in the trusted execution environment of the first terminal device is used to decrypt the information ciphertext in the received information transfer request to obtain the second receiver.
  • the environment identification set and the second information are in plain text.
  • the verification code obtained by decrypting the user verification information decrypted in substep 3251 in substep 3252 is the same as the preset verification code stored in the trusted execution environment of the first terminal device, and the decrypted environment identifier is The environment identifier of the trusted execution environment of the first terminal device is the same, indicating that the second terminal device that sent the information transfer request is a second terminal device registered with the first terminal device, and the user of the second terminal device authenticates The information cipher text is the user authentication information cipher text generated by the first terminal device. Then, the first terminal device can use the directional information private key pair in the directional information key pair stored in the trusted execution environment of the first terminal device. The information ciphertext in the received information transfer request is decrypted to obtain the second receiver's environment identification set and the second information plaintext.
  • Sub-step 3254 in response to determining that the second environment identifier belongs to the second receiver environmental identifier set obtained by decryption, encrypting the decrypted second information plaintext by using the decryption transfer key, to obtain a decryption message with the received information.
  • the secret request corresponds to the confidentiality information.
  • the second environmental identifier may be generated first, where the vendor identifier in the second environmental identifier is based on the trustworthiness of the first terminal device.
  • the second vendor identifier generated by the product identifier of the execution environment, and the product identifier in the second environment identifier is the user serial number obtained by decryption in sub-step 3252. Then, it is determined whether the second environment identifier belongs to the decrypted second receiver environment identifier set. If it belongs, it indicates that the information ciphertext in the information transfer request received in step 325 is sent to the second environment identifier as instructed.
  • the device ID of the second environment ID is the second vendor ID generated according to the product ID of the trusted execution environment of the first terminal device.
  • the product ID in the second environment ID is in sub-step 3252.
  • the user serial number obtained after decryption, and the user serial number obtained by decrypting the user authentication information in sub-step 3252, and the user authentication information decrypted in sub-step 3252 is a request for the encryption of the received information in sub-step 3251. It is obtained by performing decryption. Therefore, it indicates that the second terminal device that sends the information transfer request belongs to a device that can receive the information to be decrypted in the received information transfer request, that is, the second terminal that sends the information transfer request.
  • the device may receive the plaintext of the second information obtained by decryption in sub-step 3253.
  • the decryption key obtained in the sub-step 3251 encrypts the plaintext of the second information obtained in the sub-step 3253, and obtains the secret information corresponding to the received information transfer request.
  • the above encryption process is performed in the trusted execution environment of the first terminal device. Programs outside the trusted execution environment of the first terminal device cannot obtain the plaintext of the second information.
  • the re-encrypted information obtained after the key encrypts the second information in plain text, thereby protecting the security of the information directed to the second terminal device.
  • Step 326 In response to receiving the turn-key information sent by the first terminal device, the second terminal device uses the detected turn-key in the second information decryption request to decrypt the received turn-key information to obtain information plaintext.
  • the received re-encryption information corresponds to the information generated and transmitted for the detected second information decryption request.
  • the re-encryption request uses the detected re-encryption key in the second information decryption request to decrypt the received re-encryption information to obtain the plaintext of the information.
  • the second terminal device serves as the information receiver.
  • the trusted execution environment is not set and therefore does not have the information decryption capability
  • the information terminal can be decrypted by using the first terminal device with the information decryption capability. Use the message plaintext corresponding to the message ciphertext sent to itself.
  • a user information range identifier is introduced in the time sequence 300 of the system for processing user information in this embodiment. Therefore, the solution described in this embodiment can implement addition and query of user information in different scopes.
  • FIG. 4 it illustrates a process 400 of an embodiment of a method for processing user information, which is applied to a server in a system for processing user information, wherein the system for processing user information includes at least A terminal device and a server.
  • the server sets a trusted execution environment.
  • the process 400 of the method for processing user information includes the following steps:
  • step 401 in response to receiving a user information addition request sent by the terminal device, the user identification, user information, and encryption mark in the received user information addition request are correspondingly stored.
  • the execution subject of the method for processing user information may receive a user information addition request sent by the terminal device, where the user information addition request may include User identification, user information, and encryption mark, and store the user identification, user information, and encryption mark in the received user information addition request.
  • the encryption mark is an encrypted mark used to characterize the user information in the user information addition request as encrypted user information ciphertext, or an encrypted mark used to characterize the user information in the user information addition request as unencrypted user information in plain text. Encrypted token. That is, the user information in the received user information addition request may be user information plaintext or encrypted user information ciphertext.
  • the user information may include various attribute information of the user, for example, the user information may include name, age, gender, mobile phone number, ID number, nickname, avatar image, hobbies, occupation, income status, education background, hometown, home address , Work address, etc.
  • the user identifier is used to uniquely identify each user corresponding to the user information stored by the server.
  • the user ID can include at least one of the following: numbers, characters, and text.
  • the above-mentioned execution subject may store the user identification, user information, and encryption mark in the received user information addition request in a distributed database.
  • Step 402 In response to receiving the user information transfer request sent by the terminal device, query the user information and the encryption mark corresponding to the user identifier in the received user information transfer request.
  • the execution subject may query and receive the user information transfer request in the case of receiving the user information transfer request from the terminal device.
  • the user information corresponding to the user ID and the encryption token and then go to step 403 for execution.
  • the user information transfer request may include a user identification and a first transfer request.
  • Step 403 In a trusted execution environment, perform a user information transfer encryption operation to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to the sender and receiver.
  • the terminal device of the user information transfer request In a trusted execution environment, perform a user information transfer encryption operation to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to the sender and receiver.
  • the terminal device of the user information transfer request In a trusted execution environment, perform a user information transfer encryption operation to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to the sender and receiver.
  • the user information encryption operation is performed in the trusted execution environment set in the above-mentioned execution body, and the same as received in step 402 is obtained.
  • the user information corresponding to the received user information encryption request, and the obtained user information transmitted to the encryption device is sent to the terminal device that sends the received user information encryption request.
  • the user information is encrypted, the user information is encrypted in plain text in the trusted execution environment of the above-mentioned execution subject using a turn-key.
  • the program outside the trusted execution environment of the above-mentioned execution subject can only obtain the encrypted key.
  • the plaintext of the user information cannot be obtained, thereby preventing the above-mentioned execution subject from revealing the plaintext of the user information.
  • the user information addition request received in step 401 may further include a user information range identifier.
  • step 401 can also be performed as follows: in response to receiving the user information addition request sent by the terminal device, storing the user identification, the user information range identification, the user information, and the encryption mark in the received user information addition request in a corresponding manner.
  • the user information range identifier is used to indicate at least one kind of attribute information among various attribute information included in the user information, and it can also be understood that the user information range identifier is used to indicate at least one of various fields included in the user information.
  • various attribute information included in the user information may be classified according to the privacy degree and / or importance degree of each attribute information, and the user information range identifier to which each attribute information belongs is marked.
  • the user information transfer request received in step 402 may further include a user information range identifier.
  • step 402 can also be performed as follows: Query the user information and the encryption mark corresponding to the user identifier and the user information range identifier in the received user information transfer request.
  • the foregoing method for processing user information may further perform the following steps 404 to 407:
  • Step 404 In response to receiving an end user identity verification request including a user identity to be verified and sent by a terminal device that sets a trusted execution environment, execute a user identity verification information ciphertext generation operation in the trusted execution environment to obtain an identity with the end user.
  • the user identification verification information ciphertext corresponding to the verification request, and the obtained user identification verification information ciphertext is sent to the terminal device that sends the received end user identity verification request.
  • step 404 is basically the same as the operation of step 315 in the embodiment shown in FIG. 3H, which is not repeated here.
  • the terminal device that sets the trusted execution environment in step 404 is equivalent to step 315. In the first terminal device.
  • Step 405 In response to receiving the authentication information corresponding to the sent user identification verification information ciphertext sent by the terminal device setting the trusted execution environment, determine whether the received verification information is in ciphertext with the sent user identification verification information. The information to be verified in the corresponding user identification verification information is the same.
  • the foregoing execution subject may receive the authentication information corresponding to the sent user identification verification information ciphertext sent by the terminal device that sets the trusted execution environment, where the sent user identification verification information ciphertext is related to the The received end user identity verification request corresponds, and it is determined whether the received verification information is the same as the information to be verified in the user identity verification information corresponding to the sent user identity verification information ciphertext.
  • step 406 in response to determining that they are the same, an end-user verification pass result is generated to indicate that the received end-user identity verification request verification has passed.
  • the foregoing execution body may determine in step 405 that the received authentication information is the same as the to-be-verified information in the user identification verification information corresponding to the ciphertext of the user identification verification information sent, indicating that the received end user
  • the user identity to be verified in the identity verification request is the user identity of the terminal device that sets the trusted execution environment for sending the above-mentioned end user identity verification request, and an end user who can indicate that the received verification of the end user identity verification request is passed can be generated Verify the results.
  • step 407 in response to the determination being different, an end user authentication failure result for indicating that the received end user identity authentication request authentication fails is generated.
  • the execution entity may determine that the received verification information is different from the to-be-verified information in the user identification verification information corresponding to the cipher text of the user identification verification information sent, indicating that the received end user
  • the user identity to be verified in the identity verification request is not the user identity of the terminal device that sets the trusted execution environment for sending the above-mentioned end-user identity verification request
  • the above-mentioned execution subject may generate an indication that the received end-user identity verification request verification is not Passed end-user verification fails.
  • the server can verify the user identity of the terminal device that sets the trusted execution environment, and the verification process is more complicated than the existing verification code method due to the introduction of complex operations in the trusted execution environment. Safety.
  • the method provided by the foregoing embodiment of the present application stores the user ID, user information, and encryption mark in the received user information addition request in a corresponding storage manner, and queries the corresponding user ID in the received user information transfer request.
  • User information and encryption mark and then perform the user information transfer operation in a trusted execution environment to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to
  • the terminal device sending the received user information re-encryption request avoids obtaining the plaintext of the user information outside the trusted execution environment during the entire process, thereby protecting the security of the user information.
  • this application provides an embodiment of a device for processing user information, which corresponds to the method embodiment shown in FIG. 4.
  • the device can be specifically applied to various electronic devices provided with a trusted execution environment.
  • the apparatus 500 for processing user information in this embodiment includes a user information adding unit 501, a user information query unit 502, and a user information transfer unit 503.
  • the user information adding unit 501 is configured to store the user identification, user information, and encryption mark in the received user information addition request in response to receiving the user information addition request sent by the terminal device, and the encryption mark
  • user The information query unit 502 is configured to respond to receiving a user information transfer request from the terminal device, where the user information transfer request includes a user identification and a first transfer instruction, and query and transfer the received user information transfer request.
  • the user information and encryption mark corresponding to the user identification in the request; and the user information transfer unit 503 is configured to perform the user information transfer operation in the above-mentioned trusted execution environment to obtain a request for the transfer of the user information to the received user information.
  • the corresponding encrypted user information and send the obtained encrypted user information to send
  • the terminal device that received the user information transfer request wherein the user information transfer operation includes: using a transfer instruction private key corresponding to the transfer instruction instruction public key stored in the trusted execution environment of the server, The first encryption instruction in the received user information encryption request is decrypted to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the trusted execution environment of the server is used The encryption key stored in the key is used to decrypt the ciphertext key obtained by decryption to obtain the plaintext key; the plaintext key obtained by decryption is used to decrypt the found user information to obtain the user information plaintext; in response to determining that the found The encrypted mark is unencrypted
  • step 401, step 402, and step 403 in the embodiment are not repeated here.
  • the user information addition request may further include a user information range identifier; and the above-mentioned user information addition unit 501 may be further configured to: in response to receiving the user information addition request sent by the terminal device , And store the received user information in the user ID, user information range ID, user information, and encryption mark in the request.
  • the user information transfer request may further include a user information range identifier; and the above-mentioned user information query unit 502 may be further configured to: query and receive the user information transfer request The user ID and user information range ID in the corresponding user information and encryption mark.
  • the foregoing apparatus 500 may further include: a generating and sending unit 504 configured to respond to receiving a terminal including a user identifier to be sent and sent by a terminal device that sets a trusted execution environment
  • the user ID verification request executes the user ID verification information ciphertext generation operation in the trusted execution environment to obtain the user ID verification information ciphertext corresponding to the terminal user ID verification request, and obtains the obtained user ID verification information ciphertext.
  • Sending to the terminal device sending the received end user identity verification request, wherein the operation of generating the ciphertext of the user identity verification information includes: using the user identity key stored in the trusted execution environment to pair the received user to be verified
  • the ID is decrypted to obtain the extended user ID to be verified.
  • the user ID verification information including the set of environment IDs to be verified and the information to be verified is generated, and the environment ID in the extended user ID to be verified is added to the generated user ID verification information. Allows decryption of environment ID collections; utilizes the above Encrypting the generated user identification verification information with the public identification key of the user identification verification information in the user identification verification information key pair stored in the trusted execution environment to obtain the ciphertext of the user identification verification information corresponding to the above-mentioned end user identification verification request;
  • the determining unit 505 is configured to respond to receiving the verification information corresponding to the sent user identification verification information ciphertext sent by the terminal device that sets the trusted execution environment, wherein the sent user identification verification information ciphertext and the received
  • the corresponding end user identity verification request corresponds to whether the received verification information is the same as the to-be-verified information in the user identity verification information corresponding to the sent user identity verification information ciphertext;
  • the first result generating unit 506 is configured to In response to the determination being the same,
  • the foregoing server may be a resource server supporting the OAuth2 protocol.
  • FIG. 6 shows a schematic structural diagram of a computer system 600 suitable for implementing a server according to an embodiment of the present application.
  • the server shown in FIG. 6 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
  • the computer system 600 includes a central processing unit (CPU, Central Processing Unit) 601, which can be loaded into random access according to a program stored in a read-only memory (ROM, Read Only Memory) 602 or from a storage portion 608
  • ROM Read Only Memory
  • RAM Random Access Memory
  • a program in a memory (RAM, Random Access Memory) 603 performs various appropriate actions and processes.
  • RAM Random Access Memory
  • various programs and data required for the operation of the system 600 are also stored.
  • the CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604.
  • An input / output (I / O, Input / Output) interface 605 is also connected to the bus 604.
  • the following components are connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a cathode ray tube (CRT, Cathode Ray Tube), a liquid crystal display (LCD, Liquid Crystal Display), and a speaker, etc.
  • a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like.
  • the communication section 609 performs communication processing via a network such as the Internet.
  • the driver 610 is also connected to the I / O interface 605 as necessary.
  • a removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
  • the process described above with reference to the flowchart may be implemented as a computer software program.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing a method shown in a flowchart.
  • the computer program may be downloaded and installed from a network through the communication portion 609, and / or installed from a removable medium 611.
  • CPU central processing unit
  • the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the foregoing.
  • the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programming read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal that is borne in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including programming languages such as Java, Smalltalk, C ++, Python, and also object-oriented. Includes regular procedural programming languages—such as "C” or similar programming languages.
  • the program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer, partly on a remote computer, or entirely on a remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider) Internet connection).
  • LAN local area network
  • WAN wide area network
  • Internet service provider Internet service provider
  • each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more functions to implement a specified logical function Executable instructions.
  • the functions noted in the blocks may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts can be implemented by a dedicated hardware-based system that performs the specified function or operation , Or it can be implemented with a combination of dedicated hardware and computer instructions.
  • the units described in the embodiments of the present application may be implemented by software or hardware.
  • the described unit may also be provided in a processor, for example, it may be described as: a processor includes a user information adding unit, a user information query unit, and a user information transfer and encryption unit.
  • a processor includes a user information adding unit, a user information query unit, and a user information transfer and encryption unit.
  • the names of these units do not constitute a limitation on the unit itself in some cases.
  • the user information adding unit may also be described as "the user ID, user information, and The encrypted token corresponds to the stored unit.
  • the present application also provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device.
  • the computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device causes the device to: in response to receiving a user information addition request sent by a terminal device, update the received user information
  • the user identification, user information, and encryption mark in the add request are correspondingly stored, where the encryption mark is an encrypted mark used to characterize the user information in the user information addition request as an encrypted user information ciphertext or used to characterize the addition of user information
  • the user information in the request is an unencrypted mark of the user information that is not encrypted in plain text; in response to receiving a user information transfer request from the terminal device, wherein the user information transfer request includes a user identification and a first transfer instruction, query User information and encryption tokens corresponding to the user ID in the received user information transfer request; in a trusted execution environment, perform a user information transfer operation
  • the first encryption instruction in the encryption request is decrypted to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the encryption key stored in the trusted execution environment of the server is used Decrypt the ciphertext key obtained by decryption to obtain the plaintext key; use the plaintext key obtained by decryption to decrypt the found user information to obtain the user information plaintext; in response to determining that the found encrypted token is an unencrypted token , The found user information is determined as the user information plaintext; the decrypted transfer key is used to encrypt the obtained user information plaintext to obtain the encrypted user information corresponding to the received user information encrypted request.

Abstract

Disclosed are a system and method for processing user information. The system comprises at least one terminal device and a server setting a trusted execution environment. The method comprises: a terminal device sending a user information adding request to a server; the server correspondingly storing a user identifier, user information and an encryption marker in the received user information adding request; the terminal device sending a user identifier and a first re-encryption instruction in a user information query request to the server as a user information re-encryption request; the server querying user information corresponding to the user identifier in the received user information re-encryption request; in the trusted execution environment of the server, executing a user information re-encryption operation to obtain re-encrypted user information, and sending the obtained re-encrypted user information to the terminal device; and the terminal device using a re-encryption key to decrypt the received re-encrypted user information to obtain user information plaintext. The embodiment increases the security of user information.

Description

用于处理用户信息的系统和方法System and method for processing user information
相关申请的交叉引用Cross-reference to related applications
本申请要求于2018年9月5日递交于中国国家知识产权局(CNIPA)的、申请号为201811030446.3、发明名称为“用于处理用户信息的系统和方法”的中国发明专利申请的优先权和权益,该中国发明专利申请通过引用整体并入本文。This application claims the priority and priority of a Chinese invention patent application filed on September 5, 2018 with the China National Intellectual Property Office (CNIPA) with an application number of 201811030446.3 and an invention name of "Systems and Methods for Processing User Information" The rights, the Chinese invention patent application is incorporated herein by reference in its entirety.
技术领域Technical field
本申请实施例涉及计算机技术领域,具体涉及用于处理用户信息的系统和方法。The embodiments of the present application relate to the field of computer technology, and in particular, to a system and method for processing user information.
背景技术Background technique
目前终端用户在使用终端设备上安装的应用或者访问网站时,为了获取应用或者网站提供的各种服务,需要首先输入正确的用户名和密码登录应用或者网站,然后应用或者网站的服务器可以根据用户输入的用户名和密码获取该用户的用户信息,从而根据所获取的用户信息来定制针对该用户的服务。At present, when an end user uses an application installed on a terminal device or accesses a website, in order to obtain various services provided by the application or website, the user or user must first enter the correct user name and password to log in to the application or website. To obtain the user information of the user by using the user name and password of the user, so as to customize the service for the user according to the obtained user information.
应用或者网站的服务提供商可以基于用户信息采用数据挖掘技术对用户进行画像,从而为用户提供更加精准的服务。但是,在服务越做越有针对性的同时,也出现了因为掌管有用户信息所带来的隐私数据被滥用、无休止广告骚扰,用户信息外泄、欺诈盛行等各种问题。Service providers of applications or websites can use data mining technology to profile users based on user information, so as to provide users with more accurate services. However, while the service is getting more and more targeted, various problems such as the abuse of private data brought by the management of user information, endless advertising harassment, leakage of user information, and the prevalence of fraud have also arisen.
发明内容Summary of the Invention
本申请实施例提出了用于处理用户信息的系统和方法。The embodiments of the present application propose a system and method for processing user information.
第一方面,本申请实施例提供了一种用于处理用户信息的系统,该系统包括:至少一个终端设备和服务器,服务器设置可信执行环境,其中:终端设备,被配置成:响应于检测到包括用户标识、待添加用 户信息和明文密钥的加密用户信息添加请求,在对密钥和用户信息加密操作提供支持的目标可信执行环境中,执行密钥和用户信息加密操作,得到与明文密钥对应的密文密钥和与待添加用户信息对应的用户信息密文,以及将包括加密用户信息添加请求中的用户标识、所得到的用户信息密文和加密标记为已加密标记的用户信息添加请求发送给服务器,其中,已加密标记用于表征用户信息添加请求中的用户信息为加密后的用户信息密文,密钥和用户信息加密操作包括:利用目标可信执行环境中存储的加密明文密钥用密钥,对明文密钥进行加密得到与明文密钥对应的密文密钥;以及利用明文密钥对待添加用户信息进行加密,得到与待添加用户信息明文对应的用户信息密文;终端设备,被配置成:响应于检测到包括用户标识、待添加用户信息和加密标记为未加密标记的未加密用户信息添加请求,将未加密用户信息添加请求作为用户信息添加请求发送给服务器,未加密标记用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文;服务器,被配置成:响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储;终端设备,被配置成:响应于检测到用户信息查询请求,用户信息查询请求包括用户标识、密文密钥和转密密钥,利用转密指令公钥对所收到的用户信息查询请求中的密文密钥和转密密钥进行加密得到第一转密指令,以及将用户信息查询请求中的用户标识和所得到的第一转密指令作为与用户信息查询请求对应的用户信息转密请求发送给服务器;服务器,被配置成:响应于接收到终端设备发送的用户信息转密请求,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;在服务器的可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备,其中,用户信息转密操作包括:利用服务器的可信执行环境中存储的与转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用服务器的可信执行环境 中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息;终端设备,被配置成:响应于接收到服务器发送的与所发送的用户信息转密请求对应的转密用户信息,利用所发送的用户信息转密请求所对应的用户信息查询请求中的转密密钥对所收到的转密用户信息进行解密得到用户信息明文。In a first aspect, an embodiment of the present application provides a system for processing user information. The system includes: at least one terminal device and a server, and the server sets a trusted execution environment, where the terminal device is configured to: To the encrypted user information addition request including the user ID, the user information to be added, and the plaintext key, perform the key and user information encryption operation in the target trusted execution environment that supports the key and user information encryption operation, and get The ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added, and the user ID including the encrypted user information addition request, the obtained user information ciphertext, and the encryption mark are encrypted marks. The user information addition request is sent to the server, where the encrypted mark is used to characterize that the user information in the user information addition request is encrypted user information ciphertext. The key and user information encryption operations include: using the target trusted execution environment to store The encrypted plaintext key uses the key, and the plaintext key is encrypted to obtain the same as the plaintext key. A ciphertext key corresponding to the key; and encrypting the user information to be added using the plaintext key to obtain the user information ciphertext corresponding to the plaintext of the user information to be added; the terminal device is configured to: The user information to be added and the unencrypted user information addition request marked as unencrypted are sent to the server as a user information addition request. The unencrypted mark is used to characterize the user information in the user information addition request as Plaintext of unencrypted user information; a server configured to: in response to receiving a user information addition request sent by the terminal device, store the user identification, user information, and encryption mark in the received user information addition request in correspondence; the terminal The device is configured to: in response to detecting a user information query request, the user information query request includes a user identification, a ciphertext key, and a transfer key, and use the transfer key command public key to query the received user information query request. The ciphertext key and the turnkey are encrypted to obtain a first turnkey command. And sending the user identification in the user information query request and the obtained first transfer password instruction to the server as a user information transfer request corresponding to the user information query request; the server is configured to: in response to receiving the User information transfer request, query the user information and encryption token corresponding to the user ID in the received user information transfer request; in the trusted execution environment of the server, perform the user information transfer operation to get the same The user information transfer request corresponding to the user information transfer request, and the obtained user transfer request information is sent to the terminal device that sent the received user information transfer request. The user information transfer operation includes: using the server ’s The private key of the cryptographic instruction corresponding to the public key of the cryptographic instruction stored in the trusted execution environment decrypts the first cryptographic instruction in the received user information cryptographic request to obtain the ciphertext key and the cryptographic password Key; in response to determining that the found encryption token is an encrypted token, utilizing the encryption key stored in the server's trusted execution environment Decrypt the ciphertext key obtained by decryption to obtain the plaintext key; use the plaintext key obtained by decryption to decrypt the found user information to obtain the user information plaintext; in response to determining that the found encrypted token is an unencrypted token , Determine the found user information as user information plaintext; encrypt the obtained user information plaintext by using the decryption key to obtain the encrypted user information corresponding to the received user information secret request; terminal The device is configured to: in response to receiving the encrypted user information corresponding to the transmitted user information encrypted request sent by the server, using the transmitted user information query request corresponding to the encrypted password in the user information transmitted encrypted request The key decrypts the received encrypted user information to obtain the user information in plain text.
第二方面,本申请实施例提供了一种用于处理用户信息的方法,应用于用于处理用户信息的系统中的服务器,用于处理用户信息的系统包括至少一个终端设备和服务器,服务器设置可信执行环境,该方法包括:响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,其中,加密标记为用于表征用户信息添加请求中的用户信息为加密后的用户信息密文的已加密标记或者用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文的未加密标记;响应于接收到终端设备发送的用户信息转密请求,其中,用户信息转密请求包括用户标识和第一转密指令,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;在可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备,其中,用户信息转密操作包括:利用服务器的可信执行环境中存储的与转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所 得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。In a second aspect, an embodiment of the present application provides a method for processing user information, which is applied to a server in a system for processing user information. The system for processing user information includes at least one terminal device and a server, and the server is configured A trusted execution environment. The method includes: in response to receiving a user information addition request sent by a terminal device, storing a user identifier, user information, and encryption mark in the received user information addition request, and storing the encryption mark in a corresponding manner. The user information in the user information adding request is an encrypted mark of the encrypted user information ciphertext or the user information in the user information adding request is an encrypted mark of the unencrypted user information plaintext; in response to receiving A user information transfer request sent to a terminal device, where the user information transfer request includes a user identification and a first transfer instruction, and queries the user information and the encryption token corresponding to the user identification in the received user information transfer request ; In the trusted execution environment, perform user information encryption operation, get The encrypted user information corresponding to the received encrypted user information request, and the obtained encrypted user information is sent to the terminal device that sends the received encrypted user information request. The user information encrypted operation includes: : Use the private key of the cryptographic instruction corresponding to the public key of the cryptographic instruction stored in the trusted execution environment of the server to decrypt the first cryptographic instruction in the received user information cryptographic request to obtain the ciphertext key And the cipher key; in response to determining that the found encryption token is an encrypted token, using the encryption key stored in the trusted execution environment of the server to decrypt the encrypted ciphertext key with the key to obtain the plaintext key; The decrypted user information is decrypted using the plaintext key obtained to decrypt the user information plaintext; in response to determining that the found encrypted tag is an unencrypted tag, the found user information is determined to be the user information plaintext; the decrypted The encryption key encrypts the obtained user information in plain text, and obtains the encryption user information corresponding to the received user information encryption request .
第三方面,本申请实施例提供了一种用于处理用户信息的装置,应用于用于处理用户信息的系统中的服务器,用于处理用户信息的系统包括至少一个终端设备和服务器,服务器设置可信执行环境,该装置包括:用户信息添加单元,被配置成响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,其中,加密标记为用于表征用户信息添加请求中的用户信息为加密后的用户信息密文的已加密标记或者用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文的未加密标记;用户信息查询单元,被配置成响应于接收到终端设备发送的用户信息转密请求,其中,用户信息转密请求包括用户标识和第一转密指令,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;用户信息转密单元,被配置成在可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备,其中,用户信息转密操作包括:利用服务器的可信执行环境中存储的与转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。In a third aspect, an embodiment of the present application provides an apparatus for processing user information, which is applied to a server in a system for processing user information. The system for processing user information includes at least one terminal device and a server, and the server is configured A trusted execution environment, the device includes: a user information adding unit configured to respond to a user information adding request sent by the terminal device, and correspond to the user identification, user information, and encryption token in the received user information adding request Storage, where the encryption tag is an encrypted tag used to characterize the user information in the user information addition request as encrypted user information ciphertext or the user information used to characterize the user information in the user information addition request is unencrypted user information plaintext Unencrypted mark; the user information query unit is configured to respond to receiving a user information transfer request from the terminal device, wherein the user information transfer request includes a user identification and a first transfer instruction, and the query and the received The user information corresponding to the user ID in the user information transfer request and Secret mark; user information transfer unit, configured to perform user information transfer operation in a trusted execution environment, to obtain the transfer user information corresponding to the received user information transfer request, and to transfer the obtained transfer information The confidential user information is sent to the terminal device that sends the received user information transfer request. The user information transfer operation includes: using the transfer instruction private key corresponding to the transfer instruction public key stored in the trusted execution environment of the server. Key to decrypt the first encryption instruction in the received user information encryption request to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the server ’s available encryption token is used. The encryption key stored in the message execution environment uses the key to decrypt the decrypted ciphertext key to obtain the plaintext key; the decrypted user key is used to decrypt the found user information to obtain the user information plaintext; Determine the found encrypted mark as unencrypted mark, determine the found user information as user information plaintext; use the decryption key obtained by decryption User information obtained plaintext is encrypted to obtain the index information corresponding to the user encrypted with the user secret information transfer requests received.
第三方面,本申请实施例提供了一种服务器,包括:一个或多个处理器;存储装置,其上存储有一个或多个程序,当上述一个或多个程序被上述一个或多个处理器执行时,使得上述一个或多个处理器实现如第二方面中任一实现方式描述的方法。In a third aspect, an embodiment of the present application provides a server, including: one or more processors; a storage device storing one or more programs thereon, when the one or more programs are processed by the one or more programs When the processor executes, the foregoing one or more processors implement the method as described in any implementation manner of the second aspect.
第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,其中,该计算机程序被一个或多个处理器执行时实现如第二方面中任一实现方式描述的方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by one or more processors, the computer program is implemented as described in any implementation manner in the second aspect. Methods.
本申请实施例提供的用于处理用户信息的系统和方法,通过在终端设备向服务器中增加用户信息的时候,自主选择将加密的用户信息或者不加密的用户信息添加到服务器中,在服务器中对应记录所添加的用户信息是否经过加密。在用户使用终端设备从服务器中查询用户信息的时候:如果用户信息经过加密,则终端设备需要提供对应的用户信息加密时所使用的明文密钥对应的密文密钥,并在服务器的可信执行环境中对密文密钥解密才能得到明文密钥,再用明文密钥对用户信息进行解密的得到用户信息明文;如果用户信息未经过加密,则可以直接获取用户信息明文,最后再用终端设备查询时所提供的转密密钥对所得到的用户信息明文进行加密,得到转密用户信息,从而在终端设备上可以使用转密密钥对转密用户信息进行解密才能得到用户信息明文。即,对于服务器中的可信执行环境之外的程序,不能取得经过加密的用户信息的用户信息明文,从而也就不能对用户信息明文进行数据挖掘分析,继而保护用户信息数据的安全不外泄。The system and method for processing user information provided in the embodiments of the present application, by adding user information to a server in a terminal device, autonomously selecting to add encrypted user information or unencrypted user information to the server, and in the server Whether the user information added to the corresponding record is encrypted. When the user uses the terminal device to query the user information from the server: If the user information is encrypted, the terminal device needs to provide the corresponding ciphertext key corresponding to the plaintext key used when the user information is encrypted, and the server is trusted. In the execution environment, the plaintext key can be obtained by decrypting the ciphertext key, and the plaintext key is used to decrypt the user information to obtain the plaintext user information. If the user information is not encrypted, you can directly obtain the plaintext user information, and finally use the terminal. The turnkey provided during the device query encrypts the obtained user information plaintext to obtain the turnkey user information, so that the terminal device can use the turnkey to decrypt the turnkey user information to obtain the user information plaintext. That is, for programs outside the trusted execution environment in the server, the user information plaintext of the encrypted user information cannot be obtained, and thus the data mining analysis of the user information plaintext cannot be performed, thereby protecting the security of user information and data. .
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects, and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments with reference to the following drawings:
图1是本申请的一个实施例可以应用于其中的示例性系统架构图;FIG. 1 is an exemplary system architecture diagram to which an embodiment of the present application can be applied; FIG.
图2A是根据本申请的用于处理用户信息的系统的一个实施例的时序图;2A is a sequence diagram of an embodiment of a system for processing user information according to the present application;
图2B是根据本申请的密钥和用户信息加密操作的一个实施例的流程图;2B is a flowchart of an embodiment of a key and user information encryption operation according to the present application;
图2C是根据本申请的用户信息转密操作的一个实施例的流程图;2C is a flowchart of an embodiment of a user information transfer operation according to the present application;
图3A、图3B、图3F、图3H和图3K根据本申请的用于处理用户信息的系统的另一个实施例的时序图;FIG. 3A, FIG. 3B, FIG. 3F, FIG. 3H and FIG. 3K are timing diagrams of another embodiment of a system for processing user information according to the present application;
图3C是根据本申请的第一用户标识生成操作的一个实施例的流程图;3C is a flowchart of an embodiment of a first user ID generating operation according to the present application;
图3D是根据本申请的用户标识验证操作的一个实施例的流程图;3D is a flowchart of an embodiment of a user identity verification operation according to the present application;
图3E是根据本申请的用户验证信息密文生成操作的一个实施例的流程图;3E is a flowchart of an embodiment of a ciphertext generating operation of user authentication information according to the present application;
图3G是根据本申请的第二用户标识生成操作的一个实施例的流程图;3G is a flowchart of an embodiment of a second user identifier generating operation according to the present application;
图3I是根据本申请的用户标识验证信息密文生成操作的一个实施例的流程图;3I is a flowchart of an embodiment of a ciphertext generating operation of user identification verification information according to the present application;
图3J是根据本申请的验证信息生成操作的一个实施例的流程图;3J is a flowchart of an embodiment of a verification information generating operation according to the present application;
图3L是根据本申请的信息加密操作的一个实施例的流程图;3L is a flowchart of an embodiment of an information encryption operation according to the present application;
图3M是根据本申请的第一信息解密操作的一个实施例的流程图;3M is a flowchart of an embodiment of a first information decryption operation according to the present application;
图3O是根据本申请的信息转密操作的一个实施例的流程图;FIG. 3O is a flowchart of an embodiment of an information transfer operation according to the present application; FIG.
图4是根据本申请的用于处理用户信息的方法的一个实施例的流程图;4 is a flowchart of an embodiment of a method for processing user information according to the present application;
图5是根据本申请的用于处理用户信息的装置的一个实施例的结构示意图;以及5 is a schematic structural diagram of an embodiment of a device for processing user information according to the present application; and
图6是适于用来实现本申请实施例的服务器的计算机系统的结构示意图。FIG. 6 is a schematic structural diagram of a computer system suitable for implementing a server according to an embodiment of the present application.
具体实施方式detailed description
下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与有关发明相关的部分。The following describes the present application in detail with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. It should also be noted that, for the convenience of description, only the parts related to the related invention are shown in the drawings.
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The application will be described in detail below with reference to the drawings and embodiments.
图1示出了可以应用本申请的用于处理用户信息的系统或用于处 理用户信息的方法的实施例的示例性系统架构100。FIG. 1 illustrates an exemplary system architecture 100 of an embodiment of a system for processing user information or a method for processing user information to which the present application can be applied.
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1, the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 is a medium for providing a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, and so on.
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。终端设备101、102、103上可以安装有各种通讯客户端应用,例如网页浏览器应用、购物类应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages and the like. Various communication client applications can be installed on the terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, and so on.
终端设备101、102、103可以是硬件,也可以是软件。当终端设备101、102、103为硬件时,可以是具有显示屏的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。当终端设备101、102、103为软件时,可以安装在上述所列举的电子设备中。其可以实现成多个软件或软件模块,也可以实现成单个软件或软件模块。在此不做具体限定。The terminal devices 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules or as a single software or software module. It is not specifically limited here.
服务器105可以是设置有可信执行环境(TEE,Trusted Execution Environment)且提供各种服务的服务器,例如对终端设备101、102、103上显示的网页或者应用提供支持的后台服务器。后台服务器可以对接收到的用户信息添加请求、用户信息查询请求等数据进行分析等处理,并将处理结果(例如,转密用户信息)反馈给终端设备。The server 105 may be a server provided with a Trusted Execution Environment (TEE, Trusted Execution Environment) and providing various services, such as a background server that provides support for web pages or applications displayed on the terminal devices 101, 102, and 103. The background server may analyze and process the received user information addition request, user information query request, and other data, and feed back the processing result (for example, the encrypted user information) to the terminal device.
这里,TEE是与设备上的Rich OS(通常是Android等)并存的运行环境,并且给Rich OS提供安全服务。TEE具有其自身的执行空间。TEE所能访问的软硬件资源是与Rich OS分离的。TEE提供了可信应用(Trusted Application,TA)的安全执行环境,同时也保护可信应用的资源和数据的保密性,完整性和访问权限。为了保证TEE本身的可信根,TEE在安全启动过程中是要通过验证并且与Rich OS隔离的。在TEE中,每个可信应用是相互独立的,而且不能在未授权的情况下不能互相访问。Here, TEE is an operating environment coexisting with Rich OS (usually Android, etc.) on the device, and provides security services for Rich OS. TEE has its own execution space. The software and hardware resources that TEE can access are separated from Rich OS. TEE provides a secure execution environment for Trusted Applications (TA), while also protecting the confidentiality, integrity, and access rights of resources and data of trusted applications. In order to ensure the trusted root of TEE itself, TEE must be verified and isolated from RichOS during the secure boot process. In TEE, each trusted application is independent of each other and cannot be accessed without authorization.
作为示例,服务器中设置的TEE可以采用如下两种方式:As an example, the TEE set in the server can be implemented in the following two ways:
(1)借助特定CPU芯片提供的安全防护能力,比如Intel SGX、 ARM Trust Zone等,构造一个可信执行环境。(1) With the help of security protection capabilities provided by specific CPU chips, such as Intel SGX, ARM Trust Zone, etc., construct a trusted execution environment.
为了保障安全强度,还可以在可信执行环境底层增加可信硬件支持,比如采用符合可信平台模块(TPM,Trusted Platform Module)标准的安全芯片,或采用符合可信密码模块(TCM,Trusted Cryptography Module)标准的安全芯片。In order to ensure the security strength, you can also add trusted hardware support at the bottom of the trusted execution environment, such as using a security chip that complies with the Trusted Platform Module (TPM) standard, or using a Trusted Cryptography that conforms to the Trusted Cryptographic Module (TCM). Module) standard security chip.
(2)采用加密锁(俗称软件狗)实现可信执行环境。(2) A cryptographic lock (commonly known as a software dog) is used to implement a trusted execution environment.
常见的软件狗常包装成一个小巧的USB(Universal Serial Bus,通用串行总线)设备,软件狗内既提供文件存贮,也支持运行经过定制的程序。采用软件狗,可以不必限定服务器的设备类型,只要服务器有USB接口即可,降低了对服务器的设备要求。Common software dogs are often packaged into a compact USB (Universal Serial Bus) device. The software dogs not only provide file storage, but also support running customized programs. With SoftDog, it is not necessary to limit the device type of the server, as long as the server has a USB interface, which reduces the device requirements for the server.
应该理解,软件狗既可以用USB直接连接到服务器,还可以借助类似USB Over Network之类的技术利用TCP/IP通信将USB设备拉远,以远程的逻辑设备方式接入服务器。同样可以理解,这种远程的逻辑设备可以有多个,甚至有成千上万个,形成一种设备池服务方式。It should be understood that the SoftDog can be directly connected to the server using USB, and can also use TCP / IP communication to pull USB devices remotely and access the server as a remote logical device by using technologies such as USB Over Network. It can also be understood that there can be multiple, even thousands of such remote logical devices, forming a device pool service mode.
需要说明的是,本申请实施例所提供的用于处理用户信息的方法一般由服务器105执行,相应地,用于处理用户信息的装置一般设置于服务器105中。It should be noted that the method for processing user information provided in the embodiments of the present application is generally executed by the server 105, and accordingly, a device for processing user information is generally provided in the server 105.
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks, and servers in FIG. 1 are merely exemplary. According to implementation needs, there can be any number of terminal devices, networks, and servers.
继续参考图2A,其示出了根据本申请的用于处理用户信息的系统的一个实施例的时序200。With continued reference to FIG. 2A, a timing diagram 200 of one embodiment of a system for processing user information according to the present application is shown.
本申请实施例中的用于处理用户信息的系统可以包括服务器和至少一个终端设备,服务器与至少一个终端设备之间网络连接,而且服务器中设置有可信执行环境。The system for processing user information in the embodiments of the present application may include a server and at least one terminal device, a network connection between the server and at least one terminal device, and a trusted execution environment is set in the server.
如图2A所示,根据本申请的用于处理用户信息的系统的一个实施例的时序200可以包括以下步骤:As shown in FIG. 2A, the timing sequence 200 of an embodiment of a system for processing user information according to the present application may include the following steps:
步骤201,终端设备响应于检测到加密用户信息添加请求,在对密钥和用户信息加密操作提供支持的目标可信执行环境中,执行密钥和用户信息加密操作,得到与明文密钥对应的密文密钥和与待添加用 户信息对应的用户信息密文,以及将包括加密用户信息添加请求中的用户标识、所得到的用户信息密文和加密标记为已加密标记的用户信息添加请求发送给服务器。Step 201: In response to detecting a request for adding encrypted user information, the terminal device executes the encryption operation of the key and the user information in a target trusted execution environment that provides support for the encryption operation of the key and the user information, and obtains a key corresponding to the plaintext key. Send the ciphertext key and the user information ciphertext corresponding to the user information to be added, and send the user information including the user ID in the encrypted user information addition request, the obtained user information ciphertext, and the encrypted user information marked as encrypted. To the server.
在本实施例中,终端设备可以在检测到包括用户标识、待添加用户信息和明文密钥的加密用户信息添加请求的情况下,在对密钥和用户信息加密操作提供支持的目标可信执行环境中,执行密钥和用户信息加密操作,得到与明文密钥对应的密文密钥和与待添加用户信息对应的用户信息密文,以及将包括加密用户信息添加请求中的用户标识、所得到的用户信息密文和加密标记为已加密标记的用户信息添加请求发送给服务器。其中,已加密标记用于表征用户信息添加请求中的用户信息为加密后的用户信息密文。上述密钥和用户信息加密操作可以包括如图2B所示的子步骤2011和子步骤2012:In this embodiment, when the terminal device detects a request for adding encrypted user information including a user identifier, user information to be added, and a plaintext key, the target device can perform credible execution of the target to support the encryption operation of the key and user information. In the environment, the key and user information encryption operations are performed to obtain the ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added. The obtained user information ciphertext and encrypted user information added with the encrypted mark are sent to the server. The encrypted mark is used to indicate that the user information in the user information adding request is an encrypted user information ciphertext. The above key and user information encryption operation may include sub-step 2011 and sub-step 2012 shown in FIG. 2B:
子步骤2011,利用目标可信执行环境中存储的加密明文密钥用密钥,对所检测到的加密用户信息添加请求中的明文密钥进行加密得到与明文密钥对应的密文密钥。In sub-step 2011, the encrypted plaintext key in the target trusted execution environment is used to encrypt the plaintext key in the detected encrypted user information addition request to obtain a ciphertext key corresponding to the plaintext key.
其中,利用目标可信执行环境中存储的加密明文密钥用密钥,对所检测到的加密用户信息添加请求中的明文密钥进行加密时,可以采用DES(Data Encrytion Standard,美国数据加密标准)算法,3DES/TDEA(三重数据加密算法,Triple Data Encryption Algorithm)算法,AES(Advanced Encryption Standard,高级加密标准)算法、Blowfish算法,RC2算法,RC4算法,RC5算法,IDEA算法(International Data Encryption Algorithm,国际数据加密算法)等各种现在已知或者未来开发的对称加密算法。这里,在目标可信执行环境中存储的加密明文密钥用密钥,不能存储在目标可信执行环境所在的电子设备的可信执行环境之外,目标可信执行环境内的程序可以访问加密明文密钥用密钥,但目标可信环境所在的电子设备的可信执行环境之外的程序不能访问加密明文密钥用密钥,从而可以保证在目标可信执行环境所在的电子设备的可信执行环境之外不能对密文密钥进行解密得到明文密钥。Wherein, using the encrypted plaintext key key stored in the target trusted execution environment to encrypt the plaintext key in the detected encrypted user information addition request, DES (Data Encrytion Standard) can be used. ) Algorithm, 3DES / TDEA (Triple Data Encryption Algorithm, Triple Data Encryption Algorithm) algorithm, AES (Advanced Encryption Standard) algorithm, Blowfish algorithm, RC2 algorithm, RC4 algorithm, RC5 algorithm, IDEA algorithm (International Data Encryption Algorithm) , International data encryption algorithms) and other symmetric encryption algorithms now known or developed in the future. Here, the encrypted plaintext key stored in the target trusted execution environment cannot be stored outside the trusted execution environment of the electronic device where the target trusted execution environment is located, and the program in the target trusted execution environment can access the encryption. The key for the plaintext key, but programs outside the trusted execution environment of the electronic device where the target trusted environment is located cannot access the key for the encrypted plaintext key, which can ensure the availability of the electronic device where the target trusted execution environment is located. Outside the letter execution environment, the ciphertext key cannot be decrypted to obtain the plaintext key.
子步骤2012,利用明文密钥对所检测到的加密用户信息添加请求 中的待添加用户信息进行加密,得到与所检测到的加密用户信息添加请求中的待添加用户信息明文对应的用户信息密文。Sub-step 2012: Use the plaintext key to encrypt the user information to be added in the detected encrypted user information addition request to obtain the user information password corresponding to the detected user information to be added in the encrypted user information addition request. Text.
同理,利用明文密钥对所检测到的加密用户信息添加请求中的待添加用户信息进行加密时,也可以采用各种对称加密算法。Similarly, when using the plaintext key to encrypt the user information to be added in the detected encrypted user information addition request, various symmetric encryption algorithms can also be used.
这里,终端设备可以是至少一个终端设备中的任一终端设备。Here, the terminal device may be any terminal device among at least one terminal device.
这里,目标可信执行环境可以是终端设备中设置的可信执行环境,这样,终端设备可以在该终端设备中设置的可信执行环境中执行密钥和用户信息加密操作。Here, the target trusted execution environment may be a trusted execution environment set in the terminal device. In this way, the terminal device may perform key and user information encryption operations in the trusted execution environment set in the terminal device.
这里,目标可信执行环境还可以是与终端设备网络连接的其他电子设备中设置的可信执行环境,这样,终端设备可以将加密用户信息添加请求发送给上述设置有可信执行环境的电子设备,上述电子设备在上述电子设备的可信执行环境中执行密钥和用户信息加密操作,并得到与明文密钥对应的密文密钥和与待添加用户信息对应的用户信息密文,然后上述电子设备可以将所得到的密文密钥和用户信息密文发送给上述终端设备,从而上述终端设备可以将包括加密用户信息添加请求中的用户标识、所得到的用户信息密文和加密标记为已加密标记的用户信息添加请求发送给服务器。Here, the target trusted execution environment may also be a trusted execution environment set in other electronic devices connected to the terminal device network. In this way, the terminal device may send an encrypted user information addition request to the electronic device provided with the trusted execution environment. , The electronic device performs a key and user information encryption operation in the trusted execution environment of the electronic device, and obtains a ciphertext key corresponding to the plaintext key and a user information ciphertext corresponding to the user information to be added, and then the above The electronic device may send the obtained ciphertext key and user information ciphertext to the terminal device, so that the terminal device may include the user identifier included in the encrypted user information addition request, the obtained user information ciphertext, and the encryption mark as A request to add encrypted user information to the server is sent.
实践中,终端设备可以采用各种实现方式检测加密用户信息添加请求。例如,终端设备可以在检测到用户使用终端设备访问了供用户输入注册用户信息的新用户注册页面,且在该新用户注册页面中输入了用户标识、待添加用户信息和明文密钥的情况下,表明用户希望对所输入的待添加用户信息使用所输入的明文密钥进行加密,即,对该用户而言,所输入的待添加用户信息属于敏感信息,不可以将待添加用户信息明文存储在服务器中,必须要加密后存储在服务器中,这时,终端设备可以确定检测到加密用户信息添加请求。又例如,终端设备还可以在检测到用户打开了终端设备上安装的应用中供用户输入注册用户信息的新用户注册界面,且在该新用户注册界面中输入了用户标识、待添加用户信息和明文密钥的情况下,也表明用户希望对所输入的待添加用户信息使用所输入的明文密钥进行加密,即,对该用户而言,所输入的待添加用户信息属于敏感信息,不可以将待添加用户信 息明文存储在服务器中,必须要加密后存储在服务器中,这时,终端设备也可以确定检测到加密用户信息添加请求。In practice, the terminal device may detect the encrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user uses the terminal device to access a new user registration page for the user to enter registered user information, and the user ID, user information to be added, and plaintext key are entered in the new user registration page. Indicates that the user wishes to encrypt the input user information to be encrypted using the input plaintext key, that is, for the user, the input user information to be added is sensitive information, and the user information to be added cannot be stored in plain text. In the server, it must be encrypted and stored in the server. At this time, the terminal device can determine that an encrypted user information addition request is detected. For another example, the terminal device may also detect that the user has opened a new user registration interface in the application installed on the terminal device for the user to enter registered user information, and the user identification, user information to be added, and In the case of a plaintext key, it also indicates that the user wishes to use the entered plaintext key to encrypt the user information to be added, that is, for the user, the user information to be added is sensitive information and cannot be The user information to be added is stored in the server in plain text, and must be encrypted and stored in the server. At this time, the terminal device may also determine that an encrypted user information addition request is detected.
这里,待添加用户信息可以包括用户的各种属性信息,例如,待添加用户信息可以包括姓名、年龄、性别、手机号码、证件号码、昵称、头像图像、兴趣爱好、职业、收入状况、学历、籍贯、家庭地址、工作地址等等。Here, the user information to be added may include various attribute information of the user. For example, the user information to be added may include name, age, gender, mobile phone number, certificate number, nickname, avatar image, hobbies, occupation, income status, education, Hometown, Home Address, Work Address, etc.
这里,用户标识用于唯一标识服务器所存储的用户信息对应的各个用户。用户标识可以包括以下至少一项:数字、字符和文字。Here, the user identifier is used to uniquely identify each user corresponding to the user information stored by the server. The user ID can include at least one of the following: numbers, characters, and text.
可以理解的是,上与明文密钥对应的密文密钥的生成过程与用户信息密文生成过程是可以分离的。密文密钥必须在可信执行环境中生成,而用户信息密文既可以在可信执行环境中生成,如果当前程序执行环境相对安全(驻留流氓软件或钓鱼软件可能性很低)以及采用标准加解密方法的情况下,也可在可信执行环境之外生成。It can be understood that the ciphertext key generation process corresponding to the plaintext key and the user information ciphertext generation process can be separated. The ciphertext key must be generated in the trusted execution environment, and the user information ciphertext can be generated in the trusted execution environment. If the current program execution environment is relatively secure (the possibility of resident rogue software or phishing software is low) and the In the case of standard encryption and decryption methods, it can also be generated outside the trusted execution environment.
步骤202,终端设备响应于检测到包括用户标识、待添加用户信息和加密标记为未加密标记的未加密用户信息添加请求,将未加密用户信息添加请求作为用户信息添加请求发送给服务器。In step 202, the terminal device sends an unencrypted user information addition request to the server as a user information addition request in response to detecting an unencrypted user information addition request including a user identification, user information to be added, and an encrypted mark as an unencrypted mark.
这里,未加密标记用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文。Here, the unencrypted flag is used to indicate that the user information in the user information adding request is plaintext of the user information that is not encrypted.
作为示例,可以以“0”作为未加密标记,以“1”作为加密标记,或者,还可以以“False”作为未加密标记,以“True”作为加密标记。As an example, "0" may be used as the unencrypted mark, and "1" may be used as the encrypted mark, or "False" may be used as the unencrypted mark, and "True" may be used as the encrypted mark.
实践中,终端设备可以采用各种实现方式检测未加密用户信息添加请求。例如,终端设备可以在检测到用户使用终端设备访问了供用户输入注册用户信息的新用户注册页面,且在该新用户注册页面中输入了用户标识和待添加用户信息但未输入明文密钥的情况下,表明用户不希望对所输入的待添加用户信息进行加密,即,对该用户而言,所输入的待添加用户信息不属于敏感信息,可以将待添加用户信息明文存储在服务器中,这时,终端设备可以确定检测到未加密用户信息添加请求。又例如,终端设备还可以在检测到用户打开了终端设备上安装的应用中供用户输入注册用户信息的新用户注册界面,且在该新用户注册界面中输入了用户标识和待添加用户信息但未输入明文密钥 的情况下,也表明用户不希望对所输入的待添加用户信息进行加密,即,对该用户而言,所输入的待添加用户信息不属于敏感信息,可以将待添加用户信息明文存储在服务器中,这时,终端设备也可以确定检测到未加密用户信息添加请求。In practice, the terminal device may detect the unencrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user has accessed the new user registration page for the user to enter the registered user information using the terminal device, and the user ID and the user information to be added are entered in the new user registration page but the plaintext key is not entered. In this case, it indicates that the user does not want to encrypt the input user information to be added, that is, for the user, the input user information to be added is not sensitive information, and the user information to be added can be stored in plain text in the server. At this time, the terminal device may determine that an unencrypted user information addition request is detected. For another example, the terminal device may also detect that the user has opened a new user registration interface in the application installed on the terminal device for the user to enter registered user information, and the user ID and user information to be added are entered in the new user registration interface but When the plaintext key is not entered, it also indicates that the user does not want to encrypt the input user information to be added, that is, for the user, the input user information to be added is not sensitive information, and the user to be added can be The information is stored in the server in clear text. At this time, the terminal device may also determine that an unencrypted user information addition request is detected.
步骤203,服务器响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储。Step 203: In response to receiving the user information adding request sent by the terminal device, the server stores the user identifier, user information, and encryption mark in the received user information adding request in a corresponding manner.
这里,服务器可以对于所接收到的用户信息添加请求,不管是加密标记为已加密标记的用户信息添加请求,还是加密标记为未加密标记的用户信息添加请求,都可以将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储。Here, the server may add a request for the received user information, whether it is a request for adding user information encrypted and marked as encrypted or a request for adding user information encrypted as unencrypted, the received user information may be added The user ID, user information, and encryption token in the add request are stored correspondingly.
可以理解的是,实践中,由于用户信息的数量巨大,服务器可以将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储在分布式数据库中。It can be understood that, in practice, due to the huge amount of user information, the server may store the user identification, user information, and encryption mark in the received user information addition request in a distributed database.
步骤204,终端设备响应于检测到用户信息查询请求,利用转密指令公钥对所收到的用户信息查询请求中密文密钥和转密密钥进行加密得到第一转密指令,以及将用户信息查询请求中的用户标识和所得到的第一转密指令作为与用户信息查询请求对应的用户信息转密请求发送给服务器。Step 204: In response to detecting the user information query request, the terminal device uses the public key of the cryptographic instruction to encrypt the ciphertext key and the cryptographic key in the received user information query request to obtain the first cryptographic instruction, and The user identification in the user information query request and the obtained first transfer password instruction are sent to the server as a user information transfer password request corresponding to the user information query request.
在本实施例中,终端设备可以在检测到用户信息查询请求的情况下,其中,上述用户信息查询请求包括用户标识、密文密钥和转密密钥,利用转密指令公钥对所收到的用户信息查询请求中的密文密钥和转密密钥进行加密得到第一转密指令,以及将所收到的用户信息查询请求中的用户标识和所得到的第一转密指令作为与所收到的用户信息查询请求对应的用户信息转密请求发送给服务器。In this embodiment, the terminal device may detect a user information query request, where the user information query request includes a user identifier, a ciphertext key, and a transfer key, and the received data is transferred using the transfer key public key. The ciphertext key and the transfer key in the obtained user information query request are encrypted to obtain a first transfer password instruction, and the user ID and the obtained first transfer password instruction in the received user information query request are used as A user information transfer request corresponding to the received user information query request is sent to the server.
这里,用户信息查询请求中的用户标识可以是用户使用终端设备输入的用户标识,即,用户希望查询所输入的用户标识所指示的用户的用户信息。Here, the user ID in the user information query request may be a user ID input by the user using the terminal device, that is, the user wants to query user information of the user indicated by the input user ID.
这里,用户信息是用户使用终端设备经过步骤201、步骤202和步骤203,从终端设备上传并存储到服务器的。如果所添加的用户信 息是经过加密的,终端设备如果要查询已加密的用户信息是需要提供对用户信息进行加密时所用的密钥的,但是为了保证安全,这里不能将对用户信息加密时所使用的明文密钥发送给服务器,避免服务器利用明文密钥解密用户信息,从而造成服务器对用户信息的泄密或者滥用。从步骤201中的描述可知,步骤201中在为用户信息加密时,还生成了与加密用户信息所用的明文密钥对应的密文密钥,而这个所生成的密文密钥也与步骤201中的加密用户信息添加请求中的明文密钥相对应。这里,用户信息查询请求中的密文密钥就是在步骤201中与用户标识为用户信息查询请求中的用户标识的加密用户信息添加请求中的明文密钥对应的密文密钥。用户需要在使用终端设备添加用户信息到服务器中时,记忆步骤201中针对明文密钥所生成的密文密钥,以便在查询用户信息时提供。实践中,为了减少用户的记忆负担,也可以将终端设备的每个用户标识和对应的密文密钥对应存储,比如,对应存储在一个对应关系表中,或者对应存储在终端设备的操作系统的注册表中。这样,终端设备可以通过上述对应存储关系来获取与用户标识对应的密文密钥。Here, the user information is uploaded from the terminal device and stored to the server by the user using the terminal device through steps 201, 202, and 203. If the added user information is encrypted, the terminal device needs to provide the key used to encrypt the user information if it needs to query the encrypted user information, but to ensure security, the user information cannot be encrypted here. The plaintext key used is sent to the server to prevent the server from using the plaintext key to decrypt the user information, thereby causing the server to leak or abuse the user information. From the description in step 201, when encrypting the user information in step 201, a ciphertext key corresponding to the plaintext key used to encrypt the user information is also generated, and the generated ciphertext key is also the same as that in step 201. The encrypted user information in the corresponding request corresponds to the plaintext key. Here, the ciphertext key in the user information query request is the ciphertext key corresponding to the plaintext key in the encrypted user information adding request whose user identifier is the user identifier in the user information query request in step 201. When the user needs to add user information to the server using the terminal device, the user needs to memorize the ciphertext key generated for the plaintext key in step 201 so as to provide it when querying the user information. In practice, in order to reduce the memory burden of the user, each user ID of the terminal device and the corresponding ciphertext key may be stored correspondingly, for example, correspondingly stored in a correspondence table, or stored in the operating system of the terminal device. In the registry. In this way, the terminal device can obtain the ciphertext key corresponding to the user identity through the foregoing corresponding storage relationship.
这里,用户信息查询请求中的转密密钥可以是终端设备接收用户输入的密钥字符串,或者,用户信息查询请求中的转密密钥也可以是终端设备随机生成的密钥。Here, the transfer key in the user information query request may be a key string received by the terminal device from the user, or the transfer key in the user information query request may be a key randomly generated by the terminal device.
这里,利用转密指令公钥对所收到的用户信息查询请求中密文密钥和转密密钥进行加密可以是采用现在已知或未来开发的各种非对称加密算法,包括但不限于:RSA加密算法、Elgamal算法、背包算法、D-H算法、ECC(椭圆曲线加密算法)等。而加密所使用的转密指令公钥是非对称加密过程中所使用的公钥。Here, using the public key of the cryptographic instruction to encrypt the ciphertext key and the cryptographic key in the received user information query request may use various asymmetric encryption algorithms known now or developed in the future, including but not limited to : RSA encryption algorithm, Elgamal algorithm, backpack algorithm, DH algorithm, ECC (Elliptic Curve Encryption Algorithm), etc. The public key of the turnkey instruction used for encryption is the public key used in the asymmetric encryption process.
步骤205,服务器响应于接收到终端设备发送的用户信息转密请求,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记,在服务器的可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。Step 205: The server, in response to receiving the user information transfer request sent by the terminal device, queries the user information and the encryption token corresponding to the user ID in the received user information transfer request, and in the trusted execution environment of the server, Perform the user information transfer encryption operation to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to the terminal device that sends the received user information transfer request.
由于服务器对应存储有用户标识、用户信息和加密标记,因此,服务器可以在接收到终端设备发送的用户信息转密请求的情况下,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记,并在服务器的可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。其中,上述用户信息转密操作可以包括如图2C所示的子步骤2051到子步骤2052:Since the server correspondingly stores the user ID, user information, and encryption mark, the server can query the corresponding user ID in the received user information transfer request when receiving the user information transfer request sent by the terminal device. User information and encryption tokens, and perform the user information transfer operation in the trusted execution environment of the server to obtain the transfer user information corresponding to the received user information transfer request, and the obtained transfer user The information is sent to the terminal device that sends the received user information transfer request. The above-mentioned operation of transferring user information may include sub-steps 2051 to 2052 as shown in FIG. 2C:
子步骤2051,利用服务器的可信执行环境中存储的与转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥。Sub-step 2051, using the private key of the cryptographic instruction corresponding to the public key of the cryptographic instruction stored in the trusted execution environment of the server, decrypting the first cryptographic instruction in the received user information cryptographic request to obtain the secret Text key and cipher key.
这里的转密指令私钥是和步骤204中对所收到的用户信息查询请求中密文密钥和转密密钥进行加密所使用的转密指令公钥对应的解密所用的私钥。转密指令公钥可以存储在服务器可信执行环境之外和可信执行环境之内。而转密指令私钥只能存储在服务器或者终端设备的可信执行环境之内,转密指令私钥只能被服务器或者终端设备的可信执行环境之内的程序访问,不能被服务器的可信执行环境之外的程序和终端设备的可信执行环境之外的程序访问。The private key of the cryptographic instruction here is the private key used for decryption corresponding to the public key of the cryptographic instruction used to encrypt the ciphertext key and the cryptographic key in the received user information query request in step 204. The cryptographic instruction public key can be stored outside the server's trusted execution environment and inside the trusted execution environment. The private key of the cryptographic instruction can only be stored in the trusted execution environment of the server or the terminal device. The private key of the cryptographic instruction can only be accessed by the program in the trusted execution environment of the server or the terminal device. It cannot be accessed by the server. Access to programs outside the trusted execution environment and programs outside the trusted execution environment of the terminal device.
子步骤2052,响应于确定查找到的加密标记为已加密标记,利用服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥。Sub-step 2052, in response to determining that the found encryption token is an encrypted token, using the encryption key stored in the trusted execution environment of the server to decrypt the encrypted ciphertext key with the key to obtain a plaintext key.
子步骤2053,利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文。Sub-step 2053: Decrypt the found user information by using the decrypted plaintext key to obtain the user information plaintext.
子步骤2054,响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文。Sub-step 2054, in response to determining that the found encrypted tag is an unencrypted tag, determining the found user information as user information plaintext.
子步骤2055,利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。Sub-step 2055: Encrypt the obtained user information in plain text by using the decrypted transfer key to obtain the transferred user information corresponding to the received user information transfer request.
经过用户信息转密操作,在服务器的可信执行环境中对用户信息明文利用转密密钥进行了加密,服务器的可信执行环境之外的程序只能获取经过转密密钥加密之后的转密用户信息,不能获取用户信息明 文,从而避免了服务器泄露用户信息明文。After the user information is encrypted, the user information is encrypted in the server's trusted execution environment using the encryption key. Programs outside the server's trusted execution environment can only obtain the encrypted message after the encryption key is encrypted. Confidential user information cannot be obtained in plain text of user information, thereby preventing the server from revealing plain text of user information.
步骤206,终端设备响应于接收到服务器发送的与所发送的用户信息转密请求对应的转密用户信息,利用所发送的用户信息转密请求所对应的用户信息查询请求中的转密密钥对所收到的转密用户信息进行解密得到用户信息明文。Step 206: The terminal device, in response to receiving the user information corresponding to the user information transfer request sent by the server, uses the user information corresponding to the user information transfer request to query the transfer key in the request. The received encrypted user information is decrypted to obtain the user information in plain text.
在一些可选实现方式中,加密用户信息添加请求中的用户标识、未加密用户信息添加请求中的用户标识和用户信息查询请求中的用户标识可以是终端设备的用户标识集合中的用户标识。即,针对每个终端设备,在该终端设备中存储有该终端设备的用户标识集合,步骤201中终端设备检测到的加密用户信息添加请求中的用户标识是该终端设备中存储的用户标识集合中的用户标识,步骤202中终端设备检测到的未加密用户信息添加请求中的用户标识也是该终端设备中存储的用户标识集合中的用户标识,步骤204中终端设备检测到的用户信息查询请求中的用户标识也是该终端设备中存储的用户标识集合中的用户标识。In some optional implementation manners, the user identifier in the encrypted user information addition request, the user identifier in the unencrypted user information addition request, and the user identifier in the user information query request may be the user identifier in the user identifier set of the terminal device. That is, for each terminal device, a user identifier set of the terminal device is stored in the terminal device. The user identifier in the encrypted user information addition request detected by the terminal device in step 201 is the user identifier set stored in the terminal device. User ID in step 202, the user ID in the unencrypted user information addition request detected by the terminal device in step 202 is also the user ID in the user ID set stored in the terminal device, and the user information query request detected by the terminal device in step 204 The user ID in is also the user ID in the user ID set stored in the terminal device.
在一些可选实现方式中,服务器可以为支持OAuth2协议的资源服务器。In some optional implementation manners, the server may be a resource server supporting the OAuth2 protocol.
本申请的上述实施例提供的用于处理用户信息的系统,通过在终端设备向服务器中增加用户信息的时候,自主选择将加密的用户信息或者不加密的用户信息添加到服务器中,在服务器中对应记录所添加的用户信息是否经过加密。在用户使用终端设备从服务器中查询用户信息的时候,如果用户信息经过加密,终端设备需要提供对应的用户信息加密时所使用的明文密钥对应的密文密钥,并在服务器的可信执行环境中对密文密钥解密才能得到明文密钥,再用明文密钥对用户信息进行解密的得到用户信息明文,如果用户信息未经过加密,则可以直接获取用户信息明文,最后再用终端设备查询时所提供的转密密钥对所得到的用户信息明文进行加密,得到转密用户信息,从而在终端设备上可以使用转密密钥对转密用户信息进行解密才能得到用户信息明文,即,对于服务器中的可信执行环境之外的程序,不能取得经过加密的用户信息的用户信息明文,从而也就不能对用户信息明文进行 数据挖掘分析,继而保护用户信息数据的安全不外泄。The system for processing user information provided by the foregoing embodiments of the present application, by adding user information to a server in a terminal device, autonomously chooses to add encrypted user information or unencrypted user information to the server, and in the server Whether the user information added to the corresponding record is encrypted. When a user uses a terminal device to query user information from the server, if the user information is encrypted, the terminal device needs to provide a corresponding ciphertext key corresponding to the plaintext key used when the user information is encrypted, and the trusted execution of the server The plaintext key can be obtained by decrypting the ciphertext key in the environment, and then the plaintext key is used to decrypt the user information to obtain the plaintext user information. If the user information is not encrypted, you can directly obtain the plaintext user information, and then use the terminal device. The encipherment key provided in the query is used to encrypt the obtained plaintext user information to obtain the enciphered user information. Therefore, on the terminal device, the enciphered user information can be decrypted using the encipherment key to obtain the plaintext of the user information, that is, For programs outside the trusted execution environment in the server, the user information plaintext of the encrypted user information cannot be obtained, and thus the data mining analysis of the user information plaintext cannot be performed, and the user information data is protected from leakage.
进一步参考图3A,其示出了根据本申请的用于处理用户信息的系统的又一个实施例的时序300。Further reference is made to FIG. 3A, which illustrates a timing sequence 300 of yet another embodiment of a system for processing user information according to the present application.
本申请实施例中的用于处理用户信息的系统可以包括服务器和至少一个终端设备,服务器与至少一个终端设备之间网络连接,而且服务器中设置有可信执行环境。The system for processing user information in the embodiments of the present application may include a server and at least one terminal device, a network connection between the server and at least one terminal device, and a trusted execution environment is set in the server.
如图3A所示,根据本申请的用于处理用户信息的系统的又一个实施例的时序300可以包括以下步骤:As shown in FIG. 3A, the timing sequence 300 according to another embodiment of the system for processing user information according to the present application may include the following steps:
步骤301,终端设备响应于检测到包括用户标识、用户信息范围标识、待添加用户信息和明文密钥的加密用户信息添加请求,在对密钥和用户信息加密操作提供支持的目标可信执行环境中,执行密钥和用户信息加密操作,得到与明文密钥对应的密文密钥和与待添加用户信息对应的用户信息密文,以及将包括加密用户信息添加请求中的用户标识和用户信息范围标识、所得到的用户信息密文以及加密标记为已加密标记的用户信息添加请求发送给服务器。In step 301, the terminal device responds to a request for adding encrypted user information including a user identifier, a user information range identifier, user information to be added, and a plaintext key, and targets a trusted execution environment for the key and user information encryption operations. , Perform encryption operations on the key and user information to obtain the ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added, and the user ID and user information included in the encrypted user information addition request The range identifier, the obtained user information ciphertext, and the user information encryption request that is encrypted and marked as encrypted are sent to the server.
在本实施例中,终端设备可以在检测到包括用户标识、用户信息范围标识、待添加用户信息和明文密钥的加密用户信息添加请求的情况下,在对密钥和用户信息加密操作提供支持的目标可信执行环境中,执行密钥和用户信息加密操作,得到与明文密钥对应的密文密钥和与待添加用户信息对应的用户信息密文,以及将包括加密用户信息添加请求中的用户标识、用户信息范围标识、所得到的用户信息密文以及加密标记为已加密标记的用户信息添加请求发送给服务器。其中,已加密标记用于表征用户信息添加请求中的用户信息为加密后的用户信息密文。上述密钥和用户信息加密操作可以包括如图2B所示的子步骤2011和子步骤2012,具体可以参考图2A所示的实施例中步骤201中的相关描述,在此不再赘述。In this embodiment, the terminal device may provide support for the encryption operation of the key and the user information in a case where an encrypted user information addition request including a user ID, a user information range identifier, user information to be added, and a plaintext key is detected. In the target trusted execution environment, perform key and user information encryption operations to obtain the ciphertext key corresponding to the plaintext key and the user information ciphertext corresponding to the user information to be added, and add the encrypted user information to the request And send a request for adding the user ID, the user information range ID, the obtained user information ciphertext, and the user information whose encryption mark is an encrypted mark to the server. The encrypted mark is used to indicate that the user information in the user information adding request is an encrypted user information ciphertext. The encryption operation of the key and the user information may include sub-steps 2011 and sub-steps 2012 as shown in FIG. 2B. For details, refer to the related description in step 201 in the embodiment shown in FIG. 2A, and details are not described herein again.
这里,关于终端设备、目标可信执行环境、待添加用户信息和用户标识,可以参考图2A所示的实施例中步骤201中的相关描述,在此不再赘述。Here, regarding the terminal device, the target trusted execution environment, the user information to be added, and the user identifier, reference may be made to the related description in step 201 in the embodiment shown in FIG. 2A, and details are not described herein again.
这里,用户信息范围标识用于指示用户信息所包括的各种属性信息中的至少一种属性信息,也可以理解为用户信息范围标识用于指示用户信息所包括的各个字段中的至少一个字段。实践中,可以将用户信息所包括的各种属性信息按照每种属性信息的隐私程度和/或重要程度进行分类,标定每种属性信息所属的用户信息范围标识。例如,可以标定“1”、“2”和“3”三个用户信息范围标识,其中,用户信息范围标识“1”用于指示隐私程度和/或重要程度较低的用户属性信息,比如,“兴趣爱好”、“头像图片”、“昵称”等等,用户信息范围标识“2”用于指示隐私程度和/或重要程度稍高的用户属性信息,比如,“姓名”、“性别”、“年龄”等等,用户信息范围标识“3”用于指示隐私程度和/或重要程度最高的用户属性信息,比如,“手机号码”、“证件号码”、“家庭地址”、“工作地址”等等。Here, the user information range identifier is used to indicate at least one kind of attribute information among various attribute information included in the user information, and it can also be understood that the user information range identifier is used to indicate at least one of various fields included in the user information. In practice, various attribute information included in the user information may be classified according to the privacy degree and / or importance degree of each attribute information, and the user information range identifier to which each attribute information belongs is marked. For example, three user information range identifiers "1", "2", and "3" may be marked, where the user information range identifier "1" is used to indicate user attribute information with a low degree of privacy and / or importance, such as, "Interests and hobbies", "avatar pictures", "nicknames", etc. The user information range identifier "2" is used to indicate user attribute information with a higher degree of privacy and / or importance, such as "name", "gender", "Age", etc. The user information range identifier "3" is used to indicate the user attribute information with the highest degree of privacy and / or importance, such as "mobile phone number", "certificate number", "home address", "work address" and many more.
实践中,终端设备可以采用各种实现方式检测加密用户信息添加请求。例如,终端设备可以在检测到用户使用终端设备访问了供用户输入注册用户信息的新用户注册页面,且在该新用户注册页面中输入了用户标识、用户信息范围标识、待添加用户信息和明文密钥的情况下,表明用户希望对所输入的待添加用户信息使用所输入的明文密钥进行加密,即,对该用户而言,所输入的待添加用户信息属于敏感信息,不可以将待添加用户信息明文存储在服务器中,必须要加密后存储在服务器中,这时,终端设备可以确定检测到加密用户信息添加请求。又例如,终端设备还可以在检测到用户打开了终端设备上安装的应用中供用户输入注册用户信息的新用户注册界面,且在该新用户注册界面中输入了用户标识、用户信息范围标识、待添加用户信息和明文密钥的情况下,也表明用户希望对所输入的待添加用户信息使用所输入的明文密钥进行加密,即,对该用户而言,所输入的待添加用户信息属于敏感信息,不可以将待添加用户信息明文存储在服务器中,必须要加密后存储在服务器中,这时,终端设备也可以确定检测到加密用户信息添加请求。In practice, the terminal device may detect the encrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user has accessed the new user registration page for the user to input the registered user information using the terminal device, and the user identification, the user information range identification, the user information to be added, and the plain text are entered in the new user registration page. In the case of a key, it indicates that the user wishes to encrypt the user information to be added using the entered plaintext key, that is, for the user, the user information to be added is sensitive information, and the user information cannot be The added user information is stored in the server in clear text and must be stored in the server after encryption. At this time, the terminal device can determine that an encrypted user information addition request is detected. For another example, the terminal device may also detect that the user has opened a new user registration interface in the application installed on the terminal device for the user to enter registered user information, and the user identification, user information range identifier, In the case of the user information to be added and the plaintext key, it also indicates that the user wishes to use the entered plaintext key to encrypt the user information to be added, that is, for the user, the user information to be added belongs to For sensitive information, the user information to be added cannot be stored in the server in plain text. It must be encrypted and stored in the server. At this time, the terminal device can also determine that an encrypted user information addition request is detected.
步骤302,终端设备响应于检测到包括用户标识、用户信息范围标识、待添加用户信息和加密标记为未加密标记的未加密用户信息添 加请求,将未加密用户信息添加请求作为用户信息添加请求发送给服务器。Step 302: The terminal device responds to detecting an unencrypted user information addition request including a user ID, a user information range identifier, user information to be added, and an encrypted mark that is an unencrypted mark, and sends the unencrypted user information addition request as a user information addition request. To the server.
这里,未加密标记用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文。Here, the unencrypted flag is used to indicate that the user information in the user information adding request is plaintext of the user information that is not encrypted.
实践中,终端设备可以采用各种实现方式检测未加密用户信息添加请求。例如,终端设备可以在检测到用户使用终端设备访问了供用户输入注册用户信息的新用户注册网页,且在该新用户注册网页中输入了用户标识、用户信息范围标识和待添加用户信息但未输入明文密钥的情况下,表明用户不希望对所输入的待添加用户信息进行加密,即,对该用户而言,所输入的待添加用户信息不属于敏感信息,可以将待添加用户信息明文存储在服务器中,这时,终端设备可以确认检测到未加密用户信息添加请求。又例如,终端设备还可以在检测到用户打开了终端设备上安装的某应用的供用户输入注册用户信息的新用户注册界面,且在该新用户注册界面中输入了用户标识、用户信息范围标识和待添加用户信息但未输入明文密钥的情况下,也表明用户不希望对所输入的待添加用户信息进行加密,即,对该用户而言,所输入的待添加用户信息不属于敏感信息,可以将待添加用户信息明文存储在服务器中,这时,终端设备也可以确认检测到未加密用户信息添加请求。In practice, the terminal device may detect the unencrypted user information addition request in various implementation manners. For example, the terminal device may detect that the user has used the terminal device to access a new user registration webpage for the user to enter registered user information, and the user identity, user information range identifier, and user information to be added are entered in the new user registration webpage but not yet When the plaintext key is entered, it indicates that the user does not want to encrypt the user information to be added, that is, for the user, the user information to be added is not sensitive information, and the user information to be added can be plaintext. Stored in the server, at this time, the terminal device can confirm that an unencrypted user information addition request is detected. For another example, the terminal device may also detect that the user has opened an application installed on the terminal device for the user to input a new user registration interface for the registered user information, and a user identifier and a user information range identifier are entered in the new user registration interface When the user information to be added is not entered in the clear text key, it also indicates that the user does not want to encrypt the user information to be added, that is, for the user, the user information to be added is not sensitive information , The user information to be added can be stored in plain text in the server. At this time, the terminal device can also confirm that an unencrypted user information addition request is detected.
步骤303,服务器响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储。Step 303: In response to receiving the user information adding request sent by the terminal device, the server stores the user identifier, the user information range identifier, the user information, and the encryption mark in the received user information adding request in a corresponding manner.
这里,服务器可以对于所接收到的用户信息添加请求,不管是加密标记为已加密标记的用户信息添加请求,还是加密标记为未加密标记的用户信息添加请求,都可以将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储。Here, the server may add a request for the received user information, whether it is a request for adding user information encrypted and marked as encrypted or a request for adding user information encrypted as unencrypted, the received user information may be added The user ID, user information range ID, user information, and encryption tag in the add request are correspondingly stored.
可以理解的是,实践中,由于用户信息的数量巨大,服务器可以将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储在分布式数据库中。It can be understood that, in practice, due to the huge amount of user information, the server may store the user identification, user information range identification, user information, and encryption mark in the received user information addition request in a distributed database.
步骤304,终端设备响应于检测到用户信息查询请求,利用转密 指令公钥对所收到的用户信息查询请求中密文密钥和转密密钥进行加密得到第一转密指令,以及将用户信息查询请求中的用户标识和用户信息范围标识以及所得到的第一转密指令作为与用户信息查询请求对应的用户信息转密请求发送给服务器。Step 304: In response to detecting the user information query request, the terminal device uses the public key of the cryptographic instruction to encrypt the ciphertext key and the cryptographic key in the received user information query request to obtain the first cryptographic instruction, and The user identifier and user information range identifier in the user information query request and the obtained first transfer password instruction are sent to the server as a user information transfer password request corresponding to the user information query request.
在本实施例中,终端设备可以在检测到用户信息查询请求的情况下,其中,上述用户信息查询请求包括用户标识、用户信息范围标识、密文密钥和转密密钥,利用转密指令公钥对所收到的用户信息查询请求中的密文密钥和转密密钥进行加密得到第一转密指令,以及将所收到的用户信息查询请求中的用户标识和用户信息范围标识以及所得到的第一转密指令作为与所收到的用户信息查询请求对应的用户信息转密请求发送给服务器。In this embodiment, the terminal device may detect a user information query request, where the user information query request includes a user identifier, a user information range identifier, a ciphertext key, and a cipher key. The public key encrypts the ciphertext key and the turnkey in the received user information query request to obtain a first turnkey instruction, and the user identifier and the user information range identifier in the received user information query request And the obtained first encryption instruction is sent to the server as a user information encryption request corresponding to the received user information query request.
这里,用户信息查询请求中的用户标识可以是用户使用终端设备输入的用户标识,即,用户希望查询所输入的用户标识所指示的用户的用户信息。Here, the user ID in the user information query request may be a user ID input by the user using the terminal device, that is, the user wants to query user information of the user indicated by the input user ID.
这里,用户信息查询请求中的用户信息范围标识可以是用户使用终端设备输入的用户信息范围标识,即,用户希望查询所输入的用户标识所指示的用户的所输入的用户信息范围标识范围内的用户信息。Here, the user information range identifier in the user information query request may be the user information range identifier input by the user using the terminal device, that is, the user wishes to query the user information range identifier range of the user indicated by the input user ID. User Info.
这里,关于密文密钥、转密密钥和转密指令公钥,可以参考图2A所示的实施例中步骤204中的相关描述,在此不再赘述。Here, regarding the ciphertext key, the cipher key, and the cipher command public key, reference may be made to the related description in step 204 in the embodiment shown in FIG. 2A, and details are not described herein again.
步骤305,服务器响应于接收到终端设备发送的用户信息转密请求,查询与所收到的用户信息转密请求中的用户标识和用户信息范围标识对应的用户信息和加密标记,在服务器的可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。Step 305: The server, in response to receiving the user information transfer request sent by the terminal device, queries the user information and the encryption mark corresponding to the user identifier and the user information range identifier in the received user information transfer request. In the letter execution environment, a user information transfer operation is performed to obtain the transfer user information corresponding to the received user information transfer request, and the obtained transferred user information is transmitted to the received user information transfer request. The requested end device.
由于服务器对应存储有用户标识、用户信息范围标识、用户信息和加密标记,因此,服务器可以在接收到终端设备发送的用户信息转密请求的情况下,查询与所收到的用户信息转密请求中的用户标识和用户信息范围标识对应的用户信息和加密标记,并在服务器的可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请 求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。Since the server correspondingly stores a user ID, a user information range identifier, a user information, and an encryption mark, the server can query and receive the user information transfer request when the user information transfer request is received from the terminal device. User ID and user information range ID in the corresponding user information and encryption mark, and in the server's trusted execution environment, perform user information encryption operation to obtain the encrypted user corresponding to the received user information encryption request Information and the obtained encrypted user information is sent to the terminal device that sends the received user information encrypted request.
其中,上述用户信息转密操作可以包括如图2C所示的子步骤2051到子步骤2052,具体可以参考图2A所示的实施例中步骤205中的相关描述,在此不再赘述。The above-mentioned operation of transferring user information may include sub-step 2051 to sub-step 2052 as shown in FIG. 2C. For details, refer to the related description in step 205 in the embodiment shown in FIG. 2A, and details are not described herein again.
经过用户信息转密操作,在服务器的可信执行环境中对用户信息明文利用转密密钥进行了加密,服务器的可信执行环境之外的程序只能获取经过转密密钥加密之后的转密用户信息,不能获取用户信息明文,从而避免了服务器泄露用户信息明文。After the user information is encrypted, the user information is encrypted in the server's trusted execution environment using the encryption key. Programs outside the server's trusted execution environment can only obtain the encrypted message after the encryption key is encrypted. Confidential user information cannot be obtained in plain text of user information, thereby preventing the server from revealing plain text of user information.
步骤306,终端设备响应于接收到服务器发送的与所发送的用户信息转密请求对应的转密用户信息,利用所发送的用户信息转密请求所对应的用户信息查询请求中的转密密钥对所收到的转密用户信息进行解密得到用户信息明文。Step 306: The terminal device, in response to receiving the user information corresponding to the sent user information data encryption request sent by the server, uses the user information corresponding to the sent user information data encryption request to query the data encryption key in the request. The received encrypted user information is decrypted to obtain the user information in plain text.
在本实施例中,步骤306的具体操作与图2A所示的实施例中步骤206的具体操作基本相同,在此不再赘述。In this embodiment, the specific operation of step 306 is basically the same as the specific operation of step 206 in the embodiment shown in FIG. 2A, and details are not described herein again.
在本实施例中,加密用户信息添加请求中的用户标识、未加密用户信息添加请求中的用户标识和用户信息查询请求中的用户标识可以是终端设备的用户标识集合中的用户标识。In this embodiment, the user identifier in the encrypted user information addition request, the user identifier in the unencrypted user information addition request, and the user identifier in the user information query request may be the user identifier in the user identifier set of the terminal device.
由于页面显示限制,下面继续参考图3B,需要说明的是,图3B的流程除了包括图3B中所示的各个步骤外,还可以包括图3A中所示的各个步骤。另外,需要说明的是,图3B中所示的第一终端设备和第二终端设备除了可以执行图3B中所示的相应步骤外,还可以执行图3A中所示的终端设备可以执行的各个步骤。Due to the limitation of page display, the following reference is continued to FIG. 3B. It should be noted that the process of FIG. 3B may include various steps shown in FIG. 3A in addition to the steps shown in FIG. 3B. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3B can perform various steps that the terminal device shown in FIG. 3A can perform in addition to the corresponding steps shown in FIG. 3B. step.
在某些情况下,本实施例可以具有以下可选实现方式:In some cases, this embodiment may have the following optional implementations:
可选实现方式(一):用于处理用户信息的系统中的至少一个终端设备可以包括至少一个设置可信执行环境的第一终端设备,以及上述时序300还可以包括如图3B所示的步骤307:Alternative implementation (1): At least one terminal device in a system for processing user information may include at least one first terminal device that sets a trusted execution environment, and the above-mentioned sequence 300 may further include steps as shown in FIG. 3B 307:
步骤307,第一终端设备响应于检测到包括第一用户标识类别标识的第一用户标识生成请求,在该第一终端设备的可信执行环境中,执行第一用户标识生成操作,得到与第一用户标识生成请求对应的用 户标识,以及将所得到的用户标识添加到该第一终端设备的用户标识集合中。Step 307: In response to detecting the first user ID generation request including the first user ID category ID, the first terminal device executes the first user ID generation operation in the trusted execution environment of the first terminal device, and obtains the first user ID generation request. A user ID corresponding to a user ID generation request, and adding the obtained user ID to a user ID set of the first terminal device.
实践中,终端设备可以采用各种实现方式检测第一用户标识生成请求。例如,终端设备可以在检测到用户使用终端设备访问了包括供用户输入用户标识类别标识的页面元素(例如,文本框或者下拉菜单等)的用户标识生成页面,并在上述供用户输入用户标识类别标识的页面元素中输入了第一用户标识类别标识时,确定检测到第一用户标识生成请求。又例如,终端设备还可以在检测到用户打开了终端设备上安装的应用中的用户标识生成界面,输入了第一用户标识类别标识,并点击了关联有第一用户标识生成操作的控件(例如,按钮)时,确定检测到第一用户标识生成请求。In practice, the terminal device may detect the first user identifier generation request in various implementation manners. For example, the terminal device may detect that the user uses the terminal device to access a user identification generating page including a page element (for example, a text box or a drop-down menu) for the user to input the user identification category identification, and the user identification category is entered in the foregoing. When the first user ID category ID is input in the identified page element, it is determined that the first user ID generation request is detected. For another example, the terminal device may also detect that the user has opened a user ID generation interface in an application installed on the terminal device, entered a first user ID category ID, and clicked a control (for example, associated with a first user ID generation operation) (for example, , Button), it is determined that the first user ID generation request is detected.
这里,第一用户标识类别标识用于指示第一终端设备的用户标识集合中用户标识的类别。实践中,可以按照各种方式对用户标识集合中的用户标识进行分类,每个分类对应不同的第一用户标识类别,而第一用户标识类别标识用于指示不同的第一用户标识类别。作为示例,可以按照所生成的用户标识所应用于的应用的所属类型来进行分类,比如,如果用户希望生成用于社交应用或者社交网站的用户标识,那么,可以输入或者选择社交应用或者社交网站对应的用户标识类别标识生成第一用户标识生成请求。又比如,如果用户希望生成购物应用或者购物网站的用户标识,那么,可以输入或者选择购物应用或者购物网站对应的用户标识类别标识生成第一用户标识生成请求。作为示例,还可以按照递增的方式确定第一用户标识类别标识,即,第一终端设备可以存储有当前第一用户标识类别标识,当检测到用户输入的希望生成用户标识的指令时,第一终端设备可以获取上述存储的当前第一用户标识类别标识,并将所获取的当前第一用户标识类别标识进行递增更新,用递增更新之后的当前第一用户标识类别标识生成第一用户标识生成请求。Here, the first user identifier category identifier is used to indicate a category of a user identifier in a user identifier set of the first terminal device. In practice, user identifiers in a user identifier set can be classified in various ways, each classification corresponding to a different first user identifier category, and the first user identifier category identifier is used to indicate a different first user identifier category. As an example, the classification may be performed according to the type of the application to which the generated user ID is applied. For example, if the user wishes to generate a user ID for a social application or a social website, then the user may enter or select a social application or a social website. The corresponding user identifier category identifier generates a first user identifier generation request. For another example, if the user wishes to generate a user identification of a shopping application or a shopping website, then a user identification category identifier corresponding to the shopping application or a shopping website may be input or selected to generate a first user identification generating request. As an example, the first user identifier category identifier may also be determined in an incremental manner, that is, the first terminal device may store the current first user identifier category identifier. When an instruction input by a user that wishes to generate a user identifier is detected, the first The terminal device may obtain the current first user identification category identifier stored above, and incrementally update the acquired current first user identification category identifier, and generate a first user identification generation request using the current first user identification category identifier after the incremental update. .
这里,第一终端设备可以在检测到包括第一用户标识类别标识的第一用户标识生成请求的情况下,在该第一终端设备的可信执行环境中,执行第一用户标识生成操作,得到与第一用户标识生成请求对应 的用户标识,以及将所得到的用户标识添加到该第一终端设备的用户标识集合中。这里,上述第一用户标识生成操作可以包括如图3C所示的子步骤3071到子步骤3073:Here, when the first terminal device detects a first user identifier generation request including the first user identifier category identifier, in a trusted execution environment of the first terminal device, a first user identifier generation operation is performed to obtain A user ID corresponding to the first user ID generation request, and adding the obtained user ID to a user ID set of the first terminal device. Here, the foregoing first user identifier generating operation may include sub-steps 3071 to 3073 as shown in FIG. 3C:
子步骤3071,获取用于指示该第一终端设备的可信执行环境的、包括厂商标识和产品标识的环境标识。Sub-step 3071, obtaining an environment identifier including a manufacturer identifier and a product identifier, which is used to indicate the trusted execution environment of the first terminal device.
这里,可信执行环境的环境标识用于唯一标识可信执行环境,可信执行环境的环境标识可以包括厂商标识和产品标识,其中,可信执行环境的厂商标识用于唯一标识不同的可信执行环境的厂商,而产品标识用于唯一标识同一可信执行环境厂商所生产的可信执行环境。实践中,通常可信执行环境在出厂时已经设置好厂商标识和产品标识,不能进行修改,而且,可信执行环境的环境标识只能存储在可信执行环境之内,可信执行环境之内的程序可以访问可信执行环境的环境标识,而可信执行环境之外的程序不能访问可信执行环境的环境标识。环境标识可以包括以下至少一项:数字、字符和文字。Here, the environment identification of the trusted execution environment is used to uniquely identify the trusted execution environment. The environment identification of the trusted execution environment may include a manufacturer identification and a product identification. The manufacturer identification of the trusted execution environment is used to uniquely identify different trusted execution environments. The manufacturer of the execution environment, and the product identification is used to uniquely identify the trusted execution environment produced by the same trusted execution environment manufacturer. In practice, the trusted execution environment usually has a manufacturer's logo and a product logo set at the factory, and cannot be modified. Moreover, the environment logo of the trusted execution environment can only be stored in the trusted execution environment and within the trusted execution environment. The program of the trusted execution environment can access the environment identification of the trusted execution environment, while the program of the trusted execution environment cannot access the environment identification of the trusted execution environment. The environmental identification can include at least one of the following: numbers, characters, and text.
子步骤3072,随机生成随机数。In step 3072, a random number is generated randomly.
子步骤3073,用该第一终端设备的可信执行环境中存储的用户标识密钥对第一扩展用户标识进行加密,得到与第一用户标识生成请求对应的用户标识。Sub-step 3073: Encrypt the first extended user identifier by using the user identifier key stored in the trusted execution environment of the first terminal device to obtain a user identifier corresponding to the first user identifier generation request.
这里,第一扩展用户标识可以包括子步骤3071中所获取的环境标识、所生成的随机数和步骤307中接收到的第一用户标识生成请求中的第一用户标识类别标识。Here, the first extended user identifier may include the environment identifier obtained in sub-step 3071, the generated random number, and the first user identifier category identifier in the first user identifier generation request received in step 307.
这里,用户标识密钥只能存储在可信执行环境中,且只能被可信执行环境之内的程序访问,不能被可信执行环境之外的程序访问。Here, the user identification key can only be stored in the trusted execution environment, and can only be accessed by programs within the trusted execution environment, and cannot be accessed by programs outside the trusted execution environment.
这里,用该第一终端设备的可信执行环境中存储的用户标识密钥对第一扩展用户标识进行加密,可以采用各种对称加密算法。Here, using the user identification key stored in the trusted execution environment of the first terminal device to encrypt the first extended user identification, various symmetric encryption algorithms may be used.
步骤307中所生成的用户标识是基于第一终端设备的可信执行环境的环境标识生成的,而且还加入了所生成的随机数和第一用户标识类别标识,对于可信执行环境之外的程序而言,仅仅可以得到所生成的用户标识,但不能解析所生成的用户标识中的环境标识,只有可信执行环境内的程序才能解析所生成的用户标识得到用户标识中的环境 标识,因此,可以保护终端设备的用户标识集合中的用户标识不被可信执行环境之外的程序破解,从而,以终端用户标识集合中的用户标识作为加密用户信息添加请求中的用户标识,或者,以终端用户标识集合中的用户标识作为未加密用户信息添加请求中的用户标识,继而再向服务器发送的用户信息添加请求中的用户标识也是终端设备的用户标识集合中的用户标识,也就是说,对应存储到服务器的用户标识、用户信息范围标识、用户信息和加密标记中的用户标识也是终端设备的用户标识集合中的用户标识,而服务器的可信执行环境之外的程序也无法解析服务器所存储的用户信息中的用户标识,继而无法将同一终端设备的用户标识集合中的各个用户标识进行关联进而进行大数据分析,保护了用户信息的隐私安全。The user identification generated in step 307 is generated based on the environment identification of the trusted execution environment of the first terminal device, and the generated random number and the first user identification category identification are also added. As for the program, only the generated user ID can be obtained, but the environment ID in the generated user ID cannot be parsed. Only the program in the trusted execution environment can parse the generated user ID to obtain the environment ID in the user ID, so , The user ID in the user ID set of the terminal device can be protected from being cracked by a program outside the trusted execution environment, so that the user ID in the end user ID set is used as the user ID in the encrypted user information addition request, or, The user ID in the end user ID set is used as the user ID in the unencrypted user information addition request, and the user ID in the user information addition request sent to the server is also the user ID in the user ID set of the terminal device, that is, Corresponds to the user ID and user information stored on the server The user ID in the security ID, user information, and encryption mark is also the user ID in the user ID set of the terminal device, and programs outside the trusted execution environment of the server cannot resolve the user ID in the user information stored by the server, and then It is not possible to correlate each user ID in the user ID set of the same terminal device to perform big data analysis, thereby protecting the privacy and security of user information.
可选实现方式(二):基于上述可选实现方式(一),上述时序300还可以包括如图3B所示的步骤308:Optional implementation (2): Based on the above-mentioned optional implementation (1), the timing sequence 300 may further include step 308 as shown in FIG. 3B:
步骤308,第一终端设备响应于检测到包括待验证用户标识和待加密信息的用户标识验证请求,在该第一终端设备的可信执行环境中执行用户标识验证操作,得到与用户标识验证请求对应的验证结果。Step 308: The first terminal device responds to detecting a user identification verification request including a user identity to be verified and information to be encrypted, executes a user identity verification operation in a trusted execution environment of the first terminal device, and obtains a verification request with the user identity. Corresponding verification results.
实践中,第一终端设备可以采用各种实现方式检测用户标识验证请求。例如,例如,第一终端设备可以在检测到用户打开了重新安装了用于处理用户信息的应用,为了确定第一终端设备的用户标识集合中的用户标记均为该第一终端设备的用户标识,对该第一终端设备的用户标识集合中的每个用户标记,均可以以该用户标识作为待验证用户标识生成用户标识验证请求,并在得到是用户标识验证结果的情况下,将该用户标识保留在该第一终端设备的用户标识集合中,并在得到非用户标识验证结果的情况下,将该用户标识从该第一终端设备的用户标识集合中删除。In practice, the first terminal device may detect the user identity verification request in various implementation manners. For example, for example, when the first terminal device detects that the user has opened and reinstalled an application for processing user information, in order to determine that the user identifier in the user identifier set of the first terminal device is the user identifier of the first terminal device , For each user tag in the user identity set of the first terminal device, a user identity verification request may be generated by using the user identity as the user identity to be verified, and if the user identity verification result is obtained, the user is authenticated. The identity is retained in the user identity set of the first terminal device, and if a non-user identity verification result is obtained, the user identity is deleted from the user identity set of the first terminal device.
这里,第一终端设备可以在检测到包括待验证用户标识和待加密信息的用户标识验证请求的情况下,在该第一终端设备的可信执行环境中执行用户标识验证操作,得到与用户标识验证请求对应的验证结果。这里,待加密信息可以是随机生成的信息或者任意预设的信息内容。Here, the first terminal device may perform a user ID verification operation in a trusted execution environment of the first terminal device when a user ID verification request including a user ID to be authenticated and information to be encrypted is detected, to obtain a user ID The verification result corresponding to the verification request. Here, the information to be encrypted may be randomly generated information or any preset information content.
这里,上述用户标识验证操作可以包括如图3D所示的子步骤3081到子步骤3087:Here, the above-mentioned user identity verification operation may include sub-steps 3081 to 3087 shown in FIG. 3D:
子步骤3081,用该第一终端设备的可信执行环境中存储的用户标识密钥对待验证用户标识解密,得到待验证扩展用户标识。Sub-step 3081, the user identification key stored in the trusted execution environment of the first terminal device is used to decrypt the to-be-verified user ID to obtain the extended user ID to be verified.
这里,如果待验证用户标识是用第一终端设备的可信执行环境中存储的用户标识密钥对待验证扩展用户标识进行加密得到的,这里,用该第一终端设备的可信执行环境中存储的用户标识密钥对待验证用户标识解密,就可以得到待验证扩展用户标识。Here, if the user identity to be verified is obtained by encrypting the extended user identity to be verified with the user identity key stored in the trusted execution environment of the first terminal device, here, it is stored in the trusted execution environment of the first terminal device. If the user ID key to be authenticated is decrypted, the extended user ID to be verified can be obtained.
子步骤3082,按照预设算法,根据待验证扩展用户标识中的环境标识生成第一密钥。 Sub-step 3082 generates a first key according to a preset algorithm according to an environment identifier in the extended user identifier to be verified.
例如,按照预设算法,根据待验证扩展用户标识中的环境标识生成第一密钥,可以如下进行:组合待验证扩展用户标识中的环境标识和该第一终端设备的可信执行环境中存储的预设密钥分量标识(例如,可以是预设常数)得到第一密钥。For example, according to a preset algorithm, generating the first key according to the environment identifier in the extended user identifier to be verified may be performed as follows: combining the environment identifier in the extended user identifier to be verified and the trusted execution environment stored in the first terminal device A predetermined key component identifier (for example, it may be a preset constant) to obtain the first key.
又例如,按照预设算法,根据待验证扩展用户标识中的环境标识生成第一密钥,还可以如下进行:将待验证扩展用户标识中的环境标识与该第一终端设备的可信执行环境中存储的预设掩码做异或运算,得到第一密钥。As another example, according to a preset algorithm, generating the first key according to the environment identifier in the extended user identifier to be verified may also be performed as follows: the environment identifier in the extended user identifier to be verified and the trusted execution environment of the first terminal device An XOR operation is performed on a preset mask stored in the memory to obtain a first key.
子步骤3083,用所生成的第一密钥加密待加密信息,得到第一加密信息。Sub-step 3083: Use the generated first key to encrypt the information to be encrypted to obtain the first encrypted information.
子步骤3084,按照预设算法,根据该第一终端设备的可信执行环境的环境标识生成第二密钥。Sub-step 3084, according to a preset algorithm, generating a second key according to an environment identifier of a trusted execution environment of the first terminal device.
这里,预设算法为子步骤3082中的预设算法。Here, the preset algorithm is the preset algorithm in sub-step 3082.
子步骤3085,用所生成的第二密钥对所得到的第一加密信息解密,得到第一明文信息。Sub-step 3085: Decrypt the obtained first encrypted information by using the generated second key to obtain the first plaintext information.
子步骤3086,确定所得到的第一明文信息与待加密信息是否相同。Sub-step 3086: Determine whether the obtained first plaintext information is the same as the information to be encrypted.
如果确定相同,表明子步骤3081中对待验证用户标识进行解密所得到的待验证扩展用户标识中的环境标识与该第一终端设备的可信执行环境的环境标识相同,从而可以确定待验证用户标识为该第一终端 设备的用户标识,则可以转到子步骤3087。If the determination is the same, it indicates that the environment identifier in the extended user identifier to be verified obtained by decrypting the user identifier to be verified in sub-step 3081 is the same as the environment identifier of the trusted execution environment of the first terminal device, so that the user identifier to be verified can be determined If it is the user identity of the first terminal device, the process may go to sub-step 3087.
如果确定不同,表明子步骤3081中对待验证用户标识进行解密所得到的待验证扩展用户标识中的环境标识与该第一终端设备的可信执行环境的环境标识不同,从而可以确定待验证用户标识不是该第一终端设备的用户标识,则可以转到子步骤3088。If the determination is different, it indicates that the environment identifier in the extended user identifier to be verified obtained by decrypting the user identifier to be verified in sub-step 3081 is different from the environment identifier of the trusted execution environment of the first terminal device, so that the user identifier to be verified can be determined If it is not the user identity of the first terminal device, the process may go to sub-step 3088.
子步骤3087,生成用于指示待验证用户标识为该第一终端设备的用户标识的是用户标识验证结果。Sub-step 3087, generating a user identification verification result used to indicate that the user identification to be verified is the user identification of the first terminal device.
子步骤3088,生成用于指示待验证用户标识不是该第一终端设备的用户标识的非用户标识验证结果。Sub-step 3088, generating a non-user identity verification result for indicating that the identity of the user to be verified is not the user identity of the first terminal device.
基于上述可选实现方式(二),第一终端设备可以在需要的情况下,验证用户标识是否为该第一终端设备的用户标识。Based on the above-mentioned optional implementation manner (2), the first terminal device can verify, if necessary, whether the user identifier is the user identifier of the first terminal device.
可选实现方式(三):基于上述可选实现方式(一)或可选实现方式(二),第一终端设备的厂商标识的取值范围不同于该第一终端设备的可信执行环境的产品标识的取值范围,而且,用于处理用户信息的系统中的至少一个终端设备除了可以包括至少一个设置可信执行环境的第一终端设备以外,还可以包括至少一个未设置可信执行环境的第二终端设备,并且上述时序300还可以如图3B所示的包括步骤309到步骤311:Optional implementation (3): Based on the above-mentioned optional implementation (1) or optional implementation (2), the value range of the vendor identification of the first terminal device is different from that of the trusted execution environment of the first terminal device. The value range of the product identifier. In addition, at least one terminal device in the system for processing user information may include at least one first terminal device with a trusted execution environment, and may include at least one non-trusted execution environment. The second terminal device, and the above timing sequence 300 may further include steps 309 to 311 as shown in FIG. 3B:
步骤309,第二终端设备响应于检测到用户输入的注册成为目标应用和/或目标网站的用户的注册请求以及确定该第二终端设备未设置对应的用户验证信息密文,向对目标应用和/或目标网站提供支持的第一终端设备发送注册请求。Step 309: The second terminal device responds to detecting a registration request entered by the user to register as a user of the target application and / or the target website, and determining that the second terminal device does not set a corresponding user authentication information ciphertext to the target application and The first terminal device provided by the target website supports the registration request.
这里,设置有可信执行环境第一终端设备除了可以是终端用户设备,也可以对目标应用和/或目标网站提供支持。这里,目标应用可以是任一指定应用,目标网站也可以是任一指定网站。例如,目标应用可以是售书电商应用,目标网站也可以是售书电商网站。而未设置可信执行环境的第二终端设备,为了使用第一终端设备所支持的目标应用和/或目标网站所提供的服务,需要先注册成为目标应用和/或目标网站的用户。为此,如果第二终端设备的用户希望注册成为目标应用和/或目标网站的用户,可以在第二终端设备中打开目标应用,并点击目 标应用中关联有注册成为目标应用的用户的操作的控件,则第二终端设备可以检测到注册请求,或者,第二终端设备的用户也可以使用第二终端设备访问目标网站,并点击目标网站的注册页面中关联有注册成为目标网站的用户操作的页面元素,则第二终端设备也可以检测到注册请求。Here, the first terminal device provided with the trusted execution environment may be an end user device, and may also provide support for a target application and / or a target website. Here, the target application may be any designated application, and the target website may also be any designated website. For example, the target application may be a book sales e-commerce application, and the target website may also be a book sales e-commerce website. For a second terminal device without a trusted execution environment, in order to use a target application and / or a service provided by a target website supported by the first terminal device, it is necessary to first register as a user of the target application and / or target website. For this reason, if the user of the second terminal device wishes to register as a user of the target application and / or the target website, he can open the target application in the second terminal device and click on the target application associated with the operation of the user registered as the target application. Control, the second terminal device can detect the registration request, or the user of the second terminal device can also use the second terminal device to access the target website and click on the registration page of the target website that is associated with a user operation registered as the target website. Page element, the second terminal device may also detect a registration request.
如果第二终端设备已经向对目标应用和/或目标网站提供支持的第一终端设备发起过注册请求并收到了第一终端设备发送的用户验证信息密文,则,第二终端设备中已经设置过对应的用户验证信息密文。只有在第二终端设备未曾设置过对应的用户验证信息密文且检测到用户输入的注册成为目标应用和/或目标网站的用户的注册请求的情况下,第二终端设备才会向对目标应用和/或目标网站提供支持的第一终端设备发送注册请求。If the second terminal device has initiated a registration request to the first terminal device supporting the target application and / or the target website and received the user authentication information ciphertext sent by the first terminal device, the second terminal device has been set Pass the corresponding user authentication information ciphertext. Only when the second terminal device has not set the corresponding user authentication information ciphertext and detects the registration request entered by the user to register as the target application and / or the user of the target website, the second terminal device will send the target application to the target application. And / or the first terminal device supported by the target website sends a registration request.
步骤310,第一终端设备响应于接收到第二终端设备发送的注册请求,在该第一终端设备的可信执行环境中执行用户验证信息密文生成操作,得到用户验证信息密文,以及将所得到的用户验证信息密文发送给发送所收到的注册请求的第二终端设备。Step 310: In response to receiving a registration request sent by the second terminal device, the first terminal device performs a user authentication information ciphertext generation operation in a trusted execution environment of the first terminal device, obtains the user authentication information ciphertext, and sends The obtained ciphertext of the user authentication information is sent to the second terminal device that sends the received registration request.
这里,上述用户验证信息密文生成操作可以包括如图3E所示的子步骤3101和子步骤3102:Here, the above-mentioned user authentication information ciphertext generating operation may include sub-step 3101 and sub-step 3102 as shown in FIG. 3E:
子步骤3101,用该第一终端设备的可信执行环境中存储的当前用户序号与预设增量的和更新当前用户序号。Sub-step 3101: Update the current user serial number with the sum of the current user serial number and the preset increment stored in the trusted execution environment of the first terminal device.
这里,第一终端设备的可信执行环境中可以存储有当前用户序号。实践中,可信执行环境出厂时,可以预设当前用户序号的初始值为0,预设增量可以为1,则,对于第一终端设备第一次接收到的注册请求,当前用户序号会从初始值0递增到1,并用1更新了当前用户序号,即,对第一次接收到的注册请求,更新后的当前用户序号为1,第二次接收到的注册请求,更新后的当前用户序号为2。Here, the current user serial number may be stored in the trusted execution environment of the first terminal device. In practice, when the trusted execution environment leaves the factory, the initial value of the current user serial number can be preset to 0 and the preset increment can be 1. Then, for the first registration request received by the first terminal device, the current user serial number will be Incremented from the initial value of 0 to 1, and updated the current user serial number with 1, that is, for the first registration request received, the updated current user serial number is 1, the second received registration request, the updated current The user serial number is 2.
子步骤3102,利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对用户验证信息进行加密得到用户验证信息密文。Sub-step 3102, encrypting the user authentication information by using the user authentication information key stored in the trusted execution environment of the first terminal device to obtain the user authentication information ciphertext.
这里,第一终端设备的可信执行环境中存储有用户验证信息密钥和预设校验码,而且,只有第一终端设备的可信执行环境内的程序可 以访问用户验证信息密钥和预设校验码,第一终端设备的可信执行环境之外的程序不可以访问用户验证信息密钥和预设校验码。Here, the user authentication information key and the preset check code are stored in the trusted execution environment of the first terminal device, and only the program in the trusted execution environment of the first terminal device can access the user authentication information key and the preset verification code. If a check code is set, programs outside the trusted execution environment of the first terminal device cannot access the user authentication information key and the preset check code.
这里,预设校验码通常取易辨认的简短单词,比如“seed”,以便可信执行环境用用户验证信息密钥对用户验证信息密文解密后,检查预设校验码是否正确,以此快速判断当前的用户验证信息密文是否伪造的。Here, the preset check code usually takes an easy-to-recognize short word, such as "seed", so that the trusted execution environment decrypts the user verification information cipher text with the user verification information key, and then checks whether the preset check code is correct to This quickly determines whether the current user authentication information ciphertext is forged.
这里,上述用户验证信息可以包括该第一终端设备的可信执行环境中存储的预设校验码、步骤3101中所确定的当前用户序号以及该第一终端设备的可信执行环境的环境标识。Here, the user authentication information may include a preset check code stored in the trusted execution environment of the first terminal device, a current user serial number determined in step 3101, and an environment identifier of the trusted execution environment of the first terminal device. .
这里,对用户验证信息进行加密可以采用各种对称加密算法。Here, various symmetric encryption algorithms can be used to encrypt the user authentication information.
这里,在实践中,用户验证信息密文可以视作注册用户的种子码,可以理解为第一终端设备为第二终端设备的注册请求提供一份注册操作已成功的凭证。因为种子码已是密文,在可信执行环境中解密后还核对预设校验码,所以,为种子码密文增加额外的签名字串是不必要的,但在种子码尾部添加一个验证码则可选,以防键盘输入出错或通信传输出错时,系统可通过比对验证码自动识别并报错。Here, in practice, the ciphertext of the user authentication information can be regarded as the seed code of the registered user, and it can be understood that the first terminal device provides a credential for the successful registration operation for the registration request of the second terminal device. Because the seed code is already ciphertext, it is checked against the preset check code after decryption in a trusted execution environment. Therefore, it is not necessary to add an additional signature string to the seed code ciphertext, but add a verification at the end of the seed code. The code is optional, in case the keyboard input error or communication transmission error occurs, the system can automatically identify and report the error by comparing the verification code.
步骤311,第二终端设备响应于接收到第一终端设备发送的用户验证信息密文,将所收到的用户验证信息密文确定为该第二终端设备的用户验证信息密文。Step 311: In response to receiving the user authentication information ciphertext sent by the first terminal device, the second terminal device determines the received user authentication information ciphertext as the user authentication information ciphertext of the second terminal device.
由于页面显示限制,下面继续参考图3F,需要说明的是,图3F的流程除了包括图3F中所示的各个步骤外,还可以包括图3A和图3B中所示的各个步骤。另外,需要说明的是,图3F中所示的第一终端设备和第二终端设备除了可以执行图3B和图3F中所示的相应步骤外,还可以执行图3A中所示的终端设备可以执行的各个步骤。Due to the limitation of page display, the following continues to refer to FIG. 3F. It should be noted that the process of FIG. 3F may include various steps shown in FIG. 3A and FIG. 3B in addition to the steps shown in FIG. 3F. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3F can perform the corresponding steps shown in FIG. 3B and FIG. 3F, and can also perform the terminal device shown in FIG. 3A. Steps performed.
可选实现方式(四):基于上述可选实现方式(三),上述时序300还可以包括如图3F所示的步骤312到步骤314:Alternative implementation (4): Based on the optional implementation (3) above, the timing sequence 300 may further include steps 312 to 314 as shown in FIG. 3F:
步骤312,第二终端设备响应于检测到用户输入的包括第二用户标识类别标识且用于指示生成目标应用和/或目标网站的用户标识的第二用户标识生成指令,确定转密密钥,利用第二用户标识生成请求公钥对第二用户标识生成请求进行加密得到第二用户标识生成请求密 文,以及将所得到的第二用户标识生成请求密文发送给对目标应用和/或目标网站提供支持的第一终端设备。Step 312: The second terminal device determines a transfer key in response to detecting a second user identifier generation instruction including a second user identifier category identifier and instructing to generate a user identifier of a target application and / or a target website. Use the second user ID generation request public key to encrypt the second user ID generation request to obtain the second user ID generation request ciphertext, and send the obtained second user ID generation request cipher text to the target application and / or target The website provides the first terminal device supported.
在上述步骤309到步骤311之间的操作中,对于第二终端设备,仅仅设置了对应的用户验证信息密文,而没有生成真正的目标应用和/或目标网站的用户标识。这样,第二终端设备可以采用各种实现方式检测用户输入的包括第二用户标识类别标识且用于指示生成目标应用和/或目标网站的用户标识的第二用户标识生成指令。例如,第二终端设备可以在检测到用户在用户标识类别输入控件中输入了第二用户标识类别标识,并点击了第二终端设备上安装的目标应用中关联有生成目标应用的用户标识的操作的控件时,确定检测到第二用户标识生成指令。又例如,第二终端设备还可以在检测到用户访问了目标网站,在用户标识类别输入用页面元素中输入了第二用户标识类别标识,并点击了目标网站的第二用户标识生成页面中关联有生成目标应用的用户标识的操作的页面元素时,确定检测到第二用户标识生成指令。In the operations from step 309 to step 311 described above, for the second terminal device, only the corresponding user authentication information ciphertext is set, and the user identification of the target application and / or target website is not generated. In this way, the second terminal device may detect, by various implementation manners, a second user ID generation instruction including a second user ID category ID and used to instruct the user ID generation of the target application and / or the target website to be input by the user. For example, the second terminal device may detect that the user has entered the second user identification category identifier in the user identification category input control and clicked on the target application installed on the second terminal device to associate with the operation of generating the user identification of the target application. When it is determined that a second user ID generation instruction is detected. For another example, the second terminal device may also detect that the user has visited the target website, enter the second user identification category identifier in the page element for user identification category input, and click the association in the second user identification generation page of the target website. When there is a page element of the operation of generating the user ID of the target application, it is determined that a second user ID generating instruction is detected.
这里,第二终端设备可以在检测到用户输入的包括第二用户标识类别标识且用于指示生成目标应用和/或目标网站的用户标识的第二用户标识生成指令的情况下,确定转密密钥。Here, the second terminal device may determine the transfer password if a second user ID generation instruction including a second user ID category identifier and used to instruct generation of the user ID of the target application and / or the target website is detected by the user. key.
这里,第二用户标识类别标识用于指示第二终端设备中对应目标应用和/或目标网站的用户标识集合中用户标识的类别。即,第二终端设备中存储了针对目标应用和/或目标网站的用户标识集合。实践中,可以按照各种方式对针对目标应用和/或目标网站的用户标识集合中的用户标识进行分类,每个分类对应不同的第二用户标识类别,而第二用户标识类别标识用于指示不同的第二用户标识类别。作为示例,可以按照递增的方式确定第二用户标识类别标识,即,第二终端设备可以存储有针对目标应用和/或目标网站的当前第二用户标识类别标识,当检测到用户输入的希望生成目标应用和/或目标网站的用户标识的指令时,第二终端设备可以获取上述存储的当前第二用户标识类别标识,并将所获取的当前第二用户标识类别标识进行递增更新,用递增更新之后的当前第二用户标识类别标识生成第二用户标识生成指令。作为示例,还可以由用户自主输入第二用户标识类别标识。作为 示例,还可以随机生成第二用户标识类别标识。Here, the second user identifier category identifier is used to indicate the category of the user identifier in the user identifier set corresponding to the target application and / or the target website in the second terminal device. That is, the second terminal device stores a user identification set for the target application and / or the target website. In practice, the user IDs in the user ID set for the target application and / or target website can be classified in various ways, each classification corresponding to a different second user ID category, and the second user ID category ID is used to indicate Different second user identification categories. As an example, the second user identification category identifier may be determined in an incremental manner, that is, the second terminal device may store the current second user identification category identifier for the target application and / or the target website. When the target application and / or the user identifier of the target website is instructed, the second terminal device may obtain the current second user identifier category identifier stored above, and incrementally update the acquired current second user identifier category identifier, and use the incremental update After that, the current second user identifier category identifier generates a second user identifier generating instruction. As an example, the second user identification category identifier may also be input by the user autonomously. As an example, the second user identification category identifier may also be randomly generated.
这里,第二终端设备可以采用各种实现方式确定转密密钥。例如,可以随机生成转密密钥,或者,也可以将第二终端设备中预先存储的转密密钥确定为转密密钥,又或者还可以接收用户输入的转密密钥。Here, the second terminal device may determine the turn-key by using various implementation manners. For example, the encryption key may be randomly generated, or the encryption key stored in advance in the second terminal device may be determined as the encryption key, or the encryption key input by the user may be received.
在确定转密密钥之后,第二终端设备可以利用第二用户标识生成请求公钥对第二用户标识生成请求进行加密得到第二用户标识生成请求密文。其中,上述第二用户标识生成请求包括该第二终端设备的用户验证信息密文、所确定的转密密钥和所检测到的第二用户标识生成指令中的第二用户标识类别标识。After the transfer key is determined, the second terminal device may use the second user ID generation request public key to encrypt the second user ID generation request to obtain the second user ID generation request ciphertext. The second user identifier generation request includes the user authentication information cipher text of the second terminal device, the determined transfer key, and the second user identifier category identifier in the detected second user identifier generation instruction.
最后,第二终端设备可以将所得到的第二用户标识生成请求密文发送给对目标应用和/或目标网站提供支持的第一终端设备。Finally, the second terminal device may send the obtained second user identifier generation request ciphertext to the first terminal device that provides support for the target application and / or the target website.
步骤313,第一终端设备响应于接收到第二终端设备发送的第二用户标识生成请求密文,在该第一终端设备的可信执行环境中执行第二用户标识生成操作,得到与所收到的第二用户标识生成请求密文对应的转密用户标识,以及将所得到的转密用户标识发送给发送所收到的第二用户标识生成请求密文的第二终端设备。Step 313: The first terminal device responds to receiving the second user identifier generation request ciphertext sent by the second terminal device, executes the second user identifier generation operation in the trusted execution environment of the first terminal device, and obtains the received and received The obtained second user ID generates a request for the ciphertext corresponding to the encrypted user ID, and sends the obtained second user ID to the second terminal device that sends the received second user ID to generate the requested cipher text.
其中,上述第二用户标识生成操作可以包括如图3G所示的子步骤3131到子步骤3135:The above-mentioned second user identifier generating operation may include sub-steps 3131 to 3135 shown in FIG. 3G:
子步骤3131,用该第一终端设备的可信执行环境中存储的与第二用户标识生成请求公钥对应的第二用户标识生成请求私钥对所收到的第二用户标识生成请求密文进行解密得到用户验证信息密文、转密密钥和用户标识类别标识。Sub-step 3131: Use the second user ID generation request private key corresponding to the second user ID generation request public key stored in the trusted execution environment of the first terminal device to generate a request ciphertext for the received second user ID. Decryption is performed to obtain user authentication information ciphertext, re-encryption key, and user identification category identification.
这里,第二用户标识生成请求公钥和第二用户标识生成请求私钥是一对非对称加密/解密的密钥对,其中,第二用户标识生成请求公钥可以存储在未设置可信执行环境的第二终端设备中,还可以存储在设置可信执行环境的第一终端设备的可信执行环境之内和可信执行环境之外。而,第二用户标识生成请求私钥则只能存储在设置可信执行环境的第一终端设备的可信执行环境之内,且只能被第一终端设备的可信执行环境之内的程序访问,不能被第一终端设备的可信执行环境之外的程序访问。Here, the second user ID generation request public key and the second user ID generation request private key are a pair of asymmetric encryption / decryption key pairs, wherein the second user ID generation request public key can be stored without trusted execution The second terminal device of the environment may also be stored in the trusted execution environment and outside the trusted execution environment of the first terminal device in which the trusted execution environment is set. However, the second user ID generation request private key can only be stored in the trusted execution environment of the first terminal device where the trusted execution environment is set, and can only be a program within the trusted execution environment of the first terminal device. Access cannot be accessed by programs outside the trusted execution environment of the first terminal device.
需要说明的是,子步骤3131中所用的解密方法是与步骤312中利用第二用户标识生成请求公钥对第二用户标识生成请求进行加密的加密方法对应的解密方法。It should be noted that the decryption method used in sub-step 3131 is a decryption method corresponding to the encryption method that uses the second user ID generation request public key to encrypt the second user ID generation request in step 312.
子步骤3132,利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对解密得到的用户验证信息密文进行解密,得到验证码、用户序号和环境标识。Sub-step 3132, decrypting the ciphertext of the user authentication information obtained by decryption using the user authentication information key stored in the trusted execution environment of the first terminal device to obtain a verification code, a user serial number, and an environment identifier.
可以理解的是,这里对解密得到的用户验证信息密文进行解密所用的解密方法是与图3E所示的用户验证信息密文生成操作中,子步骤3102中对用户验证信息进行加密所用的对称加密方法对应的对称解密方法。It can be understood that the decryption method used to decrypt the ciphertext of the user authentication information obtained here is symmetric to the user authentication information ciphertext generation operation shown in FIG. 3E, which is used to encrypt the user authentication information in substep 3102. The symmetric decryption method corresponding to the encryption method.
子步骤3133,响应于确定解密得到的验证码与该第一终端设备的可信执行环境中存储的预设验证码相同且解密得到的环境标识与该第一终端设备的可信执行环境的环境标识相同,用第二厂商标识、第二产品标识、随机生成的随机数和解密得到的用户标识类别标识生成第二扩展用户标识。Sub-step 3133, in response to determining that the verification code obtained by the decryption is the same as the preset verification code stored in the trusted execution environment of the first terminal device, and the environment identifier obtained by the decryption is the environment of the trusted execution environment of the first terminal device The identifiers are the same, and the second extended user identifier is generated by using the second manufacturer identifier, the second product identifier, a randomly generated random number, and the user identifier category identifier obtained through decryption.
这里,如果子步骤3132中对子步骤3131中所收到的第二用户标识生成请求密文进行解密所得到的用户验证信息密文进行解密所得到的验证码与该第一终端设备的可信执行环境中存储的预设验证码相同且解密得到的环境标识与该第一终端设备的可信执行环境的环境标识相同,表明发送步骤3131中所收到的第二用户标识生成请求密文的第二终端设备是向第一终端设备注册过的第二终端设备,且该第二终端设备的用户验证信息密文是该第一终端设备生成的用户验证信息密文,那么,第一终端设备可以用第二厂商标识、第二产品标识、随机生成的随机数和解密得到的用户标识类别标识生成第二扩展用户标识。其中,上述第二厂商标识是根据该第一终端设备的可信执行环境的产品标识生成的,且第二厂商标识的取值范围、该第一终端设备的可信执行环境的产品标识的取值范围和该第一终端设备的可信执行环境的厂商标识的取值范围互不相同,而第二产品标识为解密得到的用户序号。Here, if the user authentication information ciphertext obtained by decrypting the second user ID generation request ciphertext received in substep 3131 and decrypting the ciphertext in substep 3132 is authentic with the first terminal device The preset verification code stored in the execution environment is the same, and the decrypted environment ID is the same as the environment ID of the trusted execution environment of the first terminal device, indicating that the second user ID received in step 3131 is generated to request the ciphertext. The second terminal device is a second terminal device that is registered with the first terminal device, and the user authentication information ciphertext of the second terminal device is the user authentication information ciphertext generated by the first terminal device. Then, the first terminal device The second extended user identifier may be generated by using the second manufacturer identifier, the second product identifier, a randomly generated random number, and the user identifier category identifier obtained by decryption. The second vendor identifier is generated according to the product identifier of the trusted execution environment of the first terminal device, and the value range of the second vendor identifier and the product identifier of the trusted execution environment of the first terminal device are obtained. The value range and the value range of the vendor identification of the trusted execution environment of the first terminal device are different from each other, and the second product identification is the user serial number obtained by decryption.
子步骤3134,用该第一终端设备的可信执行环境中存储的用户标 识密钥对所生成的第二扩展用户标识进行加密得到第二用户标识。Sub-step 3134: Encrypt the generated second extended user identifier by using the user identification key stored in the trusted execution environment of the first terminal device to obtain a second user identifier.
子步骤3133中已经为第二终端设备生成了第二扩展用户标识,但是,第二扩展用户标识中直接包括了第二厂商标识、第二产品标识、随机数和用户标识类别标识,为了保证可信执行环境之外的程序不能解析上述第二扩展用户标识还需要利用该第一终端设备的可信执行环境中存储的用户标识密钥对所生成的第二扩展用户标识进行加密得到第二用户标识。这里,第二用户标识是密文态的标识。In step 3133, a second extended user identifier has been generated for the second terminal device. However, the second extended user identifier directly includes the second manufacturer identifier, the second product identifier, a random number, and a user identifier category identifier. Programs outside the execution environment cannot parse the above-mentioned second extended user identification, and the generated second extended user identification is encrypted by using the user identification key stored in the trusted execution environment of the first terminal device to obtain a second user. Logo. Here, the second user identifier is an identifier in a cipher text state.
子步骤3135,用解密得到的转密密钥对所得到的第二用户标识进行加密得到与所收到的第二用户标识生成请求密文对应的转密用户标识。这里,转密用户标识是对密文态的第二用户标识再作加密而来。In sub-step 3135, the obtained second user identifier is encrypted by using the decryption transfer key to obtain a second user identifier corresponding to the received second user identifier generation request ciphertext. Here, the encrypted user ID is obtained by encrypting the second user ID in cipher text.
这里,为了进一步增强第二终端设备的用户信息安全性,防止第一终端设备的可信执行环境之外的程序获取第二用户标识,还需要用子步骤3131中解密所得到的转密密钥对对子步骤3134中得到的第二用户标识进行加密得到与子步骤313中所收到的第二用户标识生成请求密文对应的转密用户标识。Here, in order to further enhance the user information security of the second terminal device and prevent the program outside the trusted execution environment of the first terminal device from acquiring the second user identity, it is also necessary to use the decryption key obtained by decryption in substep 3131. The second user ID obtained in sub-step 3134 is encrypted to obtain a turn-key user ID corresponding to the second user ID generation request ciphertext received in sub-step 313.
步骤314,第二终端设备响应于接收到第一终端设备发送的且与所得到并发送给第一终端设备的第二用户标识生成请求密文对应的转密用户标识,用所得到的第二用户标识生成请求密文对应的第二用户标识生成请求中的转密密钥对所收到的转密用户标识进行解密,得到第二用户标识,以及将解密得到的第二用户标识添加到该第二终端设备的用户标识集合中。这里,解密得到的第二用户标识是密文态标识。Step 314: The second terminal device responds to receiving the encrypted user ID sent by the first terminal device and corresponding to the obtained second user ID generation request ciphertext and sent to the first terminal device, and uses the obtained second encrypted user ID. The encryption key in the second user ID generation request corresponding to the user ID generation request ciphertext decrypts the received encrypted user ID, obtains the second user ID, and adds the decrypted second user ID to the The user identity of the second terminal device is in a set. Here, the second user identifier obtained after decryption is a ciphertext identifier.
经过步骤312到步骤314,未设置可信执行环境的第二终端设备为了使用对目标应用和/或目标网站提供的服务,生成了目标应用和/或目标网站提供支持的第一终端设备的新的用户标识。换言之,经过步骤312到步骤314,对目标应用和/或目标网站提供支持且设置有可信执行环境的第一终端设备可以发展自己的“二级用户”,即在未设置可信执行环境的第二终端设备上发展自己的“二级用户”,从而提升了第一终端设备的功能,使得第一终端设备也可以对外提供服务。After step 312 to step 314, in order to use the services provided by the target application and / or target website, the second terminal device without a trusted execution environment generates a new terminal device that supports the target application and / or target website. User ID. In other words, after steps 312 to 314, the first terminal device that supports the target application and / or the target website and is provided with a trusted execution environment can develop its own "second-level user", that is, in The second terminal device develops its own "secondary user", thereby improving the function of the first terminal device, so that the first terminal device can also provide services to the outside.
上述一级用户的第一用户标识与二级用户的第二用户标识,都以密文方式存在,采用这种标识的优点是表达形式比较简短,两者均只 需占用20字节,另外,一级用户可以随意发展自己的二级用户也是优点。缺点是这两者仅用来标识一个用户,无法代表用户实施签名与验证签名。Both the first user ID of the first-level user and the second user ID of the second-level user exist in cipher text. The advantage of using this type of logo is that the expression is relatively short. Both only take up 20 bytes. In addition, It is also an advantage for primary users to develop their own secondary users at will. The disadvantage is that the two are only used to identify a user, and they cannot implement signatures and verify signatures on behalf of the user.
为克服上述不足,我们在可信执行环境中增加一项设计,让一级用户在发展自己的二级用户时,为二级用户生成第二用户标识时,在步骤313还附带生成一对可用于签名及签名验证的公私钥,其中,公钥随第二用户标识一同返回,在步骤313也一同被转密密钥加密,最后在步骤314解密回公钥明文。所生成的公私钥中的私钥则永远不泄露出可信执行环境,一级用户的可信执行环境因掌管二级用户的私钥,所以可以替二级用户行使签名授权能力。In order to overcome the above-mentioned shortcomings, we have added a design to the trusted execution environment, so that when a first-level user develops his own second-level user, when the second user ID is generated for the second-level user, a pair of available pairs is also generated in step 313 The public and private keys for signature and signature verification, where the public key is returned with the second user identification, and is also encrypted by the turn-key in step 313, and finally the plain text of the public key is decrypted in step 314. The private key in the generated public and private keys never reveals the trusted execution environment. The trusted user's execution environment of the primary user can exercise the signing authority on behalf of the secondary user because it controls the private key of the secondary user.
步骤313中根据已生成的第二用户标识,由公式F推导出私钥,然后由私钥进一步推导公钥,比如,任意32字节长的数据可用作比特币账号的私钥,而其公钥则从私钥推导,公式F只需从第二用户标识推导出一个32字节长的散列值即可。In step 313, the private key is derived from Formula F according to the generated second user ID, and then the public key is further derived from the private key. For example, any 32-byte data can be used as the private key of the Bitcoin account, and its The public key is derived from the private key. Formula F only needs to derive a 32-byte hash value from the second user ID.
私钥=F(系统安全词,一级用户安全词,第二用户标识)Private key = F (system security word, primary user security word, second user identification)
其中,系统安全词是可信执行环境设备的厂商预设的,是一个绝密字串,一级用户安全词由一级用户通过调特定API预先配置到可信执行环境中,可信执行环境永不对外泄露一级用户安全词,所以,他人无法猜测,基于上述公式推导出来的私钥同样无法猜测。公式F的一种简便实现是:采用hash256散列算法,对由系统安全词、一级用户安全词、第二用户标识三者串接而成的字串做哈希运算,得到32字节长的摘要值,即可用作该第二用户标识所对应的私钥。Among them, the system security word is preset by the manufacturer of the trusted execution environment and is a top-secret string. The first-level user security word is pre-configured into the trusted execution environment by adjusting specific APIs. The trusted execution environment is always The first-level user security words are not leaked to the outside, so others cannot guess, and the private key derived based on the above formula cannot be guessed either. A simple implementation of formula F is: using a hash256 hash algorithm, hashing a string formed by concatenating the system security word, the first user security word, and the second user identifier, to obtain a length of 32 bytes Can be used as the private key corresponding to the second user ID.
可选实现方式(五):基于上述可选实现方式(一)、(二)、(三)和(四)中的任一可选实现方式,第一终端设备的厂商标识可以大于等于第一预设正整数且小于等于第一预设正整数与第二预设正整数之和,第一终端设备的产品标识大于第二预设正整数且小于第一预设正整数,其中,第一预设正整数大于第二预设正整数。Optional implementation (five): Based on any of the optional implementations (a), (b), (c), and (d) above, the manufacturer identification of the first terminal device may be greater than or equal to the first The preset positive integer is less than or equal to the sum of the first preset positive integer and the second preset positive integer. The product identifier of the first terminal device is greater than the second preset positive integer and less than the first preset positive integer. The preset positive integer is greater than the second preset positive integer.
为清楚起见,这里可以用FactoryNo表示第一终端设备的厂商标识,用ProductNo表示第一终端设备的产品标识,用I 1表示第一预设正整数,用I 2表示第二预设正整数,其中,I 1>I 2,则上述可选实现方 式(五)可以用公式表示如下: For clarity, the manufacturer ID of the first terminal device can be represented by FactoryNo, the product ID of the first terminal device by ProductNo, the first preset positive integer by I 1 and the second preset positive integer by I 2 , Among them, I 1 > I 2 , the above-mentioned optional implementation manner (five) can be expressed as follows:
I 1<=FactoryNo<=(I 1+I 2)                             (1) I 1 <= FactoryNo <= (I 1 + I 2 ) (1)
I 2<ProductNo<I 1                                      (2) I 2 <ProductNo <I 1 (2)
可选实现方式(六):基于上述可选实现方式(三)、(四)或(五),其中,在可选实现方式(四)中的第二厂商标识是根据该第一终端设备的可信执行环境的产品标识生成的,可以包括:第二厂商标识是该第一终端设备的可信执行环境的产品标识与第一预设正整数之和。Alternative implementation method (6): Based on the optional implementation methods (3), (4), or (5), in which the second vendor identification in the optional implementation method (4) is based on the first terminal device. The generation of the product identification of the trusted execution environment may include: the second vendor identification is the sum of the product identification of the trusted execution environment of the first terminal device and the first preset positive integer.
继续延用上述公式(1)和公式(2)的描述,另外,设第二厂商标识为FactoryNo’,则可选实现方式(六)可以用公式表示如下:Continue to use the descriptions of the above formulas (1) and (2). In addition, if the second manufacturer's identification is FactoryNo ', the optional implementation method (six) can be expressed as follows:
FactoryNo’=ProductNo+I 1                              (3) FactoryNo '= ProductNo + I 1 (3)
由公式(1)、公式(2)和公式(3)可得以下结论:From formula (1), formula (2) and formula (3), the following conclusions can be drawn:
(I 1+I 2)<FactoryNo’<2I 1                               (4) (I 1 + I 2 ) <FactoryNo '<2I 1 (4)
由公式(1)、公式(2)和公式(4)可得以下结论:From formula (1), formula (2) and formula (4), the following conclusions can be drawn:
FactoryNo、ProductNo、FactoryNo’的取值范围互不同,即,第二厂商标识的取值范围、第一终端设备的可信执行环境的产品标识的取值范围和第一终端设备的可信执行环境的厂商标识的取值范围互不相同。The value ranges of FactoryNo, ProductNo, and FactoryNo 'are different from each other, that is, the value range of the second vendor identification, the value range of the product identification of the trusted execution environment of the first terminal device, and the trusted execution environment of the first terminal device. The value range of the manufacturer ID is different from each other.
可选实现方式(七):基于上述可选实现方式(六),第一终端设备的厂商标识和产品标识均为四字节无符号整数,第一预设正整数的十六进制表示为0x80000000,第二预设正整数的十六进制表示为0x000000FF。从而可以得到以下结论:Optional implementation method (seven): Based on the above optional implementation method (six), the manufacturer identification and product identification of the first terminal device are four-byte unsigned integers, and the hexadecimal representation of the first preset positive integer is 0x80000000, the hexadecimal representation of the second preset positive integer is 0x000000FF. The following conclusions can be drawn:
FactoryNo为取值范围为0x80000000~0x800000FF之间的四字节无符号整数;FactoryNo is a four-byte unsigned integer with a value ranging from 0x80000000 to 0x800000FF;
ProductNo为取值范围为0x00000100~0x7FFFFFFF之间的四字节无符号整数;ProductNo is a four-byte unsigned integer with a value ranging from 0x00000100 to 0x7FFFFFFF;
FactoryNo’为取值范围为0x80000100~0xFFFFFFFF之间的四字节无符号整数。FactoryNo 'is a four-byte unsigned integer with a value ranging from 0x80000100 to 0xFFFFFFFF.
从上述可以看出,FactoryNo、ProductNo、FactoryNo’的取值范围不同,即,第二厂商标识的取值范围、第一终端设备的可信执行环境的产品标识的取值范围和第一终端设备的可信执行环境的厂商标识的 取值范围互不相同。It can be seen from the above that the value ranges of FactoryNo, ProductNo, and FactoryNo 'are different, that is, the value range of the second manufacturer's identification, the value range of the product identification of the trusted execution environment of the first terminal device, and the first terminal device. The value range of the vendor ID of the trusted execution environment is different from each other.
由于页面显示限制,下面继续参考图3H,需要说明的是,图3H的流程除了包括图3H中所示的各个步骤外,还可以包括图3A、图3B和图3F中所示的各个步骤。另外,需要说明的是,图3H中所示的第一终端设备和第二终端设备除了可以执行图3B、图3F和图3H中所示的相应步骤外,还可以执行图3A中所示的终端设备可以执行的各个步骤。Due to the limitation of the page display, the following reference is continued to FIG. 3H. It should be noted that the process of FIG. 3H may include various steps shown in FIG. 3A, FIG. 3B, and FIG. 3F in addition to the steps shown in FIG. 3H. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3H can perform the corresponding steps shown in FIG. 3B, FIG. 3F, and FIG. 3H, and can also perform the steps shown in FIG. 3A. Steps that the terminal device can perform.
可选实现方式(八):现行的大部分应用或者网站登录中还会使用一种登录方式就是验证码登录。这里,基于上述任一可选实现方式,上述时序300还可以包括如图3H所示的步骤315到步骤319,实现服务器对第一终端设备的用户标识的验证:Optional implementation method (eight): Most current applications or website logins also use a login method that is a verification code login. Here, based on any of the foregoing optional implementation manners, the above-mentioned sequence 300 may further include steps 315 to 319 as shown in FIG. 3H to implement the server's verification of the user identity of the first terminal device:
步骤315,服务器响应于接收到第一终端设备发送的包括待验证用户标识的终端用户标识验证请求,在服务器的可信执行环境中执行用户标识验证信息密文生成操作,得到与终端用户标识验证请求对应的用户标识验证信息密文,以及将所得到的用户标识验证信息密文发送给发送所收到的终端用户标识验证请求的第一终端设备。In step 315, the server, in response to receiving an end user identity verification request including the user identity to be verified, sent by the first terminal device, executes a user identity verification information ciphertext generation operation in a trusted execution environment of the server to obtain verification with the end user identity. Request the corresponding user identification verification information ciphertext, and send the obtained user identification verification information ciphertext to the first terminal device that sends the received end user identification verification request.
这里,第一终端设备可以在多种预设条件下向服务器发送包括待验证用户标识的终端用户标识验证请求。例如,第一终端设备可以在步骤301中、步骤302中向服务器发送用户信息添加请求之前,先向服务器发送由待发送的用户信息添加请求中的用户标识作为待验证用户标识生成的终端用户标识验证请求。如果收到服务器发送的终端用户验证通过结果,则可以将待发送的用户信息添加请求发送给服务器,反之,如果收到服务器发送的终端用户验证不通过结果,则不会向服务器发送待发送的用户信息添加请求。又例如,第一终端设备也可以在步骤304中向服务器发送用户信息转密请求之前,先向服务器发送由待发送的用户信息转密请求中的用户标识作为待验证用户标识生成的终端用户标识验证请求。如果收到服务器发送的终端用户验证通过结果,则可以将待发送的用户信息转密请求发送给服务器,反之,如果收到服务器发送的终端用户验证不通过结果,则不会向服务器发送待发送的用户信息转密请求。Here, the first terminal device may send an end user identity verification request including a user identity to be verified to the server under various preset conditions. For example, before sending the user information addition request to the server in steps 301 and 302, the first terminal device may first send the user ID in the user information addition request to be sent to the server as the terminal user ID generated by the user ID to be verified. Verify the request. If the end-user authentication pass result sent by the server is received, the user information addition request to be sent can be sent to the server. Conversely, if the end-user authentication pass result sent by the server is not passed, the server will not send the to-be-sent User information addition request. For another example, before sending the user information transfer request to the server in step 304, the first terminal device may also send the user ID in the user information transfer request to be sent to the server as the terminal user ID generated by the user ID to be verified. Verify the request. If the end-user authentication pass result sent by the server is received, the user information transfer request to be sent can be sent to the server. Conversely, if the end-user authentication pass result sent by the server is not passed, the server will not send the to-be-sent User information transfer request.
这样,服务器可以在接收到第一终端设备发送的包括待验证用户标识的终端用户标识验证请求的情况下,在服务器的可信执行环境中执行用户标识验证信息密文生成操作,得到与终端用户标识验证请求对应的用户标识验证信息密文,以及将所得到的用户标识验证信息密文发送给发送所收到的终端用户标识验证请求的第一终端设备。其中,用户标识验证信息密文生成操作可以包括如图3I所示的子步骤3151到子步骤3153:In this way, upon receiving an end user identity verification request including the identity of the user to be authenticated sent by the first terminal device, the server may execute the cipher text generation operation of the user identity verification information in the trusted execution environment of the server, and obtain The user identification verification information ciphertext corresponding to the identification verification request, and the obtained user identification verification information ciphertext is sent to the first terminal device that sends the received end user identification verification request. The ciphertext generation operation of the user identification verification information may include sub-steps 3151 to 3153 as shown in FIG. 3I:
子步骤3151,用服务器的可信执行环境中存储的用户标识密钥对所收到的待验证用户标识进行解密,得到待验证扩展用户标识。Sub-step 3151: Decrypt the received user ID to be verified by using the user ID key stored in the trusted execution environment of the server to obtain the extended user ID to be verified.
这里,第一终端设备的可信执行环境中和服务器的可信执行环境中都存储有相同的用户标识密钥,而且同理,服务器的可信执行环境中存储的用户标识密钥也只能被服务器的可信执行环境之内的程序访问,不能被服务器的可信执行环境之外的程序访问。如果待验证用户标识是由第一终端设备的可信执行环境之中存储的用户标识密钥对待验证扩展用户标识进行加密得到的,那么,用服务器的可信执行环境中存储的用户标识密钥对所收到的待验证用户标识进行解密,可以得到待验证扩展用户标识。Here, the same user identification key is stored in the trusted execution environment of the first terminal device and the server's trusted execution environment, and by the same token, the user identification key stored in the server's trusted execution environment can only be It is accessed by programs within the server's trusted execution environment and cannot be accessed by programs outside the server's trusted execution environment. If the user identification to be authenticated is obtained by encrypting the user identification key stored in the trusted execution environment of the first terminal device to be used for verification extended user identification, then the user identification key stored in the trusted execution environment of the server is used The received user ID to be verified is decrypted to obtain the extended user ID to be verified.
子步骤3152,生成包括允许解密环境标识集合和待验证信息的用户标识验证信息,将待验证扩展用户标识中的环境标识添加到所生成的用户标识验证信息中的允许解密环境标识集合中。Sub-step 3152, generating user identification verification information including a set of environment IDs that are allowed to be decrypted and information to be verified, and adding the environment ID in the extended user ID to be verified to the set of environment IDs that are allowed to be decrypted in the generated user ID verification information.
这里,待验证信息可以是随机生成的信息或者任意预设的信息内容。Here, the information to be verified may be randomly generated information or any preset information content.
子步骤3153,利用服务器的可信执行环境中存储的用户标识验证信息密钥对中的用户标识验证信息公钥对所生成的用户标识验证信息进行加密,得到与终端用户标识验证请求对应的用户标识验证信息密文。Sub-step 3153: The generated user identification verification information is encrypted by using the user identification verification information public key in the user identification verification information key pair stored in the trusted execution environment of the server to obtain a user corresponding to the end user identity verification request. Identifies the authentication information ciphertext.
这里,用户标识验证信息密钥包括用户标识验证信息公钥和用户标识验证信息私钥,其中,用户标识验证信息公钥可以存储在服务器或者第一终端设备的可信执行环境之内和可信执行环境之外,而用户标识验证信息私钥只能存储在服务器的可信执行环境之内或者第一终 端设备的可信执行环境之内,用户标识验证信息私钥只能被服务器的可信执行环境之内的程序或者第一终端设备的可信执行环境之内的程序访问。Here, the user identification verification information key includes a user identification verification information public key and a user identification verification information private key, wherein the user identification verification information public key may be stored in the trusted execution environment and trusted of the server or the first terminal device. Outside the execution environment, and the private key of the user identification verification information can only be stored in the trusted execution environment of the server or the trusted execution environment of the first terminal device, the private key of the user identification verification information can only be trusted by the server Programs within the execution environment or programs within the trusted execution environment of the first terminal device.
步骤316,第一终端设备响应于接收到服务器发送的用户标识验证信息密文,在该第一终端设备的可信执行环境中执行验证信息生成操作,得到与所收到的用户标识验证信息密文对应的验证信息,以及将所得到的验证信息发送给服务器。Step 316: In response to receiving the ciphertext of the user identification verification information sent by the server, the first terminal device executes an operation of generating verification information in a trusted execution environment of the first terminal device, and obtains a secret that is similar to the received user identification verification information. The verification information corresponding to the text, and send the obtained verification information to the server.
这里,验证信息生成操作可以包括如图3J所示的子步骤3161到子步骤3162:Here, the verification information generating operation may include sub-steps 3161 to 3162 as shown in FIG. 3J:
子步骤3161,利用该第一终端设备的可信执行环境中存储的用户标识验证信息密钥对中的用户标识验证信息私钥对所收到的用户标识验证信息密文进行解密,得到用户标识验证信息。Sub-step 3161: Decrypt the received user identification verification information cipher text by using the user identification verification information private key in the user identification verification information key pair stored in the trusted execution environment of the first terminal device to obtain the user identification. verify message.
这里,第一终端设备的可信执行环境中和服务器的可信执行环境中都存储有相同的用户标识验证信息私钥。如果所收到的用户标识验证信息密文是由服务器利用用户标识验证信息公钥对用户标识验证信息进行加密得到的,那么,用第一终端设备的可信执行环境中存储的用户标识验证信息私钥对所收到的用户标识验证信息密文进行解密,可以得到用户标识验证信息。Here, the same user identification verification information private key is stored in the trusted execution environment of the first terminal device and the trusted execution environment of the server. If the received user identification verification information ciphertext is obtained by the server using the user identification verification information public key to encrypt the user identification verification information, then the user identification verification information stored in the trusted execution environment of the first terminal device is used. The private key decrypts the ciphertext of the received user identification verification information to obtain the user identification verification information.
子步骤3162,响应于确定该第一终端设备的可信执行环境的环境标识属于解密得到的用户标识验证信息中的允许解密环境标识集合,将解密得到的用户标识验证信息中的待验证信息确定为与所收到的用户验证信息密文对应的验证信息。Sub-step 3162, in response to determining that the environment identifier of the trusted execution environment of the first terminal device belongs to the decryption-allowed environment identifier set in the user ID verification information obtained by decryption, determining the to-be-verified information in the user ID verification information obtained by decryption Authentication information corresponding to the ciphertext of the received user authentication information.
这里,子步骤3161中解密得到的用户标识验证信息包括允许解密环境标识集合和待验证信息,如果确定该第一终端设备的可信执行环境的环境标识属于解密得到的用户标识验证信息中的允许解密环境标识集合,表明步骤316中所收到的用户标识验证信息密文是服务器发送给该第一终端设备的,则可以将子步骤3161中解密得到的用户标识验证信息中的待验证信息确定为与所收到的用户验证信息密文对应的验证信息。Here, the user ID verification information obtained by decryption in sub-step 3161 includes a set of environment identifiers that are allowed to be decrypted and information to be verified. The decryption environment identification set indicates that the ciphertext of the user identification verification information received in step 316 was sent by the server to the first terminal device, and the information to be verified in the user identification verification information decrypted in substep 3161 can be determined Authentication information corresponding to the ciphertext of the received user authentication information.
步骤317,服务器响应于接收到第一终端设备发送的与所发送的 用户标识验证信息密文对应的验证信息,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同。Step 317: The server determines whether the received authentication information corresponds to the user corresponding to the ciphertext of the user identification verification information sent in response to receiving the authentication information corresponding to the ciphertext of the user identification verification information sent by the first terminal device. The information to be verified in the identification verification information is the same.
这里,服务器可以在接收到第一终端设备发送的与所发送的用户标识验证信息密文对应的验证信息的情况下,其中,所发送的用户标识验证信息密文与服务器收到的终端用户标识验证请求对应,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同。Here, the server may receive the authentication information corresponding to the sent user identification verification information cipher text sent by the first terminal device, where the sent user identification verification information cipher text and the end user identity received by the server Corresponds to the authentication request, and determines whether the received authentication information is the same as the to-be-verified information in the user identification authentication information corresponding to the ciphertext of the user identification authentication information sent.
步骤318,服务器响应于确定相同,生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果。In step 318, the server responds to the determination that it is the same, and generates an end-user authentication pass result for indicating that the received end-user identity authentication request authentication passes.
这里,服务器可以在步骤317中确定所收到的验证信息与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同的情况下,表明所收到的终端用户标识验证请求中的待验证用户标识是发送上述终端用户标识验证请求的第一终端设备的用户标识,可以生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果。Here, in step 317, the server may determine that the received authentication information is the same as the to-be-verified information in the user identification verification information corresponding to the cipher text of the user identification verification information sent, indicating that the received end user identity verification The user identity to be verified in the request is the user identity of the first terminal device that sent the above-mentioned end user identity verification request, and an end user verification pass result used to indicate that the received end user identity verification request verification is passed can be generated.
步骤319,服务器响应于确定不同,生成用于指示所收到的终端用户标识验证请求验证不通过的终端用户验证不通过结果。Step 319: In response to the determination being different, the server generates an end-user verification failure result for indicating that the received end-user identity verification request verification fails.
这里,服务器可以在步骤317中确定所收到的验证信息与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息不同的情况下,表明所收到的终端用户标识验证请求中的待验证用户标识不是发送上述终端用户标识验证请求的第一终端设备的用户标识,可以生成用于指示所收到的终端用户标识验证请求验证不通过的终端用户验证不通过结果。Here, in step 317, the server may determine that the received authentication information is different from the to-be-verified information in the user identification verification information corresponding to the cipher text of the user identification verification information sent, indicating that the received end user identification verification The user identity to be verified in the request is not the user identity of the first terminal device that sent the above-mentioned end user identity verification request, and an end user verification failure result may be generated to indicate that the received end user identity verification request fails verification.
经过上述可选实现方式(八)中的步骤315到步骤319,服务器可以实现对第一终端设备的用户标识进行验证,而且验证过程由于引入了可信执行环境中的复杂操作,相对于现有的验证码方式,更加安全。After steps 315 to 319 in the above-mentioned optional implementation manner (8), the server can implement verification of the user identity of the first terminal device, and the verification process introduces complex operations in a trusted execution environment, compared with the existing Verification code method, more secure.
由于页面显示限制,下面继续参考图3K,需要说明的是,图3K的流程除了包括图3K中所示的各个步骤外,还可以包括图3A、图3B、 图3F和图3H中所示的各个步骤。另外,需要说明的是,图3K中所示的第一终端设备和第二终端设备除了可以执行图3B、图3F、图3H和图3K中所示的相应步骤外,还可以执行图3A中所示的终端设备可以执行的各个步骤。Due to the limitation of the page display, the following continues to refer to FIG. 3K. It should be noted that in addition to the steps shown in FIG. 3K, the process of FIG. 3K may also include the steps shown in FIG. 3A, FIG. 3B, FIG. Each step. In addition, it should be noted that the first terminal device and the second terminal device shown in FIG. 3K can perform the corresponding steps shown in FIG. 3B, FIG. 3F, FIG. 3H, and FIG. 3K, and can also perform the steps shown in FIG. 3A. The various steps that the terminal device shown can perform.
可选实现方式(九):这里,基于上述可选实现方式(三)到上述可选实现方式(八)中的任一可选实现方式,上述时序300还可以包括步骤320到步骤326,以实现第一终端设备将信息定向发送给指定的第一终端设备和/或第二终端设备:Alternative implementation (9): Here, based on any of the alternative implementations (3) to (8) above, the above-mentioned sequence 300 may further include steps 320 to 326. The first terminal device is configured to send information to a designated first terminal device and / or a second terminal device:
步骤320,第一终端设备响应于检测到包括接收方用户标识集合和待加密信息的信息加密请求,在该第一终端设备的可信执行环境中执行信息加密操作,得到与信息加密请求对应的信息密文。Step 320: The first terminal device, in response to detecting an information encryption request including a receiver user identification set and information to be encrypted, performs an information encryption operation in a trusted execution environment of the first terminal device, and obtains a message corresponding to the information encryption request. Information ciphertext.
实践中,第一终端设备可以在多种预设条件下确定检测到信息加密请求。作为示例,信息创建者(比如,遗嘱创建人)可以打开第一终端设备上安装的定向信息加密应用,并输入各位信息接收者的用户标识(比如,各位遗嘱继承人的用户标识)作为接收方用户标识集合,然后输入待加密信息(比如,遗嘱内容)作为待加密信息,并点击关联信息加密操作的控件,从而第一终端设备可以确定检测到信息加密请求。又例如,信息创建者(比如,遗嘱创建人)还可以使用第一终端设备访问提供定向信息加密功能的网站,并输入各位信息接收者的用户标识(比如,各位遗嘱继承人的用户标识)作为接收方用户标识集合,然后输入待加密信息(比如,遗嘱内容)作为待加密信息,并点击页面中关联信息加密操作的页面元素,从而第一终端设备可以确定检测到信息加密请求。In practice, the first terminal device may determine that an information encryption request is detected under various preset conditions. As an example, the information creator (for example, the testator) can open the targeted information encryption application installed on the first terminal device, and enter the user ID of each information receiver (for example, the user ID of each heir) as the recipient user. Identify the set, and then input the information to be encrypted (for example, will content) as the information to be encrypted, and click the control of the associated information encryption operation, so that the first terminal device can determine that an information encryption request is detected. For another example, the information creator (for example, the testator) can also use the first terminal device to access the website that provides the directional information encryption function, and enter the user ID of each of the information receivers (for example, the user ID of each of the heirs of the will) as the receiver. Party user identification set, and then input the information to be encrypted (such as will content) as the information to be encrypted, and click the page element of the associated information encryption operation on the page, so that the first terminal device can determine that an information encryption request is detected.
这样,第一终端设备可以在检测到包括接收方用户标识集合和待加密信息的信息加密请求的情况下,在该第一终端设备的可信执行环境中执行信息加密操作,得到与信息加密请求对应的信息密文。其中,信息加密操作可以包括如图3L所示的子步骤3201和子步骤3202:In this way, the first terminal device can perform an information encryption operation in a trusted execution environment of the first terminal device in a case where an information encryption request including a receiver's user identity set and information to be encrypted is detected, to obtain an information encryption request. The corresponding information ciphertext. The information encryption operation may include sub-step 3201 and sub-step 3202 as shown in FIG. 3L:
子步骤3201,用接收方用户标识集合中的每个接收方用户标识对应的接收方环境标识生成接收方环境标识集合。In step 3201, a receiver environment identifier set is generated by using a receiver environment identifier corresponding to each receiver user identifier in the receiver user identifier set.
其中,接收方环境标识是用该第一终端设备的可信执行环境中存 储的用户标识密钥对接收方用户标识进行解密所得到的接收方扩展用户中的环境标识。Wherein, the receiver's environment identifier is the environment identifier in the receiver's extended user obtained by decrypting the receiver's user ID with the user's identification key stored in the trusted execution environment of the first terminal device.
即,接收方用户标识是在第一终端设备的可信执行环境之外提供给第一终端设备的可信执行环境之内的,在生成信息密文时使用的不是用户标识而是环境标识,因此,这里需要通过在第一终端设备的可信执行环境之内对接收方用户标识进行解密得到接收方环境标识。That is, the user identifier of the receiver is provided within the trusted execution environment of the first terminal device outside the trusted execution environment of the first terminal device. When generating the information ciphertext, not the user identification but the environment identification is used. Therefore, it is necessary to obtain the receiver environment identifier by decrypting the receiver user identifier within the trusted execution environment of the first terminal device.
子步骤3202,用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息公钥对接收方环境标识集合和待加密信息进行加密,得到与信息加密请求对应的信息密文。Sub-step 3202, encrypting the receiver's environment identification set and the information to be encrypted by using the directional information public key in the directional information key pair stored in the trusted execution environment of the first terminal device to obtain information corresponding to the information encryption request Ciphertext.
这里,定向信息密钥对包括定向信息公钥和定向信息私钥,其中,定向信息公钥可以存储在第一终端设备的可信信息环境之内和可信执行环境之外,定向信息公钥还可以存储在未设置可信执行环境的第二终端设备之中。而定向信息私钥只能存储在第一终端设备的可信执行环境中,只有第一终端设备的可信执行环境之内的程序可以访问定向信息私钥,第一终端设备的可信执行环境之外的程序不能访问定向信息私钥。Here, the directional information key pair includes a directional information public key and a directional information private key, wherein the directional information public key can be stored within the trusted information environment and outside the trusted execution environment of the first terminal device, and the directional information public key It may also be stored in a second terminal device without a trusted execution environment. The private key of the directed information can only be stored in the trusted execution environment of the first terminal device. Only the program within the trusted execution environment of the first terminal device can access the private key of the directed information, and the trusted execution environment of the first terminal device. Other programs cannot access the private key of the directed information.
经过这个加密操作,所生成的信息密文中利用定向信息公钥对接收方环境标识集合和待加密信息进行了加密。After this encryption operation, the directional information public key in the generated information ciphertext is used to encrypt the receiver's environment identification set and the information to be encrypted.
需要说明的是,这里,当第一终端设备作为信息创建方时,经过步骤320已经创建了信息密文。而第一终端设备除了可以作为信息创建方,还可以同时作为信息接收方,另外,可以作为信息接收方的还可以是未设置可信执行环境的第二终端设备。信息接收方可以采用各种实现方式获取信息创建方创建的信息密文。例如,信息创建方可以将信息密文以电子邮件的方式发送给信息接收方指定的电子邮箱,然后信息接收方可以通过收取电子邮件的方式获取信息密文,或者,信息创建方也可以提供下载信息密文的网址链接,然后信息接收方通过点击网址链接来下载信息密文,又或者,信息接收方还可以通过U盘直接从信息创建方拷贝信息密文。It should be noted that, here, when the first terminal device serves as the information creator, the information ciphertext has been created after step 320. The first terminal device may not only serve as the information creator but also the information receiver. In addition, the first terminal device may also be the second terminal device without a trusted execution environment. The information receiver can use various implementation methods to obtain the information ciphertext created by the information creator. For example, the creator of the information can send the ciphertext of the information to the email address specified by the receiver of the information, and then the receiver of the information can obtain the ciphertext of the information by receiving the email, or the creator of the information can also provide the download The URL of the information ciphertext is linked, and then the information receiver clicks the URL link to download the information ciphertext. Alternatively, the information receiver can also copy the information ciphertext directly from the information creator through a USB flash drive.
经过步骤320实现了信息的定向加密,即,在信息密文生成时,指定了接收方环境标识集合,只有环境标识属于信息密文中指定的接 收方环境标识集合时,才能使用信息密文对应的信息明文。After step 320, the information is encrypted. That is, when the information ciphertext is generated, the receiver environmental identifier set is specified. Only when the environment identifier belongs to the receiver environmental identifier set specified in the information ciphertext, can the corresponding information ciphertext be used. Information in plain text.
步骤321,第一终端设备响应于检测到包括待解密信息密文的第一信息解密请求,在该第一终端设备的可信执行环境中执行第一信息解密操作,得到与第一信息解密请求对应的信息明文。Step 321: In response to detecting the first information decryption request including the ciphertext of the information to be decrypted, the first terminal device executes the first information decryption operation in the trusted execution environment of the first terminal device to obtain the first information decryption request. The corresponding message is plain text.
这里,当第一终端设备作为信息接收方,为了使用信息密文,需要对信息密文进行解密。这时,第一终端设备可以在检测到包括待解密信息密文的第一信息解密请求的情况下,在该第一终端设备的可信执行环境中执行第一信息解密操作,得到与第一信息解密请求对应的信息明文。其中,第一信息解密操作可以包括如图3M所示的子步骤3211和子步骤3212:Here, when the first terminal device serves as the information receiver, in order to use the information ciphertext, the information ciphertext needs to be decrypted. At this time, when the first terminal device detects the first information decryption request including the ciphertext of the information to be decrypted, the first terminal device executes the first information decryption operation in the trusted execution environment of the first terminal device to obtain the first information decryption operation. The plaintext of the message corresponding to the message decryption request. The first information decryption operation may include sub-step 3211 and sub-step 3212 as shown in FIG. 3M:
子步骤3211,利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对第一信息解密请求中的待解密信息密文进行解密,得到第一接收方环境标识集合和第一信息明文。Sub-step 3211: The ciphertext of the information to be decrypted in the first information decryption request is decrypted by using the directional information private key in the directional information key pair stored in the trusted execution environment of the first terminal device to obtain a first receiver. The environment identification set and the first information are in plain text.
这里,如果待解密信息是利用定向信息公钥加密的,那么这里利用该第一终端设备的可信执行环境中存储的定向信息私钥对第一信息解密请求中的待解密信息密文进行解密,就可以得到第一接收方环境标识集合和第一信息明文。Here, if the information to be decrypted is encrypted with the public key of the directional information, then the private key of the directional information stored in the trusted execution environment of the first terminal device is used to decrypt the ciphertext of the information to be decrypted in the first information decryption request. , The first receiver's environment identifier set and the first information plaintext can be obtained.
子步骤3212,响应于确定该第一终端设备的可信执行环境的环境标识属于第一接收方环境标识集合,将第一信息明文确定为与第一信息解密请求对应的信息明文。Sub-step 3212, in response to determining that the environment identifier of the trusted execution environment of the first terminal device belongs to the first receiver environment identifier set, determining the first information plaintext as the information plaintext corresponding to the first information decryption request.
子步骤3211中已经解密得到了第一接收方环境标识集合和第一信息明文,如果该第一终端设备的可信执行环境的环境标识属于解密得到的第一接收方环境标识集合,表明步骤321中的待解密信息是发送给该第一种终端设备的,那么就可以将子步骤3211中解密得到的第一信息明文确定为与第一信息解密请求对应的信息明文,即可以在第一终端设备中使用与第一信息解密请求对应的信息明文了。反之,如果该第一终端设备的可信执行环境的环境标识不属于解密得到的第一接收方环境标识集合,表明步骤321中的待解密信息不是发送给该第一种终端设备的,虽然已经在子步骤3211中已经在第一终端设备的可信执行环境中解密得到了第一信息明文,但第一终端设备还是不能获 取并使用第一信息明文。The first receiver environmental identifier set and the first information plaintext have been decrypted in sub-step 3211. If the environment identifier of the trusted execution environment of the first terminal device belongs to the decrypted first receiver environmental identifier set, step 321 is displayed. The information to be decrypted in is sent to the first terminal device, and then the first plaintext of the information decrypted in sub-step 3211 can be determined as the plaintext of the information corresponding to the first information decryption request, that is, the first terminal can be decrypted in the first terminal. The device uses the plaintext of the information corresponding to the first information decryption request. On the contrary, if the environment identifier of the trusted execution environment of the first terminal device does not belong to the first receiver environmental identifier set obtained by decryption, it indicates that the information to be decrypted in step 321 is not sent to the first terminal device, although In sub-step 3211, the first information plaintext has been decrypted in the trusted execution environment of the first terminal device, but the first terminal device still cannot obtain and use the first information plaintext.
这里,以环境标识区分待解密信息是否发给指定设备的实现方案,具备有一个显著优点,因为环境标识包括厂商标识与产品标识,厂商标识与产品标识可以各自只占4个字节,相比于以数字货币的公钥(至少占用33字节)或公钥哈希(至少占用20字节)而言,本方案的环境标识占用字节很节约。而且,因为厂商标识与产品标识的取值范围并不重叠,上述第一接收方环境标识集合在罗列各设备的环境标识时,对于连续多个具有相同厂商标识的设备,可以只列一次厂商标识,其后连续罗列多个产品标识能自动解析成具备相同厂商标识的指定设备。这样,上述第一接收方环境标识集合的字节占用又进一步压缩了。Here, the implementation of distinguishing whether the information to be decrypted is sent to a specified device by using the environment identifier has a significant advantage, because the environment identifier includes the manufacturer identifier and the product identifier, and the manufacturer identifier and the product identifier can each occupy only 4 bytes. For the public key (at least 33 bytes) or the hash of the public key (at least 20 bytes) of the digital currency, the environment identifier of this solution occupies a small amount of bytes. Moreover, because the value ranges of the manufacturer's identification and the product identification do not overlap, when the above first receiver's environmental identification set lists the environmental identification of each device, the manufacturer identification can be listed only once for multiple consecutive devices with the same manufacturer identification. After that, successively listing multiple product identifications can be automatically parsed into designated equipment with the same manufacturer identification. In this way, the byte occupancy of the first receiver environmental identifier set is further compressed.
经过步骤321实现了信息的定向解密,即,只有环境标识属于信息密文中指定的接收方环境标识集合时,才能使用信息明文。The directed decryption of the information is achieved through step 321, that is, the plaintext of the information can be used only when the environmental identifier belongs to the receiver environmental identifier set specified in the information ciphertext.
步骤322,第二终端设备响应于检测到包括待解密信息密文的第二信息解密请求,确定转密密钥。Step 322: The second terminal device determines a transfer key in response to detecting a second information decryption request including a ciphertext of the information to be decrypted.
这里,当第二终端设备作为信息接收方,由于第二终端设备未设置可信执行环境,为了使用信息密文对应的信息明文,需要借助第一终端设备进行信息转密,为此,需要首先确定转密密钥。这里,第二终端设备可以接收用户输入的密钥字符串作为转密密钥,第二终端设备也可以随机生成密钥作为转密密钥。Here, when the second terminal device is used as the information receiver, since the second terminal device does not have a trusted execution environment, in order to use the information plaintext corresponding to the information cipher text, it is necessary to use the first terminal device to perform information encryption. Determine the encryption key. Here, the second terminal device may receive the key string input by the user as the transfer key, and the second terminal device may also randomly generate a key as the transfer key.
步骤323,第二终端设备将第二转密指令利用定向信息密钥对中的定向信息公钥进行加密,得到第二转密指令密文。Step 323: The second terminal device encrypts the second cipher instruction with the directional information public key in the directional information key pair to obtain the second cipher instruction.
这里,第二转密指令包括该第二终端设备的用户验证信息和步骤322中所确定的转密密钥。Here, the second encryption instruction includes user authentication information of the second terminal device and the encryption password determined in step 322.
步骤324,第二终端设备将所得到的第二转密指令密文和第二信息解密请求中的待解密信息密文作为信息转密请求发送给对目标应用和/或目标网站提供支持的第一终端设备。Step 324: The second terminal device sends the obtained second ciphertext instruction ciphertext and the information ciphertext to be decrypted in the second information decryption request as an information cipher request to the first application providing support for the target application and / or the target website. A terminal device.
这里,由于第二终端设备未设置可信执行环境,作为信息接收方为了使用信息密文,需要借助第一终端设备进行信息转密。在步骤323中对第二转密指令进行了加密得到了第二转密指令密文,而待解密信息密文本身就是加密的,因此,可以将步骤323中所得到的第二转密 指令密文和第二信息解密请求中的待解密信息密文作为信息转密请求发送给对目标应用和/或目标网站提供支持的第一终端设备。Here, since the second terminal device does not have a trusted execution environment, as the information receiver, in order to use the information ciphertext, the information needs to be encrypted by means of the first terminal device. In step 323, the second cipher instruction is encrypted to obtain a second cipher instruction. The cipher text of the message to be decrypted is encrypted. Therefore, the second cipher instruction obtained in step 323 can be encrypted. The ciphertext of the message to be decrypted in the text and the second information decryption request is sent as an information transfer request to the first terminal device that provides support for the target application and / or the target website.
步骤325,第一终端设备响应于接收到第二终端设备发送的信息转密请求,在该第一终端设备的可信执行环境中执行信息转密操作,得到与所收到的信息转密请求对应的转密信息,以及将所得到的转密信息发送给发送所收到的信息转密请求的第二终端设备。Step 325: In response to receiving the information transfer request sent by the second terminal device, the first terminal device executes the information transfer operation in the trusted execution environment of the first terminal device, and obtains the request with the received information transfer request. The corresponding re-encryption information and the obtained re-encryption information are sent to a second terminal device that sends the received information re-encryption request.
这里,信息转密操作可以包括如图3O所示的子步骤3251到子步骤3254:Here, the information transfer operation may include sub-step 3251 to sub-step 3254 as shown in FIG. 3O:
子步骤3251,利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所收到的信息转密请求中的第二转密指令密文进行解密,得到用户验证信息和转密密钥。Sub-step 3251, decrypting the second ciphertext instruction ciphertext in the received information cipher request using the directional private key of the directional information key pair stored in the trusted execution environment of the first terminal device, Get user authentication information and transfer key.
这里,第一终端设备从第二终端设备收到的信息转密请求包括第二转密指令密文和待解密信息,而其中的第二转密指令密文是利用定向信息公钥加密得到的,因此,利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所收到的信息转密请求中的第二转密指令密文进行解密,可以得到第二转密指令,而第二转密指令包括第二终端设备的用户验证信息和转密密钥。Here, the information transcoding request received by the first terminal device from the second terminal device includes the second ciphertext instruction ciphertext and the information to be decrypted, and the second ciphertext instruction ciphertext is encrypted by using the directional information public key. Therefore, by using the directional information private key in the directional information key pair stored in the trusted execution environment of the first terminal device to decrypt the second ciphertext instruction ciphertext in the received information cipher request, it is possible to A second encryption instruction is obtained, and the second encryption instruction includes the user authentication information and the encryption key of the second terminal device.
子步骤3252,利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对解密得到的用户验证信息进行解密,得到验证码、用户序号和环境标识。Sub-step 3252, decrypting the user authentication information obtained by decryption using the user authentication information key stored in the trusted execution environment of the first terminal device to obtain a verification code, a user serial number, and an environment identifier.
这里,由于用户验证信息是第一终端设备在可信执行环境中采用用户验证信息密钥对预设验证码、当前用户序号和第一终端设备的可信执行环境的环境标识进行加密得到的,因此,利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对解密得到的用户验证信息进行解密,可以得到验证码、用户序号和环境标识。Here, because the user authentication information is obtained by the first terminal device using the user authentication information key in the trusted execution environment to encrypt the preset verification code, the current user serial number, and the environment identifier of the trusted execution environment of the first terminal device, Therefore, by using the user authentication information key stored in the trusted execution environment of the first terminal device to decrypt the user authentication information obtained by decryption, a verification code, a user serial number, and an environment identifier can be obtained.
子步骤3253,响应于确定解密得到的环境标识与该第一终端设备的可信执行环境的环境标识相同且解密得到的验证码与该第一终端设备的可信执行环境中存储的预设验证码相同,利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所收到的信息转密请求中的信息密文进行解密,得到第二接收方环境标识集合 和第二信息明文。Sub-step 3253, in response to determining that the environment identifier obtained by decryption is the same as the environment identifier of the trusted execution environment of the first terminal device and the verification code obtained by decryption is the preset verification stored in the trusted execution environment of the first terminal device The same code is used, and the directional information private key in the directional information key pair stored in the trusted execution environment of the first terminal device is used to decrypt the information ciphertext in the received information transfer request to obtain the second receiver. The environment identification set and the second information are in plain text.
这里,如果子步骤3252中对子步骤3251中解密得到的用户验证信息进行解密得到的验证码与该第一终端设备的可信执行环境中存储的预设验证码相同且解密得到的环境标识与该第一终端设备的可信执行环境的环境标识相同,表明发送信息转密请求的第二终端设备是向该第一终端设备注册过的第二终端设备,且该第二终端设备的用户验证信息密文是该第一终端设备生成的用户验证信息密文,那么,第一终端设备可以利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所收到的信息转密请求中的信息密文进行解密,得到第二接收方环境标识集合和第二信息明文。Here, if the verification code obtained by decrypting the user verification information decrypted in substep 3251 in substep 3252 is the same as the preset verification code stored in the trusted execution environment of the first terminal device, and the decrypted environment identifier is The environment identifier of the trusted execution environment of the first terminal device is the same, indicating that the second terminal device that sent the information transfer request is a second terminal device registered with the first terminal device, and the user of the second terminal device authenticates The information cipher text is the user authentication information cipher text generated by the first terminal device. Then, the first terminal device can use the directional information private key pair in the directional information key pair stored in the trusted execution environment of the first terminal device. The information ciphertext in the received information transfer request is decrypted to obtain the second receiver's environment identification set and the second information plaintext.
子步骤3254,响应于确定第二环境标识属于解密得到的第二接收方环境标识集合,利用解密得到的转密密钥对解密得到的第二信息明文进行加密,得到与所收到的信息转密请求对应的转密信息。Sub-step 3254, in response to determining that the second environment identifier belongs to the second receiver environmental identifier set obtained by decryption, encrypting the decrypted second information plaintext by using the decryption transfer key, to obtain a decryption message with the received information. The secret request corresponds to the confidentiality information.
这里,步骤3253中已经解密得到第二接收方环境标识集合和第二信息明文,则可以首先生成第二环境标识,其中,第二环境标识中的厂商标识是根据该第一终端设备的可信执行环境的产品标识所生成的第二厂商标识,第二环境标识中的产品标识是子步骤3252中解密所得到的用户序号。然后,确定第二环境标识是否属于解密得到的第二接收方环境标识集合,如果确定属于,表明步骤325中所收到的信息转密请求中的信息密文是发送给第二环境标识所指示的设备的,而第二环境标识是中的厂商标识是根据该第一终端设备的可信执行环境的产品标识所生成的第二厂商标识,第二环境标识中的产品标识是子步骤3252中解密所得到的用户序号,而子步骤3252中是对用户验证信息进行解密得到的用户序号,而且子步骤3252中所解密的用户验证信息是在子步骤3251中对所收到的信息转密请求进行解密得到的,因此,表明发送信息转密请求的第二终端设备属于可以接收所收到的信息转密请求中的待解密信息的设备,也就是说,发送信息转密请求的第二终端设备可以接收子步骤3253中解密得到的第二信息明文。Here, after the second receiver environmental identifier set and the second information plaintext have been decrypted in step 3253, the second environmental identifier may be generated first, where the vendor identifier in the second environmental identifier is based on the trustworthiness of the first terminal device. The second vendor identifier generated by the product identifier of the execution environment, and the product identifier in the second environment identifier is the user serial number obtained by decryption in sub-step 3252. Then, it is determined whether the second environment identifier belongs to the decrypted second receiver environment identifier set. If it belongs, it indicates that the information ciphertext in the information transfer request received in step 325 is sent to the second environment identifier as instructed. The device ID of the second environment ID is the second vendor ID generated according to the product ID of the trusted execution environment of the first terminal device. The product ID in the second environment ID is in sub-step 3252. The user serial number obtained after decryption, and the user serial number obtained by decrypting the user authentication information in sub-step 3252, and the user authentication information decrypted in sub-step 3252 is a request for the encryption of the received information in sub-step 3251. It is obtained by performing decryption. Therefore, it indicates that the second terminal device that sends the information transfer request belongs to a device that can receive the information to be decrypted in the received information transfer request, that is, the second terminal that sends the information transfer request. The device may receive the plaintext of the second information obtained by decryption in sub-step 3253.
但是,为了避免第一终端设备获取第二信息明文而导致泄露原本发送给第二终端设备的信息明文,在确定第二环境标识属于解密得到 的第二接收方环境标识集合的情况下,可以利用子步骤3251中解密得到的转密密钥对子步骤3253中解密得到的第二信息明文进行加密,得到与所收到的信息转密请求对应的转密信息。而且,上述加密过程是在第一终端设备的可信执行环境之中进行的,第一终端设备的可信执行环境之外的程序是不能获取第二信息明文的,只能获取利用转密密钥对第二信息明文加密之后得到的转密信息,故而保护了定向发送给第二终端设备的信息的安全。However, in order to prevent the first terminal device from obtaining the plaintext of the second information and leaking the plaintext of the information originally sent to the second terminal device, in the case of determining that the second environment identifier belongs to the decrypted second receiver environment identifier set, it may be used The decryption key obtained in the sub-step 3251 encrypts the plaintext of the second information obtained in the sub-step 3253, and obtains the secret information corresponding to the received information transfer request. Moreover, the above encryption process is performed in the trusted execution environment of the first terminal device. Programs outside the trusted execution environment of the first terminal device cannot obtain the plaintext of the second information. The re-encrypted information obtained after the key encrypts the second information in plain text, thereby protecting the security of the information directed to the second terminal device.
步骤326,第二终端设备响应于接收到第一终端设备发送的转密信息,利用所检测到的第二信息解密请求中的转密密钥对收到的转密信息进行解密得到信息明文。Step 326: In response to receiving the turn-key information sent by the first terminal device, the second terminal device uses the detected turn-key in the second information decryption request to decrypt the received turn-key information to obtain information plaintext.
这里,第二终端设备可以在接收到第一终端设备发送的转密信息的情况下,其中,所收到的转密信息对应与针对所检测到的第二信息解密请求所生成并发送的信息转密请求,利用所检测到的第二信息解密请求中的转密密钥对收到的转密信息进行解密得到信息明文。Here, in a case where the second terminal device receives the re-encryption information sent by the first terminal device, the received re-encryption information corresponds to the information generated and transmitted for the detected second information decryption request. The re-encryption request uses the detected re-encryption key in the second information decryption request to decrypt the received re-encryption information to obtain the plaintext of the information.
从而,经过步骤320到步骤326,第二终端设备作为信息接收方,虽然未设置可信执行环境,故而不具备信息解密能力,但可以借助具有信息解密能力的第一终端设备实现信息解密,能够使用发送给自身的信息密文对应的信息明文。Therefore, after step 320 to step 326, the second terminal device serves as the information receiver. Although the trusted execution environment is not set and therefore does not have the information decryption capability, the information terminal can be decrypted by using the first terminal device with the information decryption capability. Use the message plaintext corresponding to the message ciphertext sent to itself.
从图3中可以看出,与图2对应的实施例相比,本实施例中的用于处理用户信息的系统的时序300中引入了用户信息范围标识。由此,本实施例描述的方案可以实现针对不同的范围内的用户信息添加和查询。As can be seen from FIG. 3, compared with the embodiment corresponding to FIG. 2, a user information range identifier is introduced in the time sequence 300 of the system for processing user information in this embodiment. Therefore, the solution described in this embodiment can implement addition and query of user information in different scopes.
进一步参考图4,其示出了一种用于处理用户信息的方法的一个实施例的流程400,应用于用于处理用户信息的系统中的服务器,其中,用于处理用户信息的系统包括至少一个终端设备和服务器,服务器设置可信执行环境,该用于处理用户信息的方法的流程400,包括以下步骤:With further reference to FIG. 4, it illustrates a process 400 of an embodiment of a method for processing user information, which is applied to a server in a system for processing user information, wherein the system for processing user information includes at least A terminal device and a server. The server sets a trusted execution environment. The process 400 of the method for processing user information includes the following steps:
步骤401,响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应 存储。In step 401, in response to receiving a user information addition request sent by the terminal device, the user identification, user information, and encryption mark in the received user information addition request are correspondingly stored.
在本实施例中,用于处理用户信息的方法的执行主体(例如,图1所示的服务器)可以在接收到终端设备发送的用户信息添加请求的情况下,其中,用户信息添加请求可以包括用户标识、用户信息和加密标记,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储。这里,加密标记为用于表征用户信息添加请求中的用户信息为加密后的用户信息密文的已加密标记或者用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文的未加密标记。也就是说,所收到的用户信息添加请求中的用户信息可以是用户信息明文,也可以是经过加密后的用户信息密文。In this embodiment, the execution subject of the method for processing user information (for example, the server shown in FIG. 1) may receive a user information addition request sent by the terminal device, where the user information addition request may include User identification, user information, and encryption mark, and store the user identification, user information, and encryption mark in the received user information addition request. Here, the encryption mark is an encrypted mark used to characterize the user information in the user information addition request as encrypted user information ciphertext, or an encrypted mark used to characterize the user information in the user information addition request as unencrypted user information in plain text. Encrypted token. That is, the user information in the received user information addition request may be user information plaintext or encrypted user information ciphertext.
这里,用户信息可以包括用户的各种属性信息,例如,用户信息可以包括姓名、年龄、性别、手机号码、证件号码、昵称、头像图像、兴趣爱好、职业、收入状况、学历、籍贯、家庭地址、工作地址等等。Here, the user information may include various attribute information of the user, for example, the user information may include name, age, gender, mobile phone number, ID number, nickname, avatar image, hobbies, occupation, income status, education background, hometown, home address , Work address, etc.
这里,用户标识用于唯一标识服务器所存储的用户信息对应的各个用户。用户标识可以包括以下至少一项:数字、字符和文字。Here, the user identifier is used to uniquely identify each user corresponding to the user information stored by the server. The user ID can include at least one of the following: numbers, characters, and text.
作为示例,可以以“0”作为未加密标记,以“1”作为加密标记,或者,还可以以“False”作为未加密标记,以“True”作为加密标记。As an example, "0" may be used as the unencrypted mark, and "1" may be used as the encrypted mark, or "False" may be used as the unencrypted mark, and "True" may be used as the encrypted mark.
可以理解的是,实践中,由于用户信息的数量巨大,上述执行主体可以将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存在分布式数据库中。It can be understood that, in practice, due to the huge amount of user information, the above-mentioned execution subject may store the user identification, user information, and encryption mark in the received user information addition request in a distributed database.
步骤402,响应于接收到终端设备发送的用户信息转密请求,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记。Step 402: In response to receiving the user information transfer request sent by the terminal device, query the user information and the encryption mark corresponding to the user identifier in the received user information transfer request.
由于上述执行主体对应存储有用户标识、用户信息和加密标记,因此,上述执行主体可以在接收到终端设备发送的用户信息转密请求的情况下,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记,然后转到步骤403执行。其中,上述用户信息转密请求可以包括用户标识和第一转密指令。Since the execution subject correspondingly stores a user ID, user information, and encryption mark, the execution subject may query and receive the user information transfer request in the case of receiving the user information transfer request from the terminal device. The user information corresponding to the user ID and the encryption token, and then go to step 403 for execution. The user information transfer request may include a user identification and a first transfer request.
步骤403,在可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转 密用户信息发送给发送所收到的用户信息转密请求的终端设备。Step 403: In a trusted execution environment, perform a user information transfer encryption operation to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to the sender and receiver. The terminal device of the user information transfer request.
在本实施例中,上述执行主体可以在步骤402中查询得到用户信息和加密标记后,在上述执行主体中设置的可信执行环境中,执行用户信息转密操作,得到与步骤402中所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。In this embodiment, after the above-mentioned execution body can query the user information and the encryption mark in step 402, the user information encryption operation is performed in the trusted execution environment set in the above-mentioned execution body, and the same as received in step 402 is obtained. The user information corresponding to the received user information encryption request, and the obtained user information transmitted to the encryption device is sent to the terminal device that sends the received user information encryption request.
其中,可以参考图2A所示的实施例中的步骤205中关于用户信息转密操作的相关描述,在此不再赘述。For details, reference may be made to the related description of the user information transfer encryption operation in step 205 in the embodiment shown in FIG. 2A, and details are not described herein again.
经过用户信息转密操作,在上述执行主体的可信执行环境中对用户信息明文利用转密密钥进行了加密,上述执行主体的可信执行环境之外的程序只能获取经过转密密钥加密之后的转密用户信息,不能获取用户信息明文,从而避免了上述执行主体泄露用户信息明文。After the user information is encrypted, the user information is encrypted in plain text in the trusted execution environment of the above-mentioned execution subject using a turn-key. The program outside the trusted execution environment of the above-mentioned execution subject can only obtain the encrypted key. After the encrypted user information is encrypted, the plaintext of the user information cannot be obtained, thereby preventing the above-mentioned execution subject from revealing the plaintext of the user information.
在本实施例的一些可选的实现方式中,步骤401中接收到的用户信息添加请求还可以包括用户信息范围标识。这样,步骤401还可以如下进行:响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储。In some optional implementation manners of this embodiment, the user information addition request received in step 401 may further include a user information range identifier. In this way, step 401 can also be performed as follows: in response to receiving the user information addition request sent by the terminal device, storing the user identification, the user information range identification, the user information, and the encryption mark in the received user information addition request in a corresponding manner.
这里,用户信息范围标识用于指示用户信息所包括的各种属性信息中的至少一种属性信息,也可以理解为用户信息范围标识用于指示用户信息所包括的各个字段中的至少一个字段。实践中,可以将用户信息所包括的各种属性信息按照每种属性信息的隐私程度和/或重要程度进行分类,标定每种属性信息所属的用户信息范围标识。Here, the user information range identifier is used to indicate at least one kind of attribute information among various attribute information included in the user information, and it can also be understood that the user information range identifier is used to indicate at least one of various fields included in the user information. In practice, various attribute information included in the user information may be classified according to the privacy degree and / or importance degree of each attribute information, and the user information range identifier to which each attribute information belongs is marked.
在本实施例的一些可选的实现方式中,步骤402中接收到的用户信息转密请求还可以包括用户信息范围标识。这样,步骤402还可以如下进行:查询与所收到的用户信息转密请求中的用户标识和用户信息范围标识对应的用户信息和加密标记。In some optional implementations of this embodiment, the user information transfer request received in step 402 may further include a user information range identifier. In this way, step 402 can also be performed as follows: Query the user information and the encryption mark corresponding to the user identifier and the user information range identifier in the received user information transfer request.
在本实施例的一些可选的实现方式中,上述用于处理用户信息的方法还可以执行以下步骤404到步骤407:In some optional implementation manners of this embodiment, the foregoing method for processing user information may further perform the following steps 404 to 407:
步骤404,响应于接收到设置可信执行环境的终端设备发送的包括待验证用户标识的终端用户标识验证请求,在可信执行环境中执行 用户标识验证信息密文生成操作,得到与终端用户标识验证请求对应的用户标识验证信息密文,以及将所得到的用户标识验证信息密文发送给发送所收到的终端用户标识验证请求的终端设备。Step 404: In response to receiving an end user identity verification request including a user identity to be verified and sent by a terminal device that sets a trusted execution environment, execute a user identity verification information ciphertext generation operation in the trusted execution environment to obtain an identity with the end user. The user identification verification information ciphertext corresponding to the verification request, and the obtained user identification verification information ciphertext is sent to the terminal device that sends the received end user identity verification request.
在本实施例中,步骤404的具体操作与图3H所示的实施例中步骤315的操作基本相同,在此不再赘述,其中,步骤404中设置可信执行环境的终端设备相当于步骤315中的第一终端设备。In this embodiment, the specific operation of step 404 is basically the same as the operation of step 315 in the embodiment shown in FIG. 3H, which is not repeated here. The terminal device that sets the trusted execution environment in step 404 is equivalent to step 315. In the first terminal device.
步骤405,响应于接收到设置可信执行环境的终端设备发送的与所发送的用户标识验证信息密文对应的验证信息,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同。Step 405: In response to receiving the authentication information corresponding to the sent user identification verification information ciphertext sent by the terminal device setting the trusted execution environment, determine whether the received verification information is in ciphertext with the sent user identification verification information. The information to be verified in the corresponding user identification verification information is the same.
这里,上述执行主体可以在接收到设置可信执行环境的终端设备发送的与所发送的用户标识验证信息密文对应的验证信息的情况下,其中,所发送的用户标识验证信息密文与所收到的终端用户标识验证请求对应,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同。Here, the foregoing execution subject may receive the authentication information corresponding to the sent user identification verification information ciphertext sent by the terminal device that sets the trusted execution environment, where the sent user identification verification information ciphertext is related to the The received end user identity verification request corresponds, and it is determined whether the received verification information is the same as the information to be verified in the user identity verification information corresponding to the sent user identity verification information ciphertext.
步骤406,响应于确定相同,生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果。In step 406, in response to determining that they are the same, an end-user verification pass result is generated to indicate that the received end-user identity verification request verification has passed.
这里,上述执行主体可以在步骤405中确定所收到的验证信息与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同的情况下,表明所收到的终端用户标识验证请求中的待验证用户标识是发送上述终端用户标识验证请求的设置可信执行环境的终端设备的用户标识,则可以生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果。Here, the foregoing execution body may determine in step 405 that the received authentication information is the same as the to-be-verified information in the user identification verification information corresponding to the ciphertext of the user identification verification information sent, indicating that the received end user The user identity to be verified in the identity verification request is the user identity of the terminal device that sets the trusted execution environment for sending the above-mentioned end user identity verification request, and an end user who can indicate that the received verification of the end user identity verification request is passed can be generated Verify the results.
步骤407,响应于确定不同,生成用于指示所收到的终端用户标识验证请求验证不通过的终端用户验证不通过结果。In step 407, in response to the determination being different, an end user authentication failure result for indicating that the received end user identity authentication request authentication fails is generated.
这里,上述执行主体可以在步骤405中确定所收到的验证信息与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息不同的情况下,表明所收到的终端用户标识验证请求中的待验证用户标识不是发送上述终端用户标识验证请求的设置可信执行环境的终端设备的用户标识,则上述执行主体可以生成用于指示所收到的终 端用户标识验证请求验证不通过的终端用户验证不通过结果。Here, in step 405, the execution entity may determine that the received verification information is different from the to-be-verified information in the user identification verification information corresponding to the cipher text of the user identification verification information sent, indicating that the received end user The user identity to be verified in the identity verification request is not the user identity of the terminal device that sets the trusted execution environment for sending the above-mentioned end-user identity verification request, the above-mentioned execution subject may generate an indication that the received end-user identity verification request verification is not Passed end-user verification fails.
经过步骤404到步骤407,服务器可以实现对设置可信执行环境的终端设备的用户标识进行验证,而且验证过程由于引入了可信执行环境中的复杂操作,相对于现有的验证码方式,更加安全。After steps 404 to 407, the server can verify the user identity of the terminal device that sets the trusted execution environment, and the verification process is more complicated than the existing verification code method due to the introduction of complex operations in the trusted execution environment. Safety.
本申请的上述实施例提供的方法通过将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,以及查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记,再在可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备,在整个过程中避免了在可信执行环境之外获取用户信息明文,进而保护了用户信息的安全。The method provided by the foregoing embodiment of the present application stores the user ID, user information, and encryption mark in the received user information addition request in a corresponding storage manner, and queries the corresponding user ID in the received user information transfer request. User information and encryption mark, and then perform the user information transfer operation in a trusted execution environment to obtain the transfer user information corresponding to the received user information transfer request, and send the obtained transfer user information to The terminal device sending the received user information re-encryption request avoids obtaining the plaintext of the user information outside the trusted execution environment during the entire process, thereby protecting the security of the user information.
进一步参考图5,作为对上述各图所示方法的实现,本申请提供了一种用于处理用户信息的装置的一个实施例,该装置实施例与图4所示的方法实施例相对应,该装置具体可以应用于各种设置有可信执行环境的电子设备中。With further reference to FIG. 5, as an implementation of the methods shown in the foregoing figures, this application provides an embodiment of a device for processing user information, which corresponds to the method embodiment shown in FIG. 4. The device can be specifically applied to various electronic devices provided with a trusted execution environment.
如图5所示,本实施例的用于处理用户信息的装置500包括:用户信息添加单元501、用户信息查询单元502和用户信息转密单元503。其中,用户信息添加单元501,被配置成响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,其中,加密标记为用于表征用户信息添加请求中的用户信息为加密后的用户信息密文的已加密标记或者用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文的未加密标记;用户信息查询单元502,被配置成响应于接收到终端设备发送的用户信息转密请求,其中,上述用户信息转密请求包括用户标识和第一转密指令,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;而用户信息转密单元503,被配置成在上述可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备,其中,上述用 户信息转密操作包括:利用上述服务器的可信执行环境中存储的与上述转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用上述服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。As shown in FIG. 5, the apparatus 500 for processing user information in this embodiment includes a user information adding unit 501, a user information query unit 502, and a user information transfer unit 503. The user information adding unit 501 is configured to store the user identification, user information, and encryption mark in the received user information addition request in response to receiving the user information addition request sent by the terminal device, and the encryption mark The encrypted information used to characterize the user information in the user information addition request as encrypted user information ciphertext or the unencrypted mark used to characterize the user information in the user information addition request as unencrypted user information in plain text; user The information query unit 502 is configured to respond to receiving a user information transfer request from the terminal device, where the user information transfer request includes a user identification and a first transfer instruction, and query and transfer the received user information transfer request. The user information and encryption mark corresponding to the user identification in the request; and the user information transfer unit 503 is configured to perform the user information transfer operation in the above-mentioned trusted execution environment to obtain a request for the transfer of the user information to the received user information. The corresponding encrypted user information, and send the obtained encrypted user information to send The terminal device that received the user information transfer request, wherein the user information transfer operation includes: using a transfer instruction private key corresponding to the transfer instruction instruction public key stored in the trusted execution environment of the server, The first encryption instruction in the received user information encryption request is decrypted to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the trusted execution environment of the server is used The encryption key stored in the key is used to decrypt the ciphertext key obtained by decryption to obtain the plaintext key; the plaintext key obtained by decryption is used to decrypt the found user information to obtain the user information plaintext; in response to determining that the found The encrypted mark is unencrypted, and the found user information is determined to be the plaintext of the user information; the decrypted transfer key is used to encrypt the plaintext of the obtained user information to obtain a correspondence with the received user information transfer request Confidential user information.
在本实施例中,用于处理用户信息的装置500的用户信息添加单元501、用户信息查询单元502和用户信息转密单元503的具体处理及其所带来的技术效果可分别参考图4对应实施例中步骤401、步骤402和步骤403的相关说明,在此不再赘述。In this embodiment, the specific processing of the user information adding unit 501, the user information querying unit 502, and the user information transfer unit 503 of the apparatus 500 for processing user information and the technical effects thereof can be respectively referred to corresponding to FIG. 4 Relevant descriptions of step 401, step 402, and step 403 in the embodiment are not repeated here.
在本实施例的一些可选的实现方式中,用户信息添加请求还可以包括用户信息范围标识;以及上述用户信息添加单元501可以进一步被配置成:响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储。In some optional implementations of this embodiment, the user information addition request may further include a user information range identifier; and the above-mentioned user information addition unit 501 may be further configured to: in response to receiving the user information addition request sent by the terminal device , And store the received user information in the user ID, user information range ID, user information, and encryption mark in the request.
在本实施例的一些可选的实现方式中,用户信息转密请求还可以包括用户信息范围标识;以及上述用户信息查询单元502可以进一步被配置成:查询与所收到的用户信息转密请求中的用户标识和用户信息范围标识对应的用户信息和加密标记。In some optional implementations of this embodiment, the user information transfer request may further include a user information range identifier; and the above-mentioned user information query unit 502 may be further configured to: query and receive the user information transfer request The user ID and user information range ID in the corresponding user information and encryption mark.
在本实施例的一些可选的实现方式中,上述装置500还可以包括:生成及发送单元504,被配置成响应于接收到设置可信执行环境的终端设备发送的包括待验证用户标识的终端用户标识验证请求,在上述可信执行环境中执行用户标识验证信息密文生成操作,得到与上述终端用户标识验证请求对应的用户标识验证信息密文,以及将所得到的用户标识验证信息密文发送给发送所收到的终端用户标识验证请求的终端设备,其中,上述用户标识验证信息密文生成操作包括:用上述 可信执行环境中存储的用户标识密钥对所收到的待验证用户标识进行解密,得到待验证扩展用户标识;生成包括允许解密环境标识集合和待验证信息的用户标识验证信息,将上述待验证扩展用户标识中的环境标识添加到所生成的用户标识验证信息中的允许解密环境标识集合中;利用上述可信执行环境中存储的用户标识验证信息密钥对中的用户标识验证信息公钥对所生成的用户标识验证信息进行加密,得到与上述终端用户标识验证请求对应的用户标识验证信息密文;确定单元505,被配置成响应于接收到设置可信执行环境的终端设备发送的与所发送的用户标识验证信息密文对应的验证信息,其中,所发送的用户标识验证信息密文与所收到的终端用户标识验证请求对应,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同;第一结果生成单元506,被配置成响应于确定相同,生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果;第二结果生成单元507,被配置成响应于确定不相同,生成用于指示所收到的终端用户标识验证请求验证不通过的终端用户验证不通过结果。In some optional implementations of this embodiment, the foregoing apparatus 500 may further include: a generating and sending unit 504 configured to respond to receiving a terminal including a user identifier to be sent and sent by a terminal device that sets a trusted execution environment The user ID verification request executes the user ID verification information ciphertext generation operation in the trusted execution environment to obtain the user ID verification information ciphertext corresponding to the terminal user ID verification request, and obtains the obtained user ID verification information ciphertext. Sending to the terminal device sending the received end user identity verification request, wherein the operation of generating the ciphertext of the user identity verification information includes: using the user identity key stored in the trusted execution environment to pair the received user to be verified The ID is decrypted to obtain the extended user ID to be verified. The user ID verification information including the set of environment IDs to be verified and the information to be verified is generated, and the environment ID in the extended user ID to be verified is added to the generated user ID verification information. Allows decryption of environment ID collections; utilizes the above Encrypting the generated user identification verification information with the public identification key of the user identification verification information in the user identification verification information key pair stored in the trusted execution environment to obtain the ciphertext of the user identification verification information corresponding to the above-mentioned end user identification verification request; The determining unit 505 is configured to respond to receiving the verification information corresponding to the sent user identification verification information ciphertext sent by the terminal device that sets the trusted execution environment, wherein the sent user identification verification information ciphertext and the received The corresponding end user identity verification request corresponds to whether the received verification information is the same as the to-be-verified information in the user identity verification information corresponding to the sent user identity verification information ciphertext; the first result generating unit 506 is configured to In response to the determination being the same, generating an end-user verification pass result indicating that the received end-user identity verification request verification has passed; the second result generating unit 507 is configured to generate the instruction for receiving Of end-user identity verification requests failed Results.
在本实施例的一些可选的实现方式中,上述服务器可以为支持OAuth2协议的资源服务器。In some optional implementation manners of this embodiment, the foregoing server may be a resource server supporting the OAuth2 protocol.
需要说明的是,本申请实施例提供的用于处理用户信息的装置中各单元的实现细节和技术效果可以参考本申请中其它实施例的说明,在此不再赘述。It should be noted that, for implementation details and technical effects of the units in the apparatus for processing user information provided in the embodiments of the present application, reference may be made to descriptions of other embodiments in the present application, and details are not described herein again.
下面参考图6,其示出了适于用来实现本申请实施例的服务器的计算机系统600的结构示意图。图6示出的服务器仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Reference is now made to FIG. 6, which shows a schematic structural diagram of a computer system 600 suitable for implementing a server according to an embodiment of the present application. The server shown in FIG. 6 is only an example, and should not impose any limitation on the functions and scope of use of the embodiments of the present application.
如图6所示,计算机系统600包括中央处理单元(CPU,Central Processing Unit)601,其可以根据存储在只读存储器(ROM,Read Only Memory)602中的程序或者从存储部分608加载到随机访问存储器(RAM,Random Access Memory)603中的程序而执行各种适当的动作和处理。在RAM 603中,还存储有系统600操作所需的各种程序和 数据。CPU 601、ROM 602以及RAM 603通过总线604彼此相连。输入/输出(I/O,Input/Output)接口605也连接至总线604。As shown in FIG. 6, the computer system 600 includes a central processing unit (CPU, Central Processing Unit) 601, which can be loaded into random access according to a program stored in a read-only memory (ROM, Read Only Memory) 602 or from a storage portion 608 A program in a memory (RAM, Random Access Memory) 603 performs various appropriate actions and processes. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O, Input / Output) interface 605 is also connected to the bus 604.
以下部件连接至I/O接口605:包括键盘、鼠标等的输入部分606;包括诸如阴极射线管(CRT,Cathode Ray Tube)、液晶显示器(LCD,Liquid Crystal Display)等以及扬声器等的输出部分607;包括硬盘等的存储部分608;以及包括诸如LAN(局域网,Local Area Network)卡、调制解调器等的网络接口卡的通信部分609。通信部分609经由诸如因特网的网络执行通信处理。驱动器610也根据需要连接至I/O接口605。可拆卸介质611,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器610上,以便于从其上读出的计算机程序根据需要被安装入存储部分608。The following components are connected to the I / O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a cathode ray tube (CRT, Cathode Ray Tube), a liquid crystal display (LCD, Liquid Crystal Display), and a speaker, etc. A storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 609 performs communication processing via a network such as the Internet. The driver 610 is also connected to the I / O interface 605 as necessary. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分609从网络上被下载和安装,和/或从可拆卸介质611被安装。在该计算机程序被中央处理单元(CPU)601执行时,执行本申请的方法中限定的上述功能。需要说明的是,本申请所述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的 程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing a method shown in a flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication portion 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the foregoing. The computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programming read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing. In this application, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal that is borne in baseband or propagated as part of a carrier wave, and which carries computer-readable program code. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable medium may send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device . Program code embodied on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言或其组合来编写用于执行本申请的操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++、Python,还包括常规的过程式程序设计语言—诸如”C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including programming languages such as Java, Smalltalk, C ++, Python, and also object-oriented. Includes regular procedural programming languages—such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partly on the user's computer, as an independent software package, partly on the user's computer, partly on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider) Internet connection).
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, which contains one or more functions to implement a specified logical function Executable instructions. It should also be noted that in some alternative implementations, the functions noted in the blocks may also occur in a different order than those marked in the drawings. For example, two successively represented boxes may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified function or operation , Or it can be implemented with a combination of dedicated hardware and computer instructions.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理 器中,例如,可以描述为:一种处理器包括用户信息添加单元、用户信息查询单元和用户信息转密单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,用户信息添加单元还可以被描述为“将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储的单元”。The units described in the embodiments of the present application may be implemented by software or hardware. The described unit may also be provided in a processor, for example, it may be described as: a processor includes a user information adding unit, a user information query unit, and a user information transfer and encryption unit. Among them, the names of these units do not constitute a limitation on the unit itself in some cases. For example, the user information adding unit may also be described as "the user ID, user information, and The encrypted token corresponds to the stored unit. "
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的装置中所包含的;也可以是单独存在,而未装配入该装置中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该装置执行时,使得该装置:响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,其中,加密标记为用于表征用户信息添加请求中的用户信息为加密后的用户信息密文的已加密标记或者用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文的未加密标记;响应于接收到终端设备发送的用户信息转密请求,其中,用户信息转密请求包括用户标识和第一转密指令,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;在可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备,其中,用户信息转密操作包括:利用服务器的可信执行环境中存储的与转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。As another aspect, the present application also provides a computer-readable medium, which may be included in the device described in the foregoing embodiments; or may exist alone without being assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device causes the device to: in response to receiving a user information addition request sent by a terminal device, update the received user information The user identification, user information, and encryption mark in the add request are correspondingly stored, where the encryption mark is an encrypted mark used to characterize the user information in the user information addition request as an encrypted user information ciphertext or used to characterize the addition of user information The user information in the request is an unencrypted mark of the user information that is not encrypted in plain text; in response to receiving a user information transfer request from the terminal device, wherein the user information transfer request includes a user identification and a first transfer instruction, query User information and encryption tokens corresponding to the user ID in the received user information transfer request; in a trusted execution environment, perform a user information transfer operation to obtain a transfer corresponding to the received user information transfer request Confidential user information, and send the obtained encrypted user information to the receiving A terminal device for requesting the transfer of user information, wherein the operation of transferring user information includes: using a private key of the private key corresponding to the public key of the private key stored in the trusted execution environment of the server, and transmitting the received user information. The first encryption instruction in the encryption request is decrypted to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the encryption key stored in the trusted execution environment of the server is used Decrypt the ciphertext key obtained by decryption to obtain the plaintext key; use the plaintext key obtained by decryption to decrypt the found user information to obtain the user information plaintext; in response to determining that the found encrypted token is an unencrypted token , The found user information is determined as the user information plaintext; the decrypted transfer key is used to encrypt the obtained user information plaintext to obtain the encrypted user information corresponding to the received user information encrypted request.
以上描述仅为本申请的较佳实施例以及对所运用技术原理的说 明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution of the specific combination of the above technical features, but should also cover the above technical features or Other technical solutions formed by arbitrarily combining their equivalent features. For example, a technical solution formed by replacing the above features with technical features disclosed in this application (but not limited to) having similar functions.

Claims (31)

  1. 一种用于处理用户信息的终端设备,包括:A terminal device for processing user information includes:
    处理器;以及Processor; and
    存储器,所述存储器存储有机器可读指令,所述机器可读指令能够由所述处理器运行以执行以下操作:A memory that stores machine-readable instructions that can be executed by the processor to perform the following operations:
    响应于检测到包括用户标识、待添加用户信息和明文密钥的加密用户信息添加请求,在对密钥和用户信息加密操作提供支持的目标可信执行环境中,执行密钥和用户信息加密操作,得到与所述明文密钥对应的密文密钥和与所述待添加用户信息对应的用户信息密文,以及将包括所述加密用户信息添加请求中的用户标识、所得到的用户信息密文和加密标记为已加密标记的用户信息添加请求发送给服务器;In response to detecting an encrypted user information addition request including a user ID, user information to be added, and a plaintext key, the key and user information encryption operation is performed in a target trusted execution environment that supports the encryption operation of the key and user information To obtain a ciphertext key corresponding to the plaintext key and a user information ciphertext corresponding to the user information to be added, and to include the user ID and the obtained user information secret in the encrypted user information addition request. Send a request for adding the user information of the text and the encryption mark to the encrypted mark to the server;
    响应于检测到包括用户标识、待添加用户信息和加密标记为未加密标记的未加密用户信息添加请求,将所述未加密用户信息添加请求作为用户信息添加请求发送给所述服务器,未加密标记用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文;In response to detecting an unencrypted user information addition request including a user identification, user information to be added, and an encrypted mark as an unencrypted mark, sending the unencrypted user information addition request to the server as a user information addition request, the unencrypted mark It is used to indicate that the user information in the user information addition request is plaintext of the user information without encryption;
    响应于检测到包括用户标识、密文密钥和转密密钥的用户信息查询请求,利用转密指令公钥对所收到的用户信息查询请求中的密文密钥和转密密钥进行加密得到第一转密指令,以及将所述用户信息查询请求中的用户标识和所得到的第一转密指令作为与所述用户信息查询请求对应的用户信息转密请求发送给所述服务器;以及In response to detecting a user information query request including a user ID, a ciphertext key, and a transfer key, the ciphertext key and the transfer key in the received user information query request are performed using the transfer key instruction public key Obtain the first transfer password instruction by encryption, and send the user identifier in the user information query request and the obtained first transfer password instruction to the server as a user information transfer password request corresponding to the user information query request; as well as
    响应于接收到所述服务器发送的与所发送的用户信息转密请求对应的转密用户信息,利用所发送的用户信息转密请求所对应的用户信息查询请求中的转密密钥对所收到的转密用户信息进行解密得到用户信息明文。In response to receiving the encrypted user information corresponding to the sent user information encrypted request sent by the server, the received encrypted user key corresponding to the transmitted user information query request corresponding to the transmitted user information encrypted request is used to receive the received encrypted password. The encrypted user information is decrypted to obtain the user information in plain text.
  2. 根据权利要求1所述的终端设备,其中,已加密标记用于表征 用户信息添加请求中的用户信息为加密后的用户信息密文,所述密钥和用户信息加密操作包括:利用所述目标可信执行环境中存储的加密明文密钥用密钥,对所述明文密钥进行加密得到与所述明文密钥对应的密文密钥;以及利用所述明文密钥对所述待添加用户信息进行加密,得到与所述待添加用户信息明文对应的用户信息密文。The terminal device according to claim 1, wherein the encrypted token is used to characterize that the user information in the user information adding request is an encrypted user information ciphertext, and the encryption operation of the key and the user information comprises: using the target A key for encrypting the plaintext key stored in the trusted execution environment, encrypting the plaintext key to obtain a ciphertext key corresponding to the plaintext key; and using the plaintext key to the user to be added The information is encrypted to obtain a user information ciphertext corresponding to the plaintext of the user information to be added.
  3. 根据权利要求1所述的终端设备,其中,加密用户信息添加请求和未加密用户信息添加请求还包括用户信息范围标识。The terminal device according to claim 1, wherein the encrypted user information addition request and the unencrypted user information addition request further include a user information range identifier.
  4. 根据权利要求3所述的终端设备,其中,将包括所述加密用户信息添加请求中的用户标识、所得到的用户信息密文和加密标记为已加密标记的用户信息添加请求发送给服务器,包括:The terminal device according to claim 3, wherein sending to the server a user information addition request including the user identification in the encrypted user information addition request, the obtained user information ciphertext, and the user information encrypted mark as an encrypted mark, comprising: :
    将包括所述加密用户信息添加请求中的用户标识和用户信息范围标识、所得到的加密用户信息以及加密标记为已加密标记的用户信息添加请求发送给所述服务器。And sending the user identification and user information range identification in the encrypted user information addition request, the obtained encrypted user information, and the user information addition request encrypted with an encrypted mark to the server.
  5. 根据权利要求3所述的终端设备,其中,响应于检测到包括用户标识、待添加用户信息和加密标记为未加密标记的未加密用户信息添加请求,将所述未加密用户信息添加请求作为用户信息添加请求发送给所述服务器,包括:The terminal device according to claim 3, wherein in response to detecting an unencrypted user information addition request including a user identification, user information to be added, and an encrypted mark as an unencrypted mark, the unencrypted user information addition request is treated as a user Sending an information addition request to the server includes:
    响应于检测到包括用户标识、用户信息范围标识、待添加用户信息和加密标记为未加密标记的未加密用户信息添加请求,将所述未加密用户信息添加请求作为用户信息添加请求发送给所述服务器。In response to detecting an unencrypted user information addition request including a user identification, a user information range identification, user information to be added, and an encrypted mark as an unencrypted mark, sending the unencrypted user information addition request to the user information addition request to the server.
  6. 根据权利要求1所述的终端设备,其中,所述用户信息查询请求还包括用户信息范围标识,并且将所述用户信息查询请求中的用户标识和所得到的第一转密指令作为与所述用户信息查询请求对应的用户信息转密请求发送给所述服务器,包括:The terminal device according to claim 1, wherein the user information query request further includes a user information range identifier, and the user identifier in the user information query request and the obtained first transfer password instruction are used as the same as the Sending the user information transfer request corresponding to the user information query request to the server includes:
    将所述用户信息查询请求中的用户标识和用户信息范围标识以及所得到的第一转密指令作为与所述用户信息查询请求对应的用户信息 转密请求发送给所述服务器。And sending the user identifier and user information range identifier in the user information query request and the obtained first transfer password instruction to the server as a user information transfer password request corresponding to the user information query request.
  7. 根据权利要求1所述的终端设备,其中,加密用户信息添加请求中的用户标识、未加密用户信息添加请求中的用户标识和用户信息查询请求中的用户标识是终端设备的用户标识集合中的用户标识。The terminal device according to claim 1, wherein the user identification in the encrypted user information addition request, the user identification in the unencrypted user information addition request, and the user identification in the user information query request are in the user identification set of the terminal device. User ID.
  8. 根据权利要求7所述的终端设备,其中,所述终端设备包括设置可信执行环境的第一终端设备,并且所述第一终端设备响应于检测到包括第一用户标识类别标识的第一用户标识生成请求,在该第一终端设备的可信执行环境中,执行第一用户标识生成操作,得到与所述第一用户标识生成请求对应的用户标识,以及将所得到的用户标识添加到该第一终端设备的用户标识集合中,其中,所述第一用户标识生成操作包括:获取用于指示该第一终端设备的可信执行环境的、包括厂商标识和产品标识的环境标识;随机生成随机数;用该第一终端设备的可信执行环境中存储的用户标识密钥对第一扩展用户标识进行加密,得到与所述第一用户标识生成请求对应的用户标识,其中,所述第一扩展用户标识包括所获取的环境标识、所生成的随机数和所述第一用户标识生成请求中的第一用户标识类别标识。The terminal device according to claim 7, wherein the terminal device comprises a first terminal device setting a trusted execution environment, and the first terminal device is responsive to detecting a first user including a first user identification category identifier An identity generation request, in a trusted execution environment of the first terminal device, performing a first user identity generation operation to obtain a user identity corresponding to the first user identity generation request, and adding the obtained user identity to the In the user identifier set of the first terminal device, the first user identifier generating operation includes: obtaining an environment identifier including a manufacturer identifier and a product identifier, which is used to indicate a trusted execution environment of the first terminal device; randomly generated A random number; using the user identification key stored in the trusted execution environment of the first terminal device to encrypt the first extended user identification to obtain a user identification corresponding to the first user identification generation request, wherein the first An extended user ID includes the obtained environment ID, the generated random number, and the first user ID generation The first user identification category identifier in the request.
  9. 根据权利要求8所述的终端设备,其中,所述第一终端设备响应于检测到包括待验证用户标识和待加密信息的用户标识验证请求,在该第一终端设备的可信执行环境中执行用户标识验证操作,得到与所述用户标识验证请求对应的验证结果,其中,所述用户标识验证操作包括:用该第一终端设备的可信执行环境中存储的用户标识密钥对所述待验证用户标识解密,得到待验证扩展用户标识;按照预设算法,根据所述待验证扩展用户标识中的环境标识生成第一密钥;用所生成的第一密钥加密所述待加密信息,得到第一加密信息;按照所述预设算法,根据该第一终端设备的可信执行环境的环境标识生成第二密钥;用所生成的第二密钥对所得到的第一加密信息解密,得到第一明文信息;响应于确定所得到的第一明文信息与所述待加密信息相同,生成 用于指示所述待验证用户标识为该第一终端设备的用户标识的是用户标识验证结果;响应于确定所得到的第一明文信息与所述待加密信息不同,生成用于指示所述待验证用户标识不是该第一终端设备的用户标识的非用户标识验证结果。The terminal device according to claim 8, wherein the first terminal device executes in a trusted execution environment of the first terminal device in response to detecting a user identification verification request including a user identity to be verified and information to be encrypted. A user identity verification operation obtains a verification result corresponding to the user identity verification request, wherein the user identity verification operation includes: using a user identity key stored in a trusted execution environment of the first terminal device to pair the standby Decrypting the verified user ID to obtain the extended user ID to be verified; generating a first key according to a preset algorithm according to the environment ID in the extended user ID to be verified; and encrypting the information to be encrypted with the generated first key, Obtaining the first encryption information; generating a second key according to the preset algorithm, and an environment identifier of the trusted execution environment of the first terminal device; decrypting the obtained first encryption information using the generated second key To obtain the first plaintext information; and in response to determining that the obtained first plaintext information is the same as the information to be encrypted, generating an instruction for It is described that the user identifier to be verified is the user identifier of the first terminal device, and a user identifier verification result; and in response to determining that the obtained first plaintext information is different from the to-be-encrypted information, generating an indication that the user identifier to be verified is not The non-user identification verification result of the user identification of the first terminal device.
  10. 根据权利要求8或9所述的终端设备,其中,厂商标识的取值范围不同于产品标识的取值范围,并且所述终端设备包括未设置可信执行环境的第二终端设备,所述第二终端设备响应于检测到用户输入的注册成为目标应用和/或目标网站的用户的注册请求以及确定该第二终端设备未设置对应的用户验证信息密文,向对所述目标应用和/或所述目标网站提供支持的第一终端设备发送所述注册请求;The terminal device according to claim 8 or 9, wherein a value range of the vendor identification is different from a value range of the product identification, and the terminal device includes a second terminal device without a trusted execution environment, and the first The second terminal device responds to detecting a registration request entered by a user to register as a user of a target application and / or a target website, and determining that the second terminal device has not set a corresponding user authentication information ciphertext to the target application and / or Sending, by the first terminal device supported by the target website, the registration request;
    所述第一终端设备响应于接收到第二终端设备发送的注册请求,在该第一终端设备的可信执行环境中执行用户验证信息密文生成操作,得到用户验证信息密文,以及将所得到的用户验证信息密文发送给发送所收到的注册请求的第二终端设备,其中,所述用户验证信息密文生成操作包括:用该第一终端设备的可信执行环境中存储的当前用户序号与预设增量的和更新所述当前用户序号;利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对用户验证信息进行加密得到用户验证信息密文,其中,所述用户验证信息包括该第一终端设备的可信执行环境中存储的预设校验码、所述当前用户序号以及该第一终端设备的可信执行环境的环境标识;In response to receiving the registration request sent by the second terminal device, the first terminal device performs a user authentication information ciphertext generation operation in a trusted execution environment of the first terminal device, obtains the user authentication information ciphertext, and converts the The obtained user authentication information ciphertext is sent to the second terminal device that sends the received registration request, wherein the user authentication information ciphertext generation operation includes: using the current stored in the trusted execution environment of the first terminal device. Sum the user serial number and a preset increment to update the current user serial number; use the user authentication information key stored in the trusted execution environment of the first terminal device to encrypt the user authentication information to obtain the user authentication information ciphertext, where: The user verification information includes a preset check code stored in a trusted execution environment of the first terminal device, the current user serial number, and an environment identifier of the trusted execution environment of the first terminal device;
    所述第二终端设备响应于接收到第一终端设备发送的用户验证信息密文,将所收到的用户验证信息密文确定为该第二终端设备的用户验证信息密文;响应于检测到用户输入的包括第二用户标识类别标识且用于指示生成所述目标应用和/或所述目标网站的用户标识的第二用户标识生成指令,确定转密密钥,利用第二用户标识生成请求公钥对第二用户标识生成请求进行加密得到第二用户标识生成请求密文,以及将所得到的第二用户标识生成请求密文发送给对所述目标应用和/或所述目标网站提供支持的第一终端设备,其中,所述第二用户标识生成请求包括该第二终端设备的用户验证信息密文、所确定的转密密 钥和所述第二用户标识类别标识;In response to receiving the user authentication information ciphertext sent by the first terminal device, the second terminal device determines the received user authentication information ciphertext as the user authentication information ciphertext of the second terminal device; A second user ID generation instruction input by a user that includes a second user ID category ID and is used to instruct generation of the user ID of the target application and / or the target website, determines a transfer key, and generates a request using the second user ID The public key encrypts the second user ID generation request to obtain a second user ID generation request ciphertext, and sends the obtained second user ID generation request ciphertext to providing support for the target application and / or the target website The first terminal device, wherein the second user ID generation request includes the user authentication information ciphertext of the second terminal device, the determined transfer key, and the second user ID category ID;
    所述第一终端设备响应于接收到第二终端设备发送的第二用户标识生成请求密文,在该第一终端设备的可信执行环境中执行第二用户标识生成操作,得到与所收到的第二用户标识生成请求密文对应的转密用户标识,以及将所得到的转密用户标识发送给发送所收到的第二用户标识生成请求密文的第二终端设备;The first terminal device responds to receiving a second user identifier generation request ciphertext sent by the second terminal device, executes a second user identifier generation operation in a trusted execution environment of the first terminal device, and obtains the received and received The second user identifier generation request ciphertext corresponding to the ciphertext user identifier, and sending the obtained ciphertext user identifier to the second terminal device sending the received second user identifier generation request ciphertext;
    所述第二终端设备响应于接收到第一终端设备发送的且与所得到并发送给第一终端设备的第二用户标识生成请求密文对应的转密用户标识,用所得到的第二用户标识生成请求密文对应的第二用户标识生成请求中的转密密钥对所收到的转密用户标识进行解密,得到第二用户标识,以及将解密得到的第二用户标识添加到该第二终端设备的用户标识集合中。The second terminal device is responsive to receiving the encrypted user ID sent by the first terminal device and corresponding to the obtained second user ID generation request ciphertext and sent to the first terminal device, and uses the obtained second user The encryption key in the second user ID generation request corresponding to the ciphertext of the ID generation request decrypts the received encrypted user ID to obtain a second user ID, and adds the decrypted second user ID to the first The user identity of the second terminal device is in the set.
  11. 根据权利要求10所述的终端设备,其中,所述第二用户标识生成操作包括:用该第一终端设备的可信执行环境中存储的与所述第二用户标识生成请求公钥对应的第二用户标识生成请求私钥对所收到的第二用户标识生成请求密文进行解密得到用户验证信息密文、转密密钥和用户标识类别标识;利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对解密得到的用户验证信息密文进行解密,得到验证码、用户序号和环境标识;响应于确定解密得到的验证码与该第一终端设备的可信执行环境中存储的预设验证码相同且解密得到的环境标识与该第一终端设备的可信执行环境的环境标识相同,用第二厂商标识、第二产品标识、随机生成的随机数和解密得到的用户标识类别标识生成第二扩展用户标识,其中,所述第二厂商标识是根据该第一终端设备的可信执行环境的产品标识生成的,且所述第二厂商标识的取值范围、该第一终端设备的可信执行环境的产品标识的取值范围和该第一终端设备的可信执行环境的厂商标识的取值范围互不相同,所述第二产品标识为解密得到的用户序号;用该第一终端设备的可信执行环境中存储的用户标识密钥对所生成的第二扩展用户标识进行加密得到第二用户标识;用解密得到的转密密钥对所得到的第二用 户标识进行加密得到与所收到的第二用户标识生成请求密文对应的转密用户标识。The terminal device according to claim 10, wherein the second user identification generating operation comprises: using a first storage device corresponding to the second user identification generation request public key stored in a trusted execution environment of the first terminal device. The second user ID generation request private key decrypts the received second user ID generation request cipher text to obtain the user authentication information cipher text, the re-encryption key, and the user ID category identifier; using the trusted execution environment of the first terminal device The user verification information key stored in the decryption decrypts the user verification information ciphertext to obtain a verification code, a user serial number, and an environment identifier; and in response to determining that the decrypted verification code is in a trusted execution environment of the first terminal device The stored preset verification code is the same and the decrypted environment ID is the same as the environment ID of the trusted execution environment of the first terminal device. The second manufacturer ID, the second product ID, a randomly generated random number, and the decrypted user are used. The identification category identifier generates a second extended user identifier, where the second vendor identifier is based on the first terminal device. Generated by the product identification of the trusted execution environment, and the value range of the second vendor identification, the value range of the product identification of the trusted execution environment of the first terminal device, and the trusted execution environment of the first terminal device. The value range of the vendor ID is different from each other, and the second product ID is the user serial number obtained by decryption; the second extended user ID generated by using the user ID key pair stored in the trusted execution environment of the first terminal device Encrypting to obtain the second user identity; using the decryption transfer key to encrypt the obtained second user identity to obtain the turn-key user identity corresponding to the received second user identity generation request ciphertext.
  12. 根据权利要求10所述的终端设备,其中,所述第二用户标识生成操作包括:The terminal device according to claim 10, wherein the second user identifier generating operation comprises:
    在生成所述第二用户标识的同时,生成被所述转密密钥加密的公钥以及能够由预先设定的系统安全词、由用户预先配置的用户安全词和所述第二用户标识推导出的私钥。While generating the second user ID, generate a public key encrypted by the turn-key and a system security word that can be set in advance, a user security word that is pre-configured by the user, and the second user ID. Out the private key.
  13. 根据权利要求10所述的终端设备,其中,所述第一终端设备的厂商标识大于等于第一预设正整数且小于等于所述第一预设正整数与第二预设正整数之和,所述第一终端设备的产品标识大于所述第二预设正整数且小于所述第一预设正整数,所述第一预设正整数大于所述第二预设正整数。The terminal device according to claim 10, wherein the manufacturer identification of the first terminal device is greater than or equal to a first preset positive integer and less than or equal to a sum of the first preset positive integer and a second preset positive integer, The product identifier of the first terminal device is greater than the second preset positive integer and smaller than the first preset positive integer, and the first preset positive integer is greater than the second preset positive integer.
  14. 根据权利要求13所述的终端设备,其中,所述第二厂商标识是根据该第一终端设备的可信执行环境的产品标识生成的,包括:The terminal device according to claim 13, wherein the second vendor identification is generated based on a product identification of a trusted execution environment of the first terminal device, comprising:
    所述第二厂商标识是该第一终端设备的可信执行环境的产品标识与所述第一预设正整数之和。The second vendor identification is a sum of a product identification of the trusted execution environment of the first terminal device and the first preset positive integer.
  15. 根据权利要求14所述的终端设备,其中,第一终端设备的厂商标识和产品标识均为四字节无符号整数,所述第一预设正整数的十六进制表示为0x80000000,所述第二预设正整数的十六进制表示为0x000000FF。The terminal device according to claim 14, wherein the manufacturer identification and product identification of the first terminal device are four-byte unsigned integers, and a hexadecimal representation of the first preset positive integer is 0x80000000, and the The hexadecimal representation of the second preset positive integer is 0x000000FF.
  16. 根据权利要求10所述的终端设备,其中,所述第一终端设备响应于接收到所述服务器发送的用户标识验证信息密文,在该第一终端设备的可信执行环境中执行验证信息生成操作,得到与所收到的用户标识验证信息密文对应的验证信息,以及将所得到的验证信息发送给所述服务器,其中,所述验证信息生成操作包括:利用该第一终端 设备的可信执行环境中存储的用户标识验证信息密钥对中的用户标识验证信息私钥对所收到的用户标识验证信息密文进行解密,得到用户标识验证信息;响应于确定该第一终端设备的可信执行环境的环境标识属于解密得到的用户标识验证信息中的允许解密环境标识集合,将解密得到的用户标识验证信息中的待验证信息确定为与所收到的用户验证信息密文对应的验证信息。The terminal device according to claim 10, wherein, in response to receiving the ciphertext of the user identification verification information sent by the server, the first terminal device performs verification information generation in a trusted execution environment of the first terminal device. Operation to obtain authentication information corresponding to the received ciphertext of the user identification authentication information, and send the obtained authentication information to the server, wherein the operation of generating the authentication information includes: using the available information of the first terminal device; The user identification verification information private key in the user identification verification information key pair stored in the letter execution environment decrypts the received user identification verification information ciphertext to obtain the user identification verification information; in response to determining the first terminal device's The environment identifier of the trusted execution environment belongs to the set of environment identifiers allowed to be decrypted in the user identification verification information obtained by decryption, and the information to be verified in the decrypted user identification verification information is determined to correspond to the received ciphertext of the user authentication information. verify message.
  17. 根据权利要求16所述的终端设备,其中:The terminal device according to claim 16, wherein:
    第一终端设备响应于检测到包括接收方用户标识集合和待加密信息的信息加密请求,在该第一终端设备的可信执行环境中执行信息加密操作,得到与所述信息加密请求对应的信息密文,其中,所述信息加密操作包括:用所述接收方用户标识集合中的每个接收方用户标识对应的接收方环境标识生成接收方环境标识集合,其中,接收方环境标识是用该第一终端设备的可信执行环境中存储的用户标识密钥对接收方用户标识进行解密所得到的接收方扩展用户中的环境标识;用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息公钥对所述接收方环境标识集合和所述待加密信息进行加密,得到与所述信息加密请求对应的信息密文;The first terminal device, in response to detecting an information encryption request including a receiver user identification set and information to be encrypted, performs an information encryption operation in a trusted execution environment of the first terminal device to obtain information corresponding to the information encryption request. The ciphertext, wherein the information encryption operation includes: generating a receiver environment identifier set by using a receiver environment identifier corresponding to each receiver user identifier in the receiver user identifier set, wherein the receiver environment identifier is obtained by using the receiver environment identifier The environment identifier in the extended user of the receiver obtained by decrypting the user identifier of the receiver in the user identification key stored in the trusted execution environment of the first terminal device; using the orientation stored in the trusted execution environment of the first terminal device The directional information public key in the information key pair encrypts the receiver's environmental identity set and the information to be encrypted to obtain the information ciphertext corresponding to the information encryption request;
    第一终端设备响应于检测到包括待解密信息密文的第一信息解密请求,在该第一终端设备的可信执行环境中执行第一信息解密操作,得到与所述第一信息解密请求对应的信息明文,其中,所述第一信息解密操作包括:利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所述第一信息解密请求中的待解密信息密文进行解密,得到第一接收方环境标识集合和第一信息明文;响应于确定该第一终端设备的可信执行环境的环境标识属于所述第一接收方环境标识集合,将所述第一信息明文确定为与所述第一信息解密请求对应的信息明文;In response to detecting the first information decryption request including the ciphertext of the information to be decrypted, the first terminal device executes the first information decryption operation in the trusted execution environment of the first terminal device to obtain a response corresponding to the first information decryption request. Clear information, wherein the first information decryption operation includes: using the private information private key of the private information key pair stored in the trusted execution environment of the first terminal device to decrypt the first information in the request. The ciphertext of the information to be decrypted is decrypted to obtain the first receiver environmental identifier set and the first information plaintext; and in response to determining that the environment identifier of the trusted execution environment of the first terminal device belongs to the first receiver environmental identifier set, The first information plaintext is determined to be the information plaintext corresponding to the first information decryption request;
    第二终端设备响应于检测到包括待解密信息密文的第二信息解密请求,确定转密密钥;将第二转密指令利用定向信息密钥对中的定向信息公钥进行加密,得到第二转密指令密文,其中,所述第二转密指 令包括该第二终端设备的用户验证信息和所确定的转密密钥;将所得到的第二转密指令密文和所述第二信息解密请求中的待解密信息密文作为信息转密请求发送给对所述目标应用和/或所述目标网站提供支持的第一终端设备;The second terminal device determines a transfer key in response to detecting the second information decryption request including the ciphertext of the information to be decrypted; encrypts the second transfer key instruction using the public key of the directed information in the directed information key pair to obtain the first A second ciphertext instruction ciphertext, wherein the second ciphertext instruction includes user authentication information of the second terminal device and the determined cipherkey; the obtained second ciphertext instruction ciphertext and the first The ciphertext of the information to be decrypted in the second information decryption request is sent as an information transfer request to the first terminal device that provides support for the target application and / or the target website;
    第一终端设备响应于接收到第二终端设备发送的信息转密请求,在该第一终端设备的可信执行环境中执行信息转密操作,得到与所收到的信息转密请求对应的转密信息,以及将所得到的转密信息发送给发送所收到的信息转密请求的第二终端设备;The first terminal device, in response to receiving the information transfer request sent by the second terminal device, executes the information transfer operation in the trusted execution environment of the first terminal device, and obtains a transfer corresponding to the received information transfer request. Confidential information, and sending the obtained re-encrypted information to the second terminal device that sends the received information re-encryption request;
    第二终端设备响应于接收到第一终端设备发送的转密信息,其中,所收到的转密信息对应与针对所检测到的第二信息解密请求所生成并发送的信息转密请求,利用所检测到的第二信息解密请求中的转密密钥对收到的转密信息进行解密得到信息明文。The second terminal device is responsive to receiving the turn-key information sent by the first terminal device, where the received turn-key information corresponds to the information turn-key request generated and sent for the detected second information decryption request, using the The detected encryption key in the second information decryption request decrypts the received encryption code to obtain the information plaintext.
  18. 根据权利要求17所述的终端设备,其中,所述信息转密操作包括:利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所收到的信息转密请求中的第二转密指令密文进行解密,得到用户验证信息和转密密钥;利用该第一终端设备的可信执行环境中存储的用户验证信息密钥对解密得到的用户验证信息进行解密,得到验证码、用户序号和环境标识;响应于确定解密得到的环境标识与该第一终端设备的可信执行环境的环境标识相同且解密得到的验证码与该第一终端设备的可信执行环境中存储的预设验证码相同,利用该第一终端设备的可信执行环境中存储的定向信息密钥对中的定向信息私钥对所收到的信息转密请求中的信息密文进行解密,得到第二接收方环境标识集合和第二信息明文;响应于确定第二环境标识属于解密得到的第二接收方环境标识集合,利用解密得到的转密密钥对解密得到的第二信息明文进行加密,得到与所收到的信息转密请求对应的转密信息,其中,所述第二环境标识中的厂商标识是根据该第一终端设备的可信执行环境的产品标识所生成的第二厂商标识,所述第二环境标识中的产品标识是解密所得到的用户序号。The terminal device according to claim 17, wherein the information transfer operation comprises using the received private key pair of the directed information in the directed information key pair stored in the trusted execution environment of the first terminal device. Decrypt the second ciphertext instruction ciphertext in the information cipher request to obtain user authentication information and cipher key; use the user authentication information key stored in the trusted execution environment of the first terminal device to decrypt the user The verification information is decrypted to obtain a verification code, a user serial number, and an environmental identifier; in response to determining that the decrypted environmental identifier is the same as the environmental execution identifier of the trusted execution environment of the first terminal device and the decrypted verification code is the same as the first terminal device The preset verification code stored in the trusted execution environment of the same is used, and the private message of the directed information private key pair in the directed information key pair stored in the trusted execution environment of the first terminal device is used to The information ciphertext is decrypted to obtain the second receiver environment identifier set and the second information plaintext; in response to determining that the second environment identifier belongs to the decrypted The second receiver's environment identifier set, encrypts the decrypted second information plaintext by using the decryption transfer key, and obtains the transfer information corresponding to the received information transfer request, wherein the second environment identifier The manufacturer identifier in the second identifier is a second manufacturer identifier generated according to the product identifier of the trusted execution environment of the first terminal device, and the product identifier in the second environment identifier is a user serial number obtained by decryption.
  19. 一种用于处理用户信息的服务器,包括:A server for processing user information, including:
    处理器;以及Processor; and
    存储器,所述存储器存储有机器可读指令,所述机器可读指令能够由所述处理器运行以执行以下操作:A memory that stores machine-readable instructions that can be executed by the processor to perform the following operations:
    响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储;以及In response to receiving the user information adding request sent by the terminal device, storing the user identification, user information, and encryption mark in the received user information adding request in a corresponding manner; and
    响应于接收到终端设备发送的用户信息转密请求,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;在所述服务器的可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。In response to receiving the user information transfer request sent by the terminal device, query the user information and the encryption token corresponding to the user identification in the received user information transfer request; in the trusted execution environment of the server, execute the user The information transfer operation obtains the transfer user information corresponding to the received user information transfer request, and sends the obtained transfer user information to the terminal device that sends the received user information transfer request.
  20. 根据权利要求19所述的服务器,其中,所述用户信息转密操作包括:利用所述服务器的可信执行环境中存储的与所述转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用所述服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。The server according to claim 19, wherein the operation of transferring user information is performed by using a private key of the private key corresponding to the public key of the private key stored in the trusted execution environment of the server, The first encryption instruction in the received user information encryption request is decrypted to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the trusted execution of the server is used The encryption key stored in the environment uses the key to decrypt the decrypted ciphertext key to obtain the plaintext key; the decrypted plaintext key is used to decrypt the found user information to obtain the user information plaintext; in response to determining the lookup The obtained encryption mark is an unencrypted mark, and the found user information is determined to be the plaintext of the user information; the decrypted transfer key is used to encrypt the plaintext of the obtained user information to obtain a request to transfer the encrypted information with the received user information. Corresponding encrypted user information.
  21. 根据权利要求19所述的服务器,其中,响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,包括:The server according to claim 19, wherein in response to receiving the user information adding request sent by the terminal device, storing the user identifier, user information, and encryption mark in the received user information adding request in a corresponding manner, comprising:
    所述服务器,被配置成:响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储。The server is configured to, in response to receiving the user information addition request sent by the terminal device, store the user identification, the user information range identification, the user information, and the encryption mark in the received user information addition request in a corresponding manner.
  22. 根据权利要求21所述的服务器,其中,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记,包括:The server according to claim 21, wherein querying the user information and the encryption token corresponding to the user ID in the received user information transfer request includes:
    所述服务器,被配置成:查询与所收到的用户信息转密请求中的用户标识和用户信息范围标识对应的用户信息和加密标记。The server is configured to query the user information and the encryption token corresponding to the user identifier and the user information range identifier in the received user information transfer request.
  23. 根据权利要求19所述的服务器,其中,所述机器可读指令能够由所述处理器运行以执行以下操作:The server of claim 19, wherein the machine-readable instructions are executable by the processor to perform the following operations:
    响应于接收到包括待验证用户标识的终端用户标识验证请求,在所述服务器的可信执行环境中执行用户标识验证信息密文生成操作,得到与所述终端用户标识验证请求对应的用户标识验证信息密文,以及将所得到的用户标识验证信息密文发送给发送所收到的终端用户标识验证请求的第一终端设备,其中,所述用户标识验证信息密文生成操作包括:用所述服务器的可信执行环境中存储的用户标识密钥对所收到的待验证用户标识进行解密,得到待验证扩展用户标识;生成包括允许解密环境标识集合和待验证信息的用户标识验证信息,将所述待验证扩展用户标识中的环境标识添加到所生成的用户标识验证信息中的允许解密环境标识集合中;利用所述服务器的可信执行环境中存储的用户标识验证信息密钥对中的用户标识验证信息公钥对所生成的用户标识验证信息进行加密,得到与所述终端用户标识验证请求对应的用户标识验证信息密文;以及In response to receiving an end user identity verification request including a user identity to be verified, a user identity verification information ciphertext generation operation is performed in a trusted execution environment of the server to obtain a user identity verification corresponding to the end user identity verification request Information ciphertext, and sending the obtained user identification verification information ciphertext to the first terminal device that sends the received end user identification verification request, wherein the operation of generating the user identification verification information ciphertext includes: using the The user identification key stored in the trusted execution environment of the server decrypts the received user identification to be verified, and obtains the extended user identification to be verified; generates user identification verification information including a set of permission to decrypt the environment identification and the information to be verified, and The environment identifier in the extended user identifier to be verified is added to the set of permitted environment identifiers in the generated user identifier verification information; and the user identifier verification information key pair stored in the trusted execution environment of the server is used. User ID verification information public key pair generated user ID verification Information is encrypted, the user's identity authentication information to the ciphertext verification request corresponding to the user identification; and
    响应于接收到第一终端设备发送的与所发送的用户标识验证信息密文对应的验证信息,其中,所发送的用户标识验证信息密文与所述服务器收到的终端用户标识验证请求对应,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同;响应于确定相同,生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果;响应于确定不相同,生成用于指示所收到的终端用户标识验证请求验证不通过的终端用户验证不通过结果。In response to receiving authentication information corresponding to the sent user identification verification information ciphertext sent by the first terminal device, wherein the sent user identification verification information ciphertext corresponds to an end user identity verification request received by the server, Determine whether the received authentication information is the same as the to-be-verified information in the user identification authentication information corresponding to the ciphertext of the user identification authentication information sent; and in response to the determination, generate the instruction for instructing the received end user identification authentication request for authentication The passed end-user verification pass result; in response to the determination being different, an end-user verification failure result used to indicate that the received end-user identity verification request verification fails.
  24. 根据权利要求23所述的服务器,其中,所述服务器为支持 OAuth2协议的资源服务器。The server according to claim 23, wherein the server is a resource server supporting the OAuth2 protocol.
  25. 一种用于处理用户信息的方法,应用于用于处理用户信息的系统中的服务器,所述用于处理用户信息的系统包括至少一个终端设备和服务器,所述服务器设置可信执行环境,所述方法包括:A method for processing user information is applied to a server in a system for processing user information. The system for processing user information includes at least one terminal device and a server. The server sets a trusted execution environment. The methods include:
    响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,其中,加密标记为用于表征用户信息添加请求中的用户信息为加密后的用户信息密文的已加密标记或者用于表征用户信息添加请求中的用户信息为未进行加密的用户信息明文的未加密标记;In response to receiving the user information adding request sent by the terminal device, the user identification, user information, and encryption mark in the received user information adding request are correspondingly stored, where the encryption mark is used to characterize the user in the user information adding request The information is an encrypted mark of the encrypted user information ciphertext or an unencrypted mark used to characterize the user information in the user information addition request as the plaintext of the unencrypted user information;
    响应于接收到终端设备发送的用户信息转密请求,其中,所述用户信息转密请求包括用户标识和第一转密指令,查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记;In response to receiving a user information transfer request sent by the terminal device, wherein the user information transfer request includes a user identification and a first transfer instruction, query for a user ID corresponding to the received user information transfer request User information and encryption tokens;
    在所述可信执行环境中,执行用户信息转密操作,得到与所收到的用户信息转密请求对应的转密用户信息,以及将所得到的转密用户信息发送给发送所收到的用户信息转密请求的终端设备。In the trusted execution environment, a user information transfer operation is performed to obtain the transfer user information corresponding to the received user information transfer request, and the obtained transferred user information is sent to the sender. Terminal device for user information transfer request.
  26. 根据权利要求25所述的方法,其中,所述用户信息转密操作包括:利用所述服务器的可信执行环境中存储的与所述转密指令公钥对应的转密指令私钥,对所接收到的用户信息转密请求中的第一转密指令进行解密,得到密文密钥和转密密钥;响应于确定查找到的加密标记为已加密标记,利用所述服务器的可信执行环境中存储的加密密钥用密钥对解密得到的密文密钥进行解密得到明文密钥;利用解密得到的明文密钥对查找到的用户信息进行解密,得到用户信息明文;响应于确定查找到的加密标记为未加密标记,将查找到的用户信息确定为用户信息明文;利用解密得到的转密密钥对所得到的用户信息明文进行加密,得到与所收到的用户信息转密请求对应的转密用户信息。The method according to claim 25, wherein the user information transfer encryption operation comprises: using a transfer secret instruction private key corresponding to the transfer secret instruction public key stored in a trusted execution environment of the server, to exchange all The first encryption instruction in the received user information encryption request is decrypted to obtain the ciphertext key and the encryption key; in response to determining that the found encryption token is an encrypted token, the trusted execution of the server is used The encryption key stored in the environment uses the key to decrypt the decrypted ciphertext key to obtain the plaintext key; the decrypted plaintext key is used to decrypt the found user information to obtain the user information plaintext; in response to determining the lookup The obtained encryption mark is an unencrypted mark, and the found user information is determined to be the plaintext of the user information; the decrypted transfer key is used to encrypt the plaintext of the obtained user information to obtain a request to transfer the encrypted information with the received user information. Corresponding encrypted user information.
  27. 根据权利要求25所述的方法,其中,用户信息添加请求还包括用户信息范围标识;以及The method according to claim 25, wherein the user information adding request further comprises a user information range identifier; and
    所述响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息和加密标记对应存储,包括:In response to receiving the user information addition request sent by the terminal device, storing the user identifier, user information, and encryption mark in the received user information addition request in a corresponding manner includes:
    响应于接收到终端设备发送的用户信息添加请求,将所收到的用户信息添加请求中的用户标识、用户信息范围标识、用户信息和加密标记对应存储。In response to receiving the user information addition request sent by the terminal device, the user identifier, the user information range identifier, the user information, and the encryption mark in the received user information addition request are correspondingly stored.
  28. 根据权利要求27所述的方法,其中,用户信息转密请求还包括用户信息范围标识;以及The method according to claim 27, wherein the user information transfer request further comprises a user information range identifier; and
    所述查询与所收到的用户信息转密请求中的用户标识对应的用户信息和加密标记,包括:The querying the user information and the encryption mark corresponding to the user identifier in the received user information transfer request includes:
    查询与所收到的用户信息转密请求中的用户标识和用户信息范围标识对应的用户信息和加密标记。Query the user information and encryption mark corresponding to the user ID and user information range ID in the received user information transfer request.
  29. 根据权利要求28所述的方法,其中,所述方法还包括:The method according to claim 28, wherein the method further comprises:
    响应于接收到设置可信执行环境的终端设备发送的包括待验证用户标识的终端用户标识验证请求,在所述可信执行环境中执行用户标识验证信息密文生成操作,得到与所述终端用户标识验证请求对应的用户标识验证信息密文,以及将所得到的用户标识验证信息密文发送给发送所收到的终端用户标识验证请求的终端设备,其中,所述用户标识验证信息密文生成操作包括:用所述可信执行环境中存储的用户标识密钥对所收到的待验证用户标识进行解密,得到待验证扩展用户标识;生成包括允许解密环境标识集合和待验证信息的用户标识验证信息,将所述待验证扩展用户标识中的环境标识添加到所生成的用户标识验证信息中的允许解密环境标识集合中;利用所述可信执行环境中存储的用户标识验证信息密钥对中的用户标识验证信息公钥对所生成的用户标识验证信息进行加密,得到与所述终端用户标识验证请求对应的用户标识验证信息密文;In response to receiving an end user identity verification request including a user identity to be verified and sent by a terminal device that sets up a trusted execution environment, a user identity verification information ciphertext generation operation is performed in the trusted execution environment to obtain a connection with the end user. The user identification verification information ciphertext corresponding to the identification verification request, and sending the obtained user identification verification information ciphertext to the terminal device sending the received end user identification verification request, wherein the user identification verification information ciphertext is generated The operation includes: decrypting the received user identifier to be verified using the user identifier key stored in the trusted execution environment to obtain the extended user identifier to be verified; and generating a user identifier including a set of environment identifiers to be decrypted and information to be verified Authentication information, adding the environment identifier in the extended user identifier to be verified to the set of allowed environment identifiers in the generated user identifier authentication information; using the user identifier authentication information key pair stored in the trusted execution environment User ID authentication information public key pair generated user ID Authentication information is encrypted, and the user identification to obtain user authentication information corresponding to the request identification verification ciphertext;
    响应于接收到设置可信执行环境的终端设备发送的与所发送的用户标识验证信息密文对应的验证信息,其中,所发送的用户标识验证 信息密文与所收到的终端用户标识验证请求对应,确定所收到的验证信息是否与所发送的用户标识验证信息密文对应的用户标识验证信息中的待验证信息相同;In response to receiving the authentication information corresponding to the sent user identification verification information ciphertext sent by the terminal device setting the trusted execution environment, wherein the sent user identification verification information ciphertext and the received end user identification verification request Correspondingly, it is determined whether the received authentication information is the same as the to-be-verified information in the user identification verification information corresponding to the ciphertext of the user identification verification information sent;
    响应于确定相同,生成用于指示所收到的终端用户标识验证请求验证通过的终端用户验证通过结果;In response to determining that they are the same, generating an end-user verification pass result indicating that the received end-user identity verification request verification has passed;
    响应于确定不相同,生成用于指示所收到的终端用户标识验证请求验证不通过的终端用户验证不通过结果。In response to determining that they are not the same, an end user authentication failure result is generated to indicate that the received end user identity authentication request authentication failed.
  30. 根据权利要求29所述的方法,其中,所述服务器为支持OAuth2协议的资源服务器。The method according to claim 29, wherein the server is a resource server supporting the OAuth2 protocol.
  31. 一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序被一个或多个处理器执行时实现如权利要求25-30中任一所述的方法。A computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by one or more processors, implements the method of any one of claims 25-30.
PCT/CN2019/099943 2018-09-05 2019-08-09 System and method for processing user information WO2020048289A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811030446.3 2018-09-05
CN201811030446.3A CN110881015B (en) 2018-09-05 2018-09-05 System and method for processing user information

Publications (1)

Publication Number Publication Date
WO2020048289A1 true WO2020048289A1 (en) 2020-03-12

Family

ID=69722970

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/099943 WO2020048289A1 (en) 2018-09-05 2019-08-09 System and method for processing user information

Country Status (2)

Country Link
CN (1) CN110881015B (en)
WO (1) WO2020048289A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064757B (en) * 2020-03-18 2020-06-19 腾讯科技(深圳)有限公司 Application access method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070189517A1 (en) * 2004-12-20 2007-08-16 International Business Machines Corporation Pseudo public key encryption
CN101388774A (en) * 2008-10-24 2009-03-18 焦点科技股份有限公司 Method for automatically authenticate and recognize customer identity between different customers and login
CN104980397A (en) * 2014-04-03 2015-10-14 腾讯科技(深圳)有限公司 Instant messaging method, system and terminal
CN105391677A (en) * 2014-09-09 2016-03-09 宇龙计算机通信科技(深圳)有限公司 Information transmission method and mobile terminal
CN106330862A (en) * 2016-08-10 2017-01-11 武汉信安珞珈科技有限公司 Secure transmission method and system for dynamic password

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120089481A1 (en) * 2009-11-24 2012-04-12 Chain Reaction Ecommerce, Inc. Securing sensitive information with a trusted proxy frame
US10298545B2 (en) * 2013-09-12 2019-05-21 International Business Machines Corporation Secure processing environment for protecting sensitive information
CN106454528A (en) * 2015-08-07 2017-02-22 阿里巴巴集团控股有限公司 Service processing method based on trusted execution environment and client side
CN105516104B (en) * 2015-12-01 2018-10-26 神州融安科技(北京)有限公司 A kind of auth method and system of the dynamic password based on TEE
CN106878231A (en) * 2015-12-10 2017-06-20 中国电信股份有限公司 Method, user terminal and system for realizing secure user data transmission
CN108076011A (en) * 2016-11-10 2018-05-25 中国移动通信有限公司研究院 A kind of credible performing environment data migration method and device
CN107592308B (en) * 2017-09-13 2021-03-30 西安电子科技大学 Double-server multi-factor authentication method oriented to mobile payment scene
CN108156143A (en) * 2017-12-14 2018-06-12 上海格尔安全科技有限公司 Safety communicating method between Android application programs based on credible performing environment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070189517A1 (en) * 2004-12-20 2007-08-16 International Business Machines Corporation Pseudo public key encryption
CN101388774A (en) * 2008-10-24 2009-03-18 焦点科技股份有限公司 Method for automatically authenticate and recognize customer identity between different customers and login
CN104980397A (en) * 2014-04-03 2015-10-14 腾讯科技(深圳)有限公司 Instant messaging method, system and terminal
CN105391677A (en) * 2014-09-09 2016-03-09 宇龙计算机通信科技(深圳)有限公司 Information transmission method and mobile terminal
CN106330862A (en) * 2016-08-10 2017-01-11 武汉信安珞珈科技有限公司 Secure transmission method and system for dynamic password

Also Published As

Publication number Publication date
CN110881015A (en) 2020-03-13
CN110881015B (en) 2021-10-01

Similar Documents

Publication Publication Date Title
US10554420B2 (en) Wireless connections to a wireless access point
US10122692B2 (en) Handshake offload
US8825999B2 (en) Extending encrypting web service
US11329962B2 (en) Pluggable cipher suite negotiation
JP4907895B2 (en) Method and system for recovering password-protected private data over a communication network without exposing the private data
US9973481B1 (en) Envelope-based encryption method
CN110249336B (en) Addressing trusted execution environments using signing keys
JP2020506612A (en) Addressing to a trusted execution environment using an encryption key
US10021077B1 (en) System and method for distributing and using signed send tokens
US10122689B2 (en) Load balancing with handshake offload
US10007797B1 (en) Transparent client-side cryptography for network applications
US11477192B2 (en) Personalized security system
US10764294B1 (en) Data exfiltration control
CN110235134B (en) Addressing trusted execution environments using clean room provisioning
US11218317B1 (en) Secure enclave implementation of proxied cryptographic keys
EP4096160A1 (en) Shared secret implementation of proxied cryptographic keys
WO2022033350A1 (en) Service registration method and device
WO2020048289A1 (en) System and method for processing user information
US11804957B2 (en) Exporting remote cryptographic keys
CN110879876A (en) System and method for issuing certificates
JP2022528366A (en) Computer systems and methods including the HTML browser approval approach
CN117354021A (en) Encryption and decryption method, device, equipment, storage medium and product in data transmission
CN117061248A (en) Data security protection method and device for data sharing

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: 19857564

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: 19857564

Country of ref document: EP

Kind code of ref document: A1