Information interaction method, device, electronic device and computer readable storage medium
By transmitting attribute information between devices to determine the target identity and generating the target key, the leakage problem during information interaction is solved, ensuring the security of information interaction.
Patent Information
- Application Number
- CN201911380120.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-27
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2039-12-27
AI Technical Summary
During the information interaction between devices, the information may be leaked to the third device, resulting in security problems.
By transmitting attribute information between the first device and the second device, a target identity identification is determined and a target key is generated based on the identity identification to ensure the security of information interaction.
Through the transmission of attribute information, both the first device and the second device hold the same target identity identification, so that information interaction is performed based on the target key generated by the target identity identification, and the security of the information interaction is protected.
Smart Images

Figure CN113055351B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an information interaction method, device, electronic device and computer-readable storage medium. Background Art
[0002] With the development of communication technology, more and more devices are communicating with each other. In practice, since the information to be interacted may be leaked to other third devices other than the devices participating in the communication, it is necessary to provide an information interaction method to ensure the security of the information interaction. Summary of the invention
[0003] The embodiments of the present application provide a method, device, equipment and storage medium for information interaction to ensure the security of information interaction. The technical solution is as follows:
[0004] In a first aspect, a method for information interaction is provided, the method comprising: a second device receives attribute information sent by a first device, the attribute information being used to indicate a target identity, and then the second device determines the target identity according to the attribute information, and generates a target key based on the target identity, so that the second device can perform information interaction with the first device through the generated target key.
[0005] By transmitting the attribute information, the first device and the second device can both hold the same target identity. Therefore, the first device and the second device can exchange information based on the target key generated by the target identity, thereby protecting the security of the information exchange.
[0006] In an exemplary embodiment, the first device and the second device both store an identity list, the identity list includes multiple reference identities, the attribute information includes a sequence value of the target identity in the identity list, and determining the target identity according to the attribute information includes:
[0007] Read the reference identity corresponding to the sequence value in the identity list;
[0008] The reference identity corresponding to the sequence value is used as the target identity.
[0009] In an exemplary embodiment, generating a target key based on the target identity includes:
[0010] Acquire an updated identity based on the target identity;
[0011] The target key is generated based on the updated identity.
[0012] In an exemplary embodiment, the acquiring an updated identity based on the target identity includes:
[0013] In response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has been revoked, sending an update request to the first device, and receiving updated attribute information sent by the first device based on the update request;
[0014] The updated identity is obtained according to the updated attribute information.
[0015] In an exemplary embodiment, the acquiring an updated identity based on the target identity includes:
[0016] In response to the revocation indication bit corresponding to the target identity indicating that the target identity is not revoked, detecting a leakage probability of the target identity;
[0017] In response to detecting that the leakage probability is greater than a reference threshold, obtaining the updated identity.
[0018] In an exemplary embodiment, the attribute information includes a device identification of the third device, and the method further includes:
[0019] receiving an identity assigned by the third device, wherein the third device is used to assign identities to the first device and the second device according to the identity acquisition request sent by the first device;
[0020] The determining the target identity according to the attribute information includes: determining the identity assigned by the third device as the target identity according to the received device identity of the third device.
[0021] In an exemplary embodiment, before the second device receives the attribute information sent by the first device, the method further includes:
[0022] Receiving confirmation information of enabling the identity identifier sent by the first device, where the confirmation information is used to confirm whether to enable the identity identifier for information interaction;
[0023] In response to confirming that the identity identification is enabled, the second device receives the attribute information sent by the first device.
[0024] In an exemplary embodiment, generating a target key based on the target identity includes:
[0025] Get the reference key;
[0026] Calling a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm;
[0027] The target key is generated according to the hash value and the reference key.
[0028] In a second aspect, a method for information interaction is provided, the method comprising:
[0029] The first device obtains a target identity and determines attribute information of the target identity;
[0030] Sending the attribute information to a second device, where the second device is used to determine the target identity according to the attribute information;
[0031] A target key is generated based on the target identity, and information is exchanged with the second device through the target key.
[0032] In an exemplary embodiment, the first device and the second device both store an identity list, the identity list includes multiple reference identities, and the first device obtains a target identity and determines attribute information of the target identity, including:
[0033] Reading the identity list;
[0034] Determining a reference identity from a plurality of reference identities included in the identity list as the target identity;
[0035] The sequence value of the target identity in the identity list is determined as the attribute information.
[0036] In an exemplary embodiment, each reference identity corresponds to a revocation indication bit, and the revocation indication bit is used to indicate whether the reference identity is revoked. The step of determining a reference identity from a plurality of reference identities as the target identity includes:
[0037] According to the revocation indication bit, obtaining a reference identity identifier that has not been revoked from the multiple reference identity identifiers;
[0038] The target identity is determined from the non-revoked reference identities in a reference order.
[0039] In an exemplary embodiment, generating a target key based on the target identity includes:
[0040] Acquire an updated identity based on the target identity, and determine updated attribute information of the updated identity;
[0041] sending the updated attribute information to the second device;
[0042] The target key is generated based on the updated identity.
[0043] In an exemplary embodiment, the acquiring an updated identity based on the target identity includes:
[0044] In response to receiving an update request sent by the second device, the updated identity is obtained according to the update request, where the update request is used to indicate that the target identity in the second device has been revoked.
[0045] In an exemplary embodiment, the acquiring an updated identity based on the target identity includes:
[0046] Detecting a probability of leakage of the target identity;
[0047] In response to detecting that the leakage probability is greater than a reference threshold, obtaining the updated identity.
[0048] In an exemplary embodiment, the first device obtains a target identity and determines attribute information of the target identity, including:
[0049] The first device sends an identity allocation request to a third device, and the third device is used to allocate identities to the first device and the second device according to the identity allocation request;
[0050] Using the identity assigned by the third device as the target identity;
[0051] The device identification of the third device is used as the attribute information.
[0052] In an exemplary embodiment, before the first device acquires the target identity, the method further includes:
[0053] Sending confirmation information of enabling the identity identifier to the second device, where the confirmation information is used to confirm whether to enable the identity identifier for information interaction;
[0054] In response to the second device confirming that the identity identification is enabled, the first device acquires target identity information.
[0055] In an exemplary embodiment, generating a target key based on the target identity includes:
[0056] Get the reference key;
[0057] Calling a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm;
[0058] The target key is generated according to the hash value and the reference key.
[0059] In a third aspect, a device for information interaction is provided, the device comprising:
[0060] A receiving module, used for the second device to receive attribute information sent by the first device, wherein the attribute information is used to indicate a target identity;
[0061] A determination module, used to determine the target identity according to the attribute information;
[0062] A generating module, used for generating a target key based on the target identity;
[0063] An interaction module is used to interact with the first device through the target key.
[0064] In an exemplary embodiment, the first device and the second device both store an identity list, the identity list includes multiple reference identity identifiers, the attribute information includes a sequence value of the target identity identifier in the identity list, and the determination module is used to read the reference identity identifier corresponding to the sequence value in the identity list; and use the reference identity identifier corresponding to the sequence value as the target identity identifier.
[0065] In an exemplary embodiment, the generating module is used to obtain an updated identity based on the target identity; and generate the target key based on the updated identity.
[0066] In an exemplary embodiment, the generation module is used to send an update request to the first device in response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has been revoked, and receive updated attribute information sent by the first device based on the update request; and obtain the updated identity according to the updated attribute information.
[0067] In an exemplary embodiment, the generation module is used to detect the leakage probability of the target identity in response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has not been revoked; in response to detecting that the leakage probability is greater than a reference threshold, obtain the updated identity.
[0068] In an exemplary embodiment, the attribute information includes a device identification of a third device, and the method further includes: an allocation module, used to receive an identity identification allocated by the third device, and the third device is used to allocate an identity identification to the first device and the second device according to an identity identification acquisition request sent by the first device; the determination module is used to determine the identity identification allocated by the third device as the target identity identification based on the received device identification of the third device.
[0069] In an exemplary embodiment, the apparatus further includes: a confirmation module, configured to receive confirmation information of enabling the identity identifier sent by the first device, wherein the confirmation information is used to confirm whether the identity identifier is enabled for information interaction; in response to confirming that the identity identifier is enabled, executing the second device to receive attribute information sent by the first device.
[0070] In an exemplary embodiment, the generating module is used to obtain a reference key; call a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; and generate the target key according to the hash value and the reference key.
[0071] In a fourth aspect, a device for information interaction is provided, the device comprising:
[0072] An acquisition module, used for the first device to acquire a target identity and determine attribute information of the target identity;
[0073] A sending module, used to send the attribute information to a second device, and the second device is used to determine the target identity according to the attribute information;
[0074] A generation module is used to generate a target key based on the target identity, and to perform information exchange with the second device through the target key.
[0075] In an exemplary embodiment, the first device and the second device both store an identity list, the identity list includes multiple reference identities, and the acquisition module is used to read the identity list; determine a reference identity from the multiple reference identities included in the identity list as the target identity; and determine the sequence value of the target identity in the identity list as the attribute information.
[0076] In an exemplary embodiment, each reference identity corresponds to a revocation indication bit, and the revocation indication bit is used to indicate whether the reference identity is revoked. The acquisition module is used to obtain an unrevoked reference identity from the multiple reference identity identifiers according to the revocation indication bit; and determine the target identity from the unrevoked reference identity identifiers according to a reference order.
[0077] In an exemplary embodiment, the generation module is used to obtain an updated identity based on the target identity, determine updated attribute information of the updated identity; send the updated attribute information to the second device; and generate the target key based on the updated identity.
[0078] In an exemplary embodiment, the generating module is used to, in response to receiving an update request sent by the second device, obtain the updated identity according to the update request, wherein the update request is used to indicate that the target identity in the second device has been revoked.
[0079] In an exemplary embodiment, the generating module is used to detect a leakage probability of the target identity identifier; in response to detecting that the leakage probability is greater than a reference threshold, the updated identity identifier is acquired.
[0080] In an exemplary embodiment, the acquisition module is used for the first device to send an identity allocation request to a third device, and the third device is used to allocate identities to the first device and the second device according to the identity allocation request; the identity allocated by the third device is used as the target identity; and the device identity of the third device is used as the attribute information.
[0081] In an exemplary embodiment, the apparatus further includes: a confirmation module, configured to send confirmation information of enabling the identity identifier to the second device, wherein the confirmation information is used to confirm whether the identity identifier is enabled for information interaction; in response to the second device confirming that the identity identifier is enabled, executing the first device to obtain target identity information.
[0082] In an exemplary embodiment, the generating module is used to obtain a reference key; call a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; and generate the target key according to the hash value and the reference key.
[0083] In a fifth aspect, an electronic device is provided, comprising a memory and a processor; at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the method provided in the first aspect of the present application or any exemplary embodiment of the first aspect.
[0084] In a sixth aspect, an electronic device is provided, comprising a memory and a processor; at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the method provided in the second aspect of the present application or any one of the exemplary embodiments of the second aspect.
[0085] In a seventh aspect, a communication device is provided, the device comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals, and when the processor executes the instructions stored in the memory, the processor executes the method provided by the first aspect or any exemplary embodiment of the first aspect.
[0086] In an eighth aspect, a communication device is provided, the device comprising: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals, and when the processor executes the instructions stored in the memory, the processor executes the method provided by the second aspect or any exemplary embodiment of the second aspect.
[0087] Optionally, the number of the processors is one or more, and the number of the memories is one or more.
[0088] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0089] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips respectively. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.
[0090] In the ninth aspect, a communication system is provided, which includes the above-mentioned first device and second device, the first device is used to execute the method provided by the above-mentioned first aspect or any exemplary embodiment of the first aspect, and the second device is used to execute the apparatus provided by the above-mentioned second aspect or any exemplary embodiment of the second aspect.
[0091] In a tenth aspect, a computer program (product) is provided, wherein the computer program (product) comprises: a computer program code, and when the computer program code is executed by a computer, the computer executes the methods in the above aspects.
[0092] In an eleventh aspect, a readable storage medium is provided, which stores a program or instruction. When the program or instruction runs on a computer, the methods in the above aspects are executed.
[0093] In a twelfth aspect, a chip is provided, comprising a processor for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes the methods in the above aspects.
[0094] In the thirteenth aspect, a chip is provided, comprising: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the methods in the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0095] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;
[0096] Figure 2 A flowchart of the information interaction method provided in an embodiment of the present application;
[0097] Figure 3 A schematic diagram of an identity list provided in an embodiment of the present application;
[0098] Figure 4 A schematic diagram of equipment production provided for an embodiment of the present application;
[0099] Figure 5 A flow chart of a method for confirming whether to enable identity identification provided in an embodiment of the present application;
[0100] Figure 6 A schematic diagram of a process for generating a target key provided in an embodiment of the present application;
[0101] Figure 7 A schematic diagram of a flow chart for reference provided in the embodiments of the present application;
[0102] Figure 8 A schematic diagram of the structure of an information interaction device provided in an embodiment of the present application;
[0103] Fig. 9 A schematic diagram of the structure of an information interaction device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0104] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0105] The present application provides a method for information interaction, which can be applied to Figure 1 In the implementation environment shown. Figure 1In the embodiment, a first device 11 and a second device 12 are included. The first device 11 and the second device 12 are communicatively connected so that the first device 11 and the second device 12 can transmit information, thereby generating a target key for information interaction according to the transmitted information.
[0106] Among them, the first device 11 and the second device 12 can be any electronic product that can perform human-computer interaction with a user through one or more methods such as a keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as a personal computer (PC), a mobile phone, a smart phone, a personal digital assistant (PDA), a wearable device, a pocket PC (PPC), a tablet computer, a smart car machine, a smart TV, a smart speaker, etc.
[0107] Alternatively, the first device 11 and the second device 12 may each be a server, or a server cluster consisting of multiple servers, or a cloud computing service center.
[0108] Those skilled in the art should understand that the above-mentioned first device 11 and second device 12 are only examples, and other existing or future terminals or servers that are applicable to the present application should also be included in the protection scope of the present application and are included here by reference.
[0109] Based on the above Figure 1 The implementation environment shown in the figure, the embodiment of the present application provides a method for information interaction, which can be applied to Figure 1 In the first device and the second device in the implementation environment shown. Figure 2 , the method comprising:
[0110] Step 201: The first device obtains a target identity and determines attribute information of the target identity.
[0111] Among them, the first device is a device that can perform information interaction with the second device. In implementation, for two or more devices that need to perform information interaction, the initiator of the information interaction can be used as the first device. That is to say, if one of the two or more devices has communication information to be sent to other devices, the device with the communication information to be sent is the initiator of the information interaction. Therefore, the device with the communication information to be sent can be used as the first device, and one or more of the other devices other than the first device can be used as the second device, so that the first device can obtain the target identity and determine the attribute information of the target identity. Of course, this embodiment does not limit the method for determining the first device. For example, one device can be randomly designated as the above-mentioned first device among two or more devices, or two or more devices can be used as the first device in turn.
[0112] In an exemplary embodiment, both the first device and the second device store an identity list, which includes multiple reference identities, and the reference identities can be strings. Each reference identity can be in the form of an identification that can indicate the identity of the first device and the second device. The identification form that can indicate the identity of the first device and the second device means that by reading the reference identity, the device manufacturer to which the first device and the second device belong can be known. Figure 3 , Figure 3 The device in can refer to both the first device and the second device. Figure 3 It can be seen that both the first device and the second device are provided with a system on chip (SOC), and the identity list is stored in the SOC. The identity list includes multiple reference identities (IDs) such as reference identity 1, 2, ..., N, where N is a positive integer. This embodiment does not limit the value of N, and the value of N can be determined according to experience or actual needs.
[0113] Also, see Figure 4 In this embodiment, during the production stage of the first device and the second device, in a trusted and secure environment, an identity list including multiple reference identity identifiers may be stored (also referred to as "burned") in the first device and the second device. It should be noted that during the storage process, the order of multiple reference identity identifiers in the identity list stored in the first device and the second device may be the same or different. Next, the two situations where the order of multiple reference identity identifiers is the same and different are described respectively:
[0114] In the case where the order of the multiple reference identifiers stored in the first device and the second device is the same, the first device obtains the target identifier and determines the attribute information of the target identifier, including: reading the identifier list, determining a reference identifier as the target identifier from the multiple reference identifiers included in the identifier list, and determining the order value of the target identifier in the identifier list as the attribute information.
[0115] The first device can read the identity list from the SOC, thereby obtaining multiple reference identity identifiers included in the identity list. After that, a reference identity identifier can be determined from the multiple reference identity identifiers as the target identity identifier. For the determination method of determining a reference identity identifier from multiple reference identity identifiers, the first device can randomly determine from multiple reference identity identifiers, or can determine according to a reference order, and the reference order can be generated by manual setting or automatically generated by the device. In implementation, the first device can first confirm the current number of times the target identity identifier is determined according to the reference order, and then determine the target identity identifier from the reference order in combination with the number of confirmations. Taking the number of reference identity identifiers as 6 as an example, the reference order can be 1, 3, 5, 2, 4, 6. In response to the first device confirming that it is the third time to determine the target identity identifier according to the reference order, the fifth reference identity identifier can be selected from the identity list as the target identity identifier according to the third "5" in the reference order.
[0116] Alternatively, in an exemplary embodiment, each reference identity corresponds to a revocation indication bit, and the revocation indication bit is used to indicate whether the reference identity is revoked. Then the first device can also determine a reference identity from multiple reference identities in the following manner: according to the revocation indication bit, obtain a reference identity that has not been revoked from multiple reference identities. Determine the target identity from the reference identities that have not been revoked according to the reference order.
[0117] See also Figure 3 , the reference identity and the revocation indication bits have a one-to-one correspondence, and the total number of revocation indication bits is the same as the total number of reference identity. During the use of any reference identity, in response to the reference identity triggering a reference condition, the reference identity can be revoked. For example, the reference condition can be that the leakage probability of the reference identity is greater than the reference probability, then in response to the leakage probability of the reference identity being greater than the reference probability, the reference identity can be revoked, so that the reference identity cannot be used any more, thereby ensuring security.
[0118] Therefore, among the multiple reference identifiers included in the identifier list, there may be one or more revoked reference identifiers, and therefore it is necessary to first obtain one or more reference identifiers that have not been revoked from the multiple reference identifiers according to the revocation indication bit. Afterwards, a target identifier is determined from the one or more reference identifiers that have not been revoked according to the reference order. For the description of the reference order, please refer to the above and will not be repeated here. In addition, in the present embodiment, when the reference identifier does not correspond to the revocation indication bit, it can also be ensured that the determined target identifier is a reference identifier that has not been revoked in the first device. For example, a reference identifier can be first determined randomly or according to the reference order from multiple reference identifiers, and then it is queried whether the determined reference identifier has been revoked. In response to the query that the reference identifier has not been revoked, the reference identifier is used as the target identifier.
[0119] Regardless of which determination method is used to determine the target identity, since the target identity is one of the multiple reference identities in the identity list, the sequence value of the target identity in the identity list can be used as attribute information. For example, if the target identity is the third one from top to bottom in the identity list, the sequence value of the target identity is "3", and thus "3" can be determined as the attribute information of the target identity.
[0120] It should be noted that the essential purpose of determining the attribute information of the target identity in this embodiment is to uniquely and accurately indicate the determined target identity through the attribute information. Therefore, the first device only needs to send the attribute information to the second device without directly sending the target identity, and the second device can indirectly obtain the target identity based on the attribute information, and then interact with the first device based on the target identity, thereby ensuring the security of the information interaction. Among them, the process of the second device determining the target identity based on various attribute information will be explained later.
[0121] It can be seen that the attribute information only needs to be able to uniquely and accurately indicate the target identity. Therefore, in addition to the sequence value in the above description as the attribute information of the target identity, other descriptive information that can uniquely indicate the target identity can also be used as the attribute information. This embodiment does not limit the set descriptive information. For example, the descriptive information can be a hash value of the target identity. Among them, the hash value is the value obtained by converting the target identity through a hash algorithm. Since different identity identifiers correspond to different hash values, the hash value can uniquely and accurately indicate the target identity, so that the hash value can be used as the above description information.
[0122] In implementation, a description information may be set for each reference identity, and the description information of different reference identity may be different, and the reference identity and the description information may be stored in correspondence. Thus, after determining a reference identity as a target identity, the description information corresponding to the reference identity may be used as the attribute information of the target identity. Alternatively, the first device may not store the reference identity and the description information in correspondence, but after determining a reference identity used as a target identity, determine the description information corresponding to the reference identity, thereby using the determined description information as the attribute information.
[0123] In the case where the order of multiple reference identifiers stored in the first device and the second device is different, the first device can still first determine a reference identifier from the read identifier list as the target identifier in the process of obtaining the target identifier and determining the attribute information of the target identifier. The determination method can be found in the above description and will not be repeated here. After determining the target identifier, since the order of the multiple reference identifiers stored in the first device and the second device is different, the sequence value of the target identifier in the identifier list cannot be determined as the attribute information. Otherwise, a reference identifier determined by the second device based on the attribute information will be different from the target identifier determined by the first device, resulting in failure of information interaction between the first device and the second device. Therefore, other information that can be used to indicate the target identifier other than the sequence value is required as the attribute information of the target identifier. For example, the descriptive information (such as a hash value) that uniquely and accurately indicates the target identifier in the above description can be used as the descriptive information.
[0124] In an exemplary embodiment, in response to the fact that the above-mentioned identity list is not stored in the first device and the second device, the process of the first device acquiring the target identity and determining the attribute information of the target identity can also be implemented in the following manner: the first device sends an identity allocation request to the third device, and the third device is used to allocate identities to the first device and the second device according to the identity allocation request. The identity allocated by the third device is used as the target identity, and the device identity of the third device is used as the attribute information.
[0125] The third device may be a device that is trustworthy to both the first device and the second device. After receiving the identity allocation request sent by the first device, the third device may allocate the same identity to the first device and the second device in a secure and trustworthy transmission manner according to the identity allocation request. This embodiment does not limit the allocation order of the identity. For example, the third device may allocate the identity to the first device and the second device at the same time, or may allocate the identity to the first device and the second device in sequence.
[0126] During the allocation process, the third device may allocate the device identifier of the third device together with the identity identifier. Thus, after receiving the identity identifier, the first device can directly use the allocated identity identifier as the target identity identifier and the device identifier of the third device as the attribute information. Alternatively, in response to the third device not allocating the device identifier of the third device together with the identity identifier, the first device can also query the device identifier of the sending device of the identity identifier (i.e., the third device) after receiving the identity identifier allocated by the third device, thereby obtaining the identity identifier of the third device. In addition, after the first device receives the identity identifier allocated by the third device, it can also query whether the allocated identity identifier has been revoked, thereby avoiding the allocated identity identifier being an identity identifier that has been used before and has a high probability of leakage. In response to the query that the allocated identity identifier has not been revoked, the allocated identity identifier is used as the target identity identifier.
[0127] In an exemplary embodiment, see Figure 5 In steps 501-503 of the embodiment, before the first device acquires the target identity, the method provided in this embodiment further includes: the first device sends confirmation information of enabling the identity to the second device, and the confirmation information is used to confirm whether to enable the identity for information interaction. In response to the second device confirming to enable the identity, the first device acquires the target identity information. Through this method, the information interaction between the first device and the second device can be made more flexible. That is, in this embodiment, in response to the second device confirming to enable the identity, information interaction can be carried out based on the target identity, thereby ensuring the security of information interaction. Alternatively, in response to the second device confirming not to enable the identity, for example, in the case where the information to be interacted does not require high security, it is selected not to use the target identity for information interaction, thereby switching to other reference methods for information interaction, so as to save the processing resources of the first device and the second device for determining the target identity. In addition, in the case where the second device confirms not to enable the identity for information interaction, the first device can warn the second device to prompt the second device that if the identity is not enabled, the information interacted may be eavesdropped.
[0128] Step 202: The first device sends attribute information to the second device.
[0129] In implementation, after determining the attribute information, the first device can directly publicly send the attribute information to the second device. Publicly sending the attribute information means that any other device except the second device participating in the information interaction can obtain the attribute information. The reason why the attribute information can be publicly sent is that even if other devices obtain the attribute information, the other devices will not be able to determine the target identity based on the attribute information like the second device because the other devices do not store an identity list including multiple reference identity identifiers, or do not receive the identity identifier assigned by the third device. Therefore, in the subsequent process of the first device and the second device interacting based on the target identity identifier, other devices will not be able to eavesdrop on the information exchanged based on the target identity identifier, thereby ensuring the security of the information interaction between the first device and the second device.
[0130] Step 203: The second device receives the attribute information sent by the first device, where the attribute information is used to indicate the target identity.
[0131] Since the first device sends the attribute information of the target identity to the second device, the second device can receive the attribute information accordingly. In response to the first device sending the attribute information in a public manner, the second device can directly receive the attribute information.
[0132] In addition, before the second device receives the attribute information sent by the first device, it may also receive confirmation information sent by the first device to enable the identity identification, and the confirmation information is used to confirm whether to enable the identity identification for information exchange. In response to the confirmation to enable the identity identification, the second device will continue to receive the attribute information sent by the first device. In response to the confirmation not to enable the identity identification, the second device may receive an alarm sent by the first device, which is used to prompt that not enabling the identity identification may cause the information exchanged later to be eavesdropped.
[0133] In implementation, the first device may carry the type of information to be interacted in the confirmation information, so that after receiving the confirmation information, the second device determines the importance of the information to be interacted according to the type of information to be interacted, and further confirms whether the identity identification needs to be enabled in the process of interacting with the information to be interacted according to the importance. Alternatively, in response to the second device being a terminal that can interact with the user, the second device may display a dialog box through the terminal interface, and the dialog box includes one or more contents in prompt text, image or video, so as to prompt the user to confirm whether to enable the identity identification through these contents to improve the interaction security. The dialog box also includes "yes" and "no" options, and in response to detecting that any option is selected, it is confirmed whether to enable the identity identification according to the selected option. For example, in response to detecting that the "yes" option is selected, it is confirmed that the identity identification is enabled. Alternatively, the second device can also be set to enable the identity identification by default, and the second device will confirm the activation of the identity identification every time it receives the confirmation information. Alternatively, the second device can also be set to enable the identity identification by default on certain dates or certain time periods on a certain date, and in response to the second device receiving the confirmation information on the set date or time period, it will confirm the activation of the identity identification. For other times other than the set date or time period, the second device will not enable the identity identification by default after receiving the confirmation information.
[0134] Step 204: The second device determines the target identity according to the attribute information.
[0135] According to the description in step 201, the attribute information may be the order value of the target identity in the identity list, the description information of the target identity, or the device identity of the third device. Next, the manner in which the second device determines the target identity according to different attribute information is described respectively:
[0136] The first determination method: When the order of multiple reference identifiers stored in the first device and the second device in the identifier list is the same, the attribute information is the sequence value or description information of the target identifier in the identifier list. Therefore, when the attribute information is a sequence value, the second device can read the reference identifier corresponding to the sequence value in the identifier list stored in the SOC of the second device, and use the reference identifier corresponding to the sequence value as the target identifier. Since the order of multiple reference identifiers stored in the first device and the second device is the same, the sequence value of the target identifier in the identifier list in the first device is the same as the sequence value of the identifier list in the second device. Therefore, a reference identifier determined by the second device according to the sequence value is the target identifier determined in the first device, so that a reference identifier determined according to the sequence value can be used as the target identifier.
[0137] According to the description in step 201, the reference identity identifier corresponds to the description information one-to-one, and different reference identity identifiers correspond to different description information. In other words, a reference identity identifier can be uniquely identified through the description information. Therefore, the second device can query the correspondence between the reference identity identifier and the description information, and use a reference identity identifier corresponding to the received description information as the target identity identifier, so that the target identity identifier determined by the second device is the target identity identifier determined in the first device. Alternatively, the second device may not store the correspondence between the reference identity identifier and the description information, but determine the description information of each reference identity identifier after receiving the description information. Afterwards, the description information of each determined reference identity identifier is matched with the received description information, so that a reference identity identifier corresponding to a description information that matches the received description information is used as the target identity identifier.
[0138] Second determination method: When the order of the multiple reference identities stored in the first device and the second device in the identity list is different, the attribute information is only the description information of the target identity. The process of the second device determining the target identity according to the description information can be referred to the description of the first determination method above, and will not be repeated here.
[0139] The third determination method: when the first device obtains the target identity by sending an identity allocation request to the third device, the attribute information is the device identification of the third device. Since the third device will allocate an identity to both the first device and the second device according to the identity allocation request, the method also includes: the second device receives the identity allocated by the third device. Accordingly, determining the target identity according to the attribute information includes: the second device determines the identity allocated by the third device as the target identity according to the received device identification of the third device sent by the first device.
[0140] It should be noted that the second device may first receive the identity identifier assigned by the third device, and then receive the device identifier of the third device sent by the first device. Alternatively, the second device may first receive the device identifier of the third device sent by the first device, and then receive the identity identifier assigned by the third device. In both cases, the second device may cache the identifier received first, and after receiving the other identifier, determine the target identity identifier based on the two identifiers. Of course, the second device may also receive the device identifier of the third device sent by the first device and the identity identifier assigned by the third device at the same time. It can be seen that this embodiment does not limit the order in which the second device receives the assigned identity identifier and the device identifier of the third device.
[0141] In implementation, according to step 201, the third device may allocate the device identifier of the third device together with the identity identifier in the process of allocating the identity identifier to the second device, or the second device may also obtain the device identifier of the third device by active query after receiving the allocated identity identifier. It can be seen that in addition to receiving the allocated identity identifier, the second device also receives the device identifier of the third device. Therefore, the second device can cache the received identity identifier and the device identifier of the third device. Afterwards, in response to the second device receiving the device identifier of the third device sent by the first device, the second device can compare the device identifier of the third device sent by the first device with the device identifier of the third device in the cache. Since the comparison result is that both device identifiers are the device identifier of the same third device, the second device can confirm that the target identity identifier obtained by the first device is also the identity identifier assigned by the third device. Therefore, the second device can use the identity identifier assigned by the third device in the cache as the target identity identifier.
[0142] Step 205: The first device generates a target key based on the target identity, and exchanges information with the second device through the target key.
[0143] Among them, since the first device and the second device determine the same target identity through the above steps 201-204, the first device and the second device can both generate a target key based on the target identity. Afterwards, the device that needs to send information among the first device and the second device encrypts the target information to be sent through the target key to obtain the encrypted target information, and the device that needs to receive information decrypts the encrypted target information through the target key to obtain the target information, thereby performing information exchange between the first device and the second device through the key.
[0144] In an exemplary embodiment, the first device and the second device may generate the target key in the following manner: obtain a reference key, call a hash algorithm, determine a hash value corresponding to the target identity through the hash algorithm, and generate the target key according to the hash value and the reference key.
[0145] Among them, the reference key can be a key that has been stored in the SOC of the first device and the second device. Alternatively, the reference key can also be a key negotiated according to key negotiation methods such as Diffie-Hellman key exchange (DH), elliptic curves Diffie-Hellman key exchange (ECDH), etc. Alternatively, this embodiment can also start from the first generation of the target key based on the target identity, and store each generated target key in the SOC. Therefore, this embodiment can start from the second generation of the target key based on the target identity, and call the last generated target key from the SOC as the reference key used this time, thereby achieving the acquisition of the reference key.
[0146] In addition to obtaining the reference key, it is also necessary to determine the hash value corresponding to the target identity through the called hash algorithm. Among them, by determining the hash value of the target identity, the target identity of any length can be converted into a character string of reference length (for example, 256 bits). For different target identities, the converted hash values are also different, thereby ensuring that the target keys generated by the hash values converted by different target identities are also different. In addition, after the target identity is converted into a hash value, the target identity cannot be reversed by the hash value. The purpose of this embodiment is to improve the security of information interaction by first converting the target identity into a hash value and then generating the target key based on the hash value. The reason is that in implementation, it is often necessary to generate the same target key multiple times. If the target identity is first converted into a hash value and then the key is generated multiple times based on the hash value, the target identity is only converted into a hash value. There is a risk of being eavesdropped by other devices other than the second device at a time when it is converted into a hash value, and in the subsequent multiple generation of the target key, other devices can only eavesdrop on the hash value. Moreover, since the target identity cannot be reversed by the hash value, even if other devices eavesdrop on the hash value, they cannot deduce the target identity. However, if the target identity is directly used to generate the target key multiple times, the target identity is at risk of being eavesdropped by other devices each time the target key is generated, making it difficult to ensure the security of information interaction.
[0147] After determining the hash value corresponding to the target identity, the first device and the second device can generate the target key according to the hash value and the reference key. In implementation, the hash value and the reference key can be calculated by various possible calculation methods such as addition, subtraction, multiplication, and division to generate the target key. For the calculation method adopted, the first device and the second device can default to a calculation method that has been negotiated for calculation. Alternatively, when the first device sends the attribute information to the second device, the adopted calculation method can be sent together with the attribute information. Alternatively, the first device and the second device can also store the corresponding relationship between multiple reference algorithms and algorithm indication information. In this way, the first device can send the attribute information and an algorithm indication information to the second device together, so that the first device can determine the reference algorithm corresponding to the algorithm indication information from the corresponding relationship according to the algorithm indication information, and then the first device and the second device can calculate the hash value and the reference key through this reference algorithm. Alternatively, when the hash value and the reference key need to be calculated, other devices can allocate a calculation method to the first device and the second device in real time. The device used to allocate the calculation method can be the third device for allocating the identity as mentioned above, or it can be a fourth device other than the third device.
[0148] Next, see Figure 6 , taking the reference key as the key obtained by DH as an example, the process of generating the target key is described. Among them, the first device can randomly select a prime number p, a primitive root g and a first random number a, and calculate the first value A=g according to the prime number p, the primitive root g and the first random number a a mod p, where mod represents the remainder function. Afterwards, the first device sends the prime number p, the primitive root g, and the first value A to the second device. The second device randomly selects a second random number b, and calculates the second value B=g based on the received prime number p, primitive root g, and the second random number b. b mod p, and then return the second value B to the first device. Then, the first device will calculate the reference key K=B based on the prime number p, the first random number a and the received second value B. a mod p=(g b mod p) a mod p = g ab mod p, the second device will calculate the reference key K=A according to the prime number p, the second random number b and the received first value. b mod p=(g a mod p) b mod p = g abmod p. It can be seen that the first device and the second device obtain the same reference key. Finally, the first device and the second device can calculate the target key based on the reference key and the hash value. For example, the target key is represented as KEY, the hash value is represented as h(ID), and based on the reference key K=g ab Mod p and the hash value h(ID) can obtain an exemplary target key KEY=K h(ID) =g abh(ID) mod p.
[0149] It should be noted that, in the above process, the first device can send the prime number p, primitive root g and first random number a together with the attribute information to the second device. Of course, the first device can also send the prime number p, primitive root g and first random number a to the second device first, and then send the attribute information to the second device. Alternatively, the first device can also send the attribute information to the second device first, and then send the prime number p, primitive root g and first random number a to the second device. It can be seen that this embodiment does not limit the order in which the attribute information and the information used to obtain the reference key are sent.
[0150] In addition, if Figure 7 As shown, Figure 7 The figure shows the process of eavesdropping on information interaction by directly using the DH method. The eavesdropping device can intercept the prime number p, the primitive root g and the first value A sent by the first device, and randomly select a third random number t, and calculate the third value T=g according to the prime number p, the primitive root g and the third random number t. t mod p. Then, the eavesdropping device returns the third value T to the first device, so that the first device uses the eavesdropping device as the second device for information exchange. In addition, the eavesdropping device also sends the prime number p, the primitive root g, and the third value T to the second device, so that the second device uses the eavesdropping device as the first device for information exchange. Therefore, the first device and the eavesdropping device will communicate with each other according to Figure 7 The first reference key K1=g is obtained by negotiation in the manner shown at mod p, the second device and the eavesdropping device will follow Figure 7 The second reference key K2=T is negotiated in the manner shown b mod p = g bt mod p. It can be seen that the eavesdropping device can decrypt the information sent by the first device through K1, modify it, and then encrypt it through K2 to send it to the second device. It is difficult for the second device to know that the received information has been modified by the eavesdropping device, thus affecting the security of information exchange between the first device and the second device.
[0151] It can be seen that compared with the method of directly using DH to generate keys for information exchange, in this embodiment, since the first device and the second device can hold an undisclosed target identity through the above steps 201-204, the target key generated based on the target identity will not be known to other devices, thereby making the information interaction performed through the target key more secure.
[0152] In an exemplary embodiment, generating a target key based on a target identity includes: obtaining an updated identity based on the target identity, and determining updated attribute information of the updated identity. The updated attribute information is sent to the second device, and a target key is generated based on the updated identity. Wherein, in the case where both the first device and the second device store an identity list including multiple reference identities, the reference identities revoked in the first device and the second device may be inconsistent. In other words, the target identity obtained by the first device may have been revoked in the second device, so the second device cannot use the target identity to generate a target key. The first device needs to obtain an updated identity based on the target identity, and the updated identity must be an identity that has not been revoked in the second device. Afterwards, the first device and the second device generate a target key for information interaction based on the updated identity.
[0153] In implementation, see Figure 5 In steps 504-506, after the first device sends the attribute information of the target identity to the second device, the second device first determines the target identity according to the attribute information, and then determines whether the target identity has been revoked according to the revocation indicator corresponding to the target identity in the second device. In response to the target identity in the second device not being revoked, further execution may be performed. Figure 5 In step 208, the first device and the second device directly generate a target key based on the target identity. In an exemplary embodiment, in response to the revocation indication bit corresponding to the target identity in the second device indicating that the target identity in the second device has been revoked, or, in the case where the target identity does not correspond to a revocation indication bit, in response to the second device confirming through a query that the target identity has been revoked, the second device can send an update request to the first device, and indicate to the first device through the update request that the target identity in the second device has been revoked. Accordingly, in response to receiving the update request sent by the second device, the first device can obtain an updated identity according to the update request. Thereafter, the first device determines the updated attribute information corresponding to the updated identity request, and sends the updated attribute information to the second device. The second device can receive the updated attribute information sent by the first device based on the update request, and can thereby determine the updated identity according to the updated attribute information.
[0154] At this point, both the first device and the second device have updated identity tags, which is equivalent to Figure 5 In step 207 of the embodiment, the first device and the second device renegotiate the updated identity. Therefore, the first device and the second device can generate a target key based on the updated identity representation. It should be noted that the above-mentioned process of renegotiating the updated identity can be performed once or multiple times until the updated identity determined by the first device is an identity that has not been revoked in the second device.
[0155] In addition, in addition to the need to obtain an updated identity when the target identity determined by the first device has been revoked in the second device, other conditions may also be used to trigger the first device to obtain an updated identity. In an exemplary embodiment, obtaining an updated identity based on the target identity includes: the first device detects the leakage probability of the target identity, and in response to detecting that the leakage probability is greater than a reference threshold, obtains the updated identity. In implementation, the first device may detect the number of times the target identity is used to generate the target key, and in response to the number being greater than the reference number, it is considered that the leakage probability is greater than the reference threshold. Alternatively, the first device may also detect the duration of the target identity being obtained, and in response to the duration being greater than the reference duration, it is considered that the leakage probability is greater than the reference threshold. Of course, this embodiment does not limit the method for determining the leakage probability. In addition to the above-mentioned number of times and the duration of acquisition, the first device may also use other indicators to determine the leakage probability of the target identity. By obtaining an updated identity when the leakage probability is greater than the reference threshold, the security of information interaction between the first device and the second device is guaranteed.
[0156] Step 206: The second device generates a target key based on the target identity, and exchanges information with the first device through the target key.
[0157] The second device may generate a target key based on the hash value of the target identity and the reference key in the manner described in step 205. In an exemplary embodiment, the second device generates a target key based on the target identity, including: obtaining an updated identity based on the target identity, and generating a target key based on the updated identity. In implementation, the second device may trigger the acquisition of an updated identity when the target identity in the second device has been revoked. This process may also refer to step 205, which will not be described in detail here.
[0158] Alternatively, in an exemplary embodiment, in response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has not been revoked, the second device may detect the leakage probability of the target identity. In response to detecting that the leakage probability is greater than the reference threshold, an updated identity is obtained. It can be seen that the process of detecting whether the leakage probability of the target identity is greater than the reference threshold can be performed by the first device as in step 205, or by the second device, or by the first device and the second device together. Once one of the first device and the second device detects that the leakage probability of the target identity is greater than the reference threshold, the one of the devices can initiate the acquisition of the updated identity. Accordingly, in the case where the target identity corresponds to a revocation indication bit, the one of the devices will also adjust the revocation indication bit corresponding to the target identity so that the adjusted revocation indication bit indicates that the target identity has been revoked.
[0159] In summary, the embodiment of the present application enables the first device and the second device to have the same target identity through the transmission of attribute information. Therefore, the first device and the second device can exchange information based on the target key generated by the target identity, thereby protecting the security of information interaction.
[0160] Based on the same concept, Figure 8 As shown, the embodiment of the present application also provides a device for information interaction, the device comprising:
[0161] Receiving module 801, used for the second device to receive attribute information sent by the first device, where the attribute information is used to indicate a target identity;
[0162] A determination module 802 is used to determine a target identity according to attribute information;
[0163] A generating module 803, used to generate a target key based on a target identity;
[0164] The interaction module 804 is used to interact with the first device through the target key.
[0165] In an exemplary embodiment, the first device and the second device both store an identity list, the identity list includes multiple reference identity identifiers, the attribute information includes the sequence value of the target identity identifier in the identity list, and the determination module 802 is used to read the reference identity identifier corresponding to the sequence value in the identity list; and use the reference identity identifier corresponding to the sequence value as the target identity identifier.
[0166] In an exemplary embodiment, the generating module 803 is used to obtain an updated identity based on the target identity; and generate a target key based on the updated identity.
[0167] In an exemplary embodiment, the generation module 803 is used to send an update request to the first device in response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has been revoked, receive updated attribute information sent by the first device based on the update request; and obtain an updated identity according to the updated attribute information.
[0168] In an exemplary embodiment, the generation module 803 is used to detect the leakage probability of the target identity in response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has not been revoked; in response to detecting that the leakage probability is greater than a reference threshold, obtain an updated identity.
[0169] In an exemplary embodiment, the attribute information includes a device identification of a third device, and the apparatus further includes: an allocation module for receiving an identity identification allocated by a third device, the third device being used to allocate an identity identification to the first device and the second device according to an identity identification acquisition request sent by the first device; a determination module 802 for determining the identity identification allocated by the third device as a target identity identification according to the received device identification of the third device.
[0170] In an exemplary embodiment, the apparatus further includes: a confirmation module, configured to receive confirmation information of enabling the identity identifier sent by the first device, wherein the confirmation information is used to confirm whether the identity identifier is enabled for information interaction; in response to confirming that the identity identifier is enabled, executing the second device to receive attribute information sent by the first device.
[0171] In an exemplary embodiment, the generation module 803 is used to obtain a reference key; call a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; and generate a target key according to the hash value and the reference key.
[0172] In summary, the embodiment of the present application enables the first device and the second device to have the same target identity through the transmission of attribute information. Therefore, the first device and the second device can exchange information based on the target key generated by the target identity, thereby protecting the security of information interaction.
[0173] Based on the same concept, Fig. 9 As shown, the embodiment of the present application also provides a device for information interaction, the device comprising:
[0174] An acquisition module 901 is used for the first device to acquire a target identity and determine attribute information of the target identity;
[0175] A sending module 902, configured to send the attribute information to a second device, and the second device is configured to determine a target identity according to the attribute information;
[0176] The generating module 903 is used to generate a target key based on the target identity, and to perform information exchange with the second device through the target key.
[0177] In an exemplary embodiment, both the first device and the second device store an identity list, the identity list includes multiple reference identity identifiers, and the acquisition module 901 is used to read the identity list; determine a reference identity identifier as a target identity identifier from the multiple reference identity identifiers included in the identity list; and determine the sequence value of the target identity identifier in the identity list as attribute information.
[0178] In an exemplary embodiment, each reference identity corresponds to a revocation indication bit, and the revocation indication bit is used to indicate whether the reference identity is revoked. The acquisition module 901 is used to obtain a reference identity that has not been revoked from multiple reference identity identifiers based on the revocation indication bit; and determine the target identity from the reference identity identifiers that have not been revoked according to the reference order.
[0179] In an exemplary embodiment, the generation module 903 is used to obtain an updated identity based on the target identity, determine updated attribute information of the updated identity; send the updated attribute information to the second device; and generate a target key based on the updated identity.
[0180] In an exemplary embodiment, the generating module 903 is used to obtain an updated identity according to the update request in response to receiving an update request sent by the second device, where the update request is used to indicate that the target identity in the second device has been revoked.
[0181] In an exemplary embodiment, the generating module 903 is used to detect the leakage probability of the target identity; in response to detecting that the leakage probability is greater than a reference threshold, an updated identity is acquired.
[0182] In an exemplary embodiment, the acquisition module 901 is used for the first device to send an identity allocation request to the third device, and the third device is used to allocate identities to the first device and the second device according to the identity allocation request; the identity allocated by the third device is used as the target identity; and the device identity of the third device is used as attribute information.
[0183] In an exemplary embodiment, the apparatus further includes: a confirmation module, configured to send confirmation information of enabling the identity identifier to the second device, wherein the confirmation information is used to confirm whether the identity identifier is enabled for information interaction; in response to the second device confirming that the identity identifier is enabled, executing the first device to obtain the target identity information.
[0184] In an exemplary embodiment, the generation module 903 is used to obtain a reference key; call a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; and generate a target key according to the hash value and the reference key.
[0185] In summary, the embodiment of the present application enables the first device and the second device to have the same target identity through the transmission of attribute information. Therefore, the first device and the second device can exchange information based on the target key generated by the target identity, thereby protecting the security of information interaction.
[0186] It should be understood that the above Figure 8 and Fig. 9 When the device provided realizes its functions, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0187] Based on the same concept, an embodiment of the present application provides an electronic device, which includes a memory and a processor; at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement any of the above-mentioned information interaction methods.
[0188] Based on the same concept, an embodiment of the present application provides a communication device, which includes: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals, and when the processor executes the instructions stored in the memory, the processor executes any of the above-mentioned information interaction methods.
[0189] Optionally, the number of the processors is one or more, and the number of the memories is one or more.
[0190] Optionally, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0191] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips respectively. The embodiments of the present application do not limit the type of memory and the setting method of the memory and the processor.
[0192] Based on the same concept, a communication system is provided. The system includes a first device and a second device to execute the method provided by any exemplary embodiment of this embodiment.
[0193] Based on the same concept, a computer program (product) is provided, which includes: computer program code, when the computer program code is executed by a computer, the computer is enabled to execute any one of the above-mentioned information interaction methods.
[0194] Based on the same concept, a readable storage medium is provided, which stores a program or instruction. When the program or instruction runs on a computer, any of the above-mentioned information interaction methods is executed.
[0195] Based on the same concept, a chip is provided, comprising a processor, for calling and executing instructions stored in a memory from the memory, so that a communication device equipped with the chip executes any of the above-mentioned information interaction methods.
[0196] Based on the same concept, another chip is provided, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute any of the above-mentioned information interaction methods.
[0197] It should be understood that the above processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.
[0198] Further, in an exemplary embodiment, the above-mentioned memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0199] The memory may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (DR RAM).
[0200] The present application provides a computer program. When the computer program is executed by a computer, a processor or a computer can be enabled to execute the corresponding steps and / or processes in the above method embodiments.
[0201] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk), etc.
[0202] The above description is only an embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for information interaction, characterized in that: The method comprises: The second device receives attribute information sent by the first device, where the attribute information is used to indicate a target identity, the first device and the second device both store an identity list, the identity list includes multiple reference identities, and the attribute information includes a sequence value of the target identity in the identity list; Determine the target identity according to the attribute information; Get the reference key; Calling a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; Generate a target key according to the hash value and the reference key; Information is exchanged with the first device through the target key.
2. The method according to claim 1, characterized in that The determining the target identity according to the attribute information includes: Read the reference identity corresponding to the sequence value in the identity list; The reference identity corresponding to the sequence value is used as the target identity.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquire an updated identity based on the target identity; A target key for information interaction is generated based on the updated identity.
4. The method according to claim 3, characterized in that The acquiring of an updated identity based on the target identity includes: In response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has been revoked, sending an update request to the first device, and receiving updated attribute information sent by the first device based on the update request; The updated identity is obtained according to the updated attribute information.
5. The method according to claim 3, characterized in that: The acquiring of an updated identity based on the target identity includes: In response to the revocation indication bit corresponding to the target identity indicating that the target identity in the second device has not been revoked, detecting a leakage probability of the target identity; In response to detecting that the leakage probability is greater than a reference threshold, obtaining the updated identity.
6. The method according to any one of claims 1 to 5, characterized in that: Before the second device receives the attribute information sent by the first device, the method further includes: Receiving confirmation information of enabling the identity identifier sent by the first device, where the confirmation information is used to confirm whether to enable the identity identifier for information interaction; In response to confirming that the identity identification is enabled, the second device receives the attribute information sent by the first device.
7. A method for information interaction, characterized in that: The method comprises: The first device obtains a target identity and determines attribute information of the target identity, wherein the first device and the second device both store an identity list, the identity list includes a plurality of reference identities, and the attribute information includes a sequence value of the target identity in the identity list; Sending the attribute information to the second device, where the second device is used to determine the target identity according to the attribute information; Get the reference key; Calling a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; Generate a target key according to the hash value and the reference key; Information is exchanged with the second device through the target key.
8. The method according to claim 7, characterized in that The first device obtains a target identity and determines attribute information of the target identity, including: Reading the identity list; Determining a reference identity from a plurality of reference identities included in the identity list as the target identity; The sequence value of the target identity in the identity list is determined as the attribute information.
9. The method according to claim 8, characterized in that Each reference identity corresponds to a revocation indication bit, and the revocation indication bit is used to indicate whether the reference identity is revoked. The step of determining a reference identity as the target identity from a plurality of reference identities included in the identity list includes: According to the revocation indication bit, obtaining a reference identity identifier that has not been revoked from the multiple reference identity identifiers; The target identity is determined from the non-revoked reference identities in a reference order.
10. The method according to any one of claims 7 to 9, characterized in that: The method further comprises: Acquire an updated identity based on the target identity, and determine updated attribute information of the updated identity; sending the updated attribute information to the second device; A target key for information interaction is generated based on the updated identity.
11. The method according to claim 10, characterized in that The acquiring of an updated identity based on the target identity includes: In response to receiving an update request sent by the second device, the updated identity is obtained according to the update request, where the update request is used to indicate that the target identity in the second device has been revoked.
12. The method according to claim 10, characterized in that The acquiring of an updated identity based on the target identity includes: Detecting a probability of leakage of the target identity; In response to detecting that the leakage probability is greater than a reference threshold, obtaining the updated identity.
13. The method according to any one of claims 7 to 12, characterized in that: Before the first device acquires the target identity, the method further includes: Sending confirmation information of enabling the identity identifier to the second device, where the confirmation information is used to confirm whether to enable the identity identifier for information interaction; In response to the second device confirming that the identity identification is enabled, the first device acquires target identity information.
14. An information interaction device, characterized in that: The device comprises: A receiving module, configured for the second device to receive attribute information sent by the first device, the attribute information being used to indicate a target identity, the first device and the second device both store an identity list, the identity list including a plurality of reference identities, and the attribute information including a sequence value of the target identity in the identity list; A determination module, used to determine the target identity according to the attribute information; A generation module is used to obtain a reference key; call a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; and generate a target key according to the hash value and the reference key; An interaction module is used to interact with the first device through the target key.
15. An information interaction device, characterized in that: The device comprises: An acquisition module, configured for the first device to acquire a target identity and determine attribute information of the target identity, wherein both the first device and the second device store an identity list, the identity list includes a plurality of reference identities, and the attribute information includes a sequence value of the target identity in the identity list; A sending module, used to send the attribute information to the second device, and the second device is used to determine the target identity according to the attribute information; A generation module is used to obtain a reference key; call a hash algorithm to determine a hash value corresponding to the target identity through the hash algorithm; generate a target key based on the hash value and the reference key; and exchange information with the second device through the target key.
16. An electronic device, characterized in that: The electronic device includes a memory and a processor; the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the information interaction method described in any one of claims 1-13.
17. A readable storage medium, characterized in that: The readable storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the information interaction method as described in any one of claims 1-13.
18. A computer program product, characterized in that The computer program product includes computer program code, and when the computer program code is executed by a computer, the computer executes the information interaction method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Method and device for generating session key
CN106685907A
File encryption method, file decryption method, file encryption device, file decryption device and computer-readable storage medium
CN107659632A