Data sharing method
Through the combination of blockchain technology and SIM cards, authentication credentials are generated and data is encrypted, and the problem of malicious modification and deletion in cross-platform data sharing is solved, improving the security and credibility of data.
Patent Information
- Application Number
- CN202411429991.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In mobile communication technology, data is easily maliciously modified or deleted during cross-platform data sharing, making it difficult to guarantee security and credibility.
Using a combination of blockchain technology and SIM card, authentication credentials are generated through blockchain nodes and data is encrypted using private keys to ensure the security of the data during transmission.
It realizes secure and trustworthy data sharing among users, avoids the problem of data being tampered with or deleted during cross-platform sharing, and improves the security and credibility of data sharing.
Smart Images

Figure CN119316835A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile communication technology, and in particular to a data sharing method. Background Art
[0002] With the rapid development of mobile communication technology, users transmit and share a lot of information in their daily life and work, such as sharing the data they want to share to various instant messaging software and social platforms through the sharing button of the application (APP). However, during the sharing process, especially the cross-platform sharing process, data is prone to malicious modification and deletion, and security and credibility are difficult to guarantee. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a data sharing method that can achieve safe and reliable data sharing based on blockchain technology.
[0004] In order to achieve the above objectives, the present application embodiment adopts the following technical solutions: In a first aspect, an embodiment of the present application provides a data sharing method, which is applied to a SIM card of a first user, and the method includes: When the first user requests to share the target data, obtaining a first authentication credential from the blockchain node; the first authentication credential is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain; Encrypting the target data based on the first authentication credential and the first user's private key to obtain a first ciphertext; The first ciphertext is sent to the SIM card of the second user.
[0005] In a second aspect, an embodiment of the present application provides a data sharing method, which is applied to a blockchain node, and the method includes: Obtaining an authentication key of a second user and user information of the second user from the blockchain, where the second user is a user to receive the target data shared by the first user; Encrypting the user information of the second user based on the authentication key to obtain a first authentication credential; The first authentication credential is sent to the SIM card of the first user. The first authentication credential is used by the SIM card of the first user to encrypt the target data and then send the encrypted data to the SIM card of the second user.
[0006] In a third aspect, an embodiment of the present application provides a data sharing method, which is applied to a SIM card of a second user, and the method includes: Receiving a first ciphertext from a SIM card of a first user; the first ciphertext is obtained by encrypting target data by the SIM card of the first user based on a first authentication credential and a private key of the first user, and the first authentication credential is generated by a blockchain node based on an authentication key and user information of the second user stored in a blockchain; generating a second authentication credential based on the authentication key and user information of the second user stored locally on the SIM card of the second user; The first ciphertext is decrypted based on the second authentication credential and the public key of the first user to obtain the target data.
[0007] In a fourth aspect, an embodiment of the present application provides a data sharing device, applied to a SIM card of a first user, the device comprising: A first acquisition module, configured to acquire a first authentication credential from a blockchain node when the first user requests to share target data; the first authentication credential is generated by the blockchain node based on an authentication key and user information of the second user stored in the blockchain; A first encryption module, configured to encrypt the target data based on the first authentication credential and the private key of the first user to obtain a first ciphertext; The first sending module is configured to send the first ciphertext to the SIM card of the second user.
[0008] In a fifth aspect, an embodiment of the present application provides a data sharing device, which is applied to a blockchain node, and the device includes: A second acquisition module is used to obtain an authentication key of a second user and user information of the second user from the blockchain, where the second user is a user to receive the target data shared by the first user; A second encryption module, used to encrypt the user information of the second user based on the authentication key to obtain a first authentication credential; The second sending module is used to send the first authentication credential to the SIM card of the first user, where the first authentication credential is used by the SIM card of the first user to encrypt the target data and then send the encrypted data to the SIM card of the second user.
[0009] In a sixth aspect, an embodiment of the present application provides a data sharing device, applied to a SIM card of a second user, the device comprising: A first receiving module, configured to receive a first ciphertext from a SIM card of a first user; the first ciphertext is obtained by encrypting target data by the SIM card of the first user based on a first authentication credential and a private key of the first user, and the first authentication credential is generated by a blockchain node based on an authentication key and user information of the second user stored in the blockchain; a third encryption module, configured to generate a second authentication credential based on the authentication key and user information of the second user stored locally on the SIM card of the second user; The first decryption module is used to decrypt the first ciphertext based on the second authentication credential and the public key of the first user to obtain the target data.
[0010] In a seventh aspect, an embodiment of the present application provides a SIM card, including: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the data sharing method provided in the first aspect.
[0011] In an eighth aspect, an embodiment of the present application provides a blockchain node, including: processor; a memory for storing instructions executable by the processor; Wherein, the processor is configured to execute the instructions to implement the data sharing method provided in the second aspect.
[0012] In a ninth aspect, an embodiment of the present application provides a SIM card, including: processor; a memory for storing instructions executable by the processor; Among them, the processor is configured to execute the instructions to implement the data sharing method provided in the third aspect.
[0013] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the data sharing method provided in the first aspect, the second aspect or the third aspect.
[0014] In the eleventh aspect, an embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute part or all of the steps in the data sharing method provided in the first aspect, the second aspect or the third aspect.
[0015] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: By utilizing the decentralized and tamper-proof characteristics of SIM cards and blockchain technology, secure and reliable data sharing between the first user and the second user is realized, the security of data sharing is improved, and the problem of data being tampered with and modified during cross-platform sharing is avoided. Specifically, when the first user requests to share the target data, the SIM card of the first user obtains the first authentication certificate of this sharing from the blockchain node, and uses the first authentication certificate and the private key of the first user to encrypt the target data to obtain the first ciphertext and send it to the SIM card of the second user. The authentication certificate is obtained by encrypting the user information of the first user and the user information of the second user based on the authentication key of the second user stored in the blockchain by the blockchain node. Since the blockchain has the decentralized and tamper-proof characteristics, and only the SIM card of the second user has the authentication key and user information of the second user except the blockchain node, only the blockchain node and the SIM card of the second user can obtain the first authentication certificate, and then obtain the target data from the first ciphertext. As a result, the encrypted sharing of the target data between the first user and the second user is realized, and the target data is prevented from being modified or deleted during the sharing process, and the security and credibility of data sharing are improved, especially the security and credibility of cross-platform data sharing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings: Figure 1 A schematic diagram of an implementation environment applicable to a data sharing method provided in an embodiment of the present application; Figure 2 A flowchart of a data sharing method provided for one embodiment of the present application; Figure 3 A schematic diagram of a first sharing interface provided by an embodiment of the present application; Figure 4 A schematic diagram of a second sharing interface provided by an embodiment of the present application; Figure 5 A schematic diagram of cover content provided for an embodiment of the present application; Figure 6 A flowchart of a data sharing method provided for another embodiment of the present application; Figure 7 A flowchart of a data sharing method provided for another embodiment of the present application; Figure 8 A flowchart of a data sharing method provided for another embodiment of the present application; Fig. 9A schematic diagram of the structure of a data sharing device provided for one embodiment of the present application; Fig.10 A structural schematic diagram of a data sharing device provided for another embodiment of the present application; Fig.11 A structural diagram of a data sharing device provided for another embodiment of the present application; Fig.12 A schematic diagram of the structure of a SIM card provided for one embodiment of the present application; Fig.13 A schematic diagram of the structure of a blockchain node provided for one embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0018] The terms "first", "second", etc. in this specification and claims are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein. In addition, "and / or" in this specification and claims means at least one of the connected objects, and the character " / " generally means that the objects associated with each other are in an "or" relationship.
[0019] As mentioned earlier, cross-platform data sharing can easily lead to malicious modification or deletion of data content, making security difficult to guarantee.
[0020] In view of this, the embodiment of the present application proposes a data sharing method, which utilizes the decentralized and tamper-proof characteristics of SIM cards and blockchain technology to realize safe and reliable data sharing between the first user and the second user, improve the security of data sharing, and avoid the problem of data being tampered and modified when sharing across platforms. Specifically, when the first user requests to share the target data, the SIM card of the first user obtains the first authentication credential of this sharing from the blockchain node, and uses the first authentication credential and the private key of the first user to encrypt the target data to obtain the first ciphertext and send it to the SIM card of the second user. The authentication credential is obtained by encrypting the user information of the first user and the user information of the second user based on the authentication key of the second user stored in the blockchain by the blockchain node. Since the blockchain has the decentralized and tamper-proof characteristics, and only the SIM card of the second user has the authentication key and user information of the second user except the blockchain node, only the blockchain node and the SIM card of the second user can obtain the first authentication credential, and then obtain the target data from the first ciphertext. As a result, the encrypted sharing of the target data between the first user and the second user is realized, and the target data is prevented from being modified or deleted during the sharing process, and the security and credibility of data sharing are improved, especially the security and credibility of cross-platform data sharing.
[0021] The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0022] In order to facilitate the understanding of the technical solution provided in the embodiments of the present application, firstly Figure 1 , the implementation environment to which the technical solution provided in the embodiment of the present application is applicable is described. It should be understood that the technical solution provided in the embodiment of the present application is applied to Figure 1 The implementation environment shown is only an exemplary description and should not be understood as a limitation on the implementation environment to which the technical solution is applicable.
[0023] like Figure 1 As shown, an implementation environment applicable to the technical solution provided in an embodiment of the present application includes: a SIM (Subscriber Identity Module) card of a first user, a SIM card of a second user, a media platform and a blockchain.
[0024] The SIM card may be a super SIM card, which is used to provide functions such as card application carrier, receiving and executing instructions, sending pop-up windows, etc. An application is deployed in the SIM card, and the functions of the SIM card can be realized through the application.
[0025] The media platform can be used as a platform for the first user to share data with the second user, such as a social platform. The SIM card of the first user can share the data of the first user to the media platform, and the SIM card of the second user can access the media platform to obtain the data shared by the first user. In actual applications, the number of second users can be multiple, thereby realizing a "one-to-many" sharing mode.
[0026] Blockchain is used to store user information, public keys and authentication keys of a large number of users. Due to the decentralized and tamper-proof characteristics of blockchain, the transmission and storage of this information becomes safer, more efficient and more reliable. Smart contracts are deployed in blockchain. Smart contracts are a protocol that automatically executes contracts through computer programs. Based on the decentralized, tamper-proof and intelligent characteristics of blockchain, the contract terms are converted into executable codes through programming languages, thereby realizing automated contract execution. In the embodiments of the present application, smart contracts can be used to implement operations related to data encryption and sharing.
[0027] In one embodiment, when the first user requests to share the target data with the second user, the blockchain node of the blockchain can call the smart contract, obtain the authentication key and user information of the second user from the blockchain, and generate the corresponding authentication certificate based on the two and send it to the SIM card of the first user. The SIM card of the first user encrypts the target data based on the authentication certificate and the private key of the first user, and then shares it with the SIM card of the second user through the media platform. The blockchain node can also call the smart contract to share the public key of the first user with the SIM card of the second user, so that the SIM card of the second user can decrypt and obtain the target data.
[0028] Since the blockchain is decentralized and cannot be tampered with, and only the SIM card of the second user has the authentication key and user information of the second user except the blockchain node, only the blockchain node and the SIM card of the second user can obtain the first authentication credential, and then obtain the target data from the first ciphertext.
[0029] In the embodiment of the present application, the blockchain node can be any computer or device that can access the blockchain. As an example, the first terminal device inserted into the SIM card of the first user and the second terminal device inserted into the SIM card of the second user can both be blockchain nodes. In this case, the first terminal device is responsible for providing authentication credentials for the SIM card of the first user, and the second terminal device is responsible for providing the public key of the first user to the SIM card of the second user.
[0030] The data sharing method provided in the embodiment of the present application utilizes the communication and data interaction between the SIM card of the first user, the SIM card of the second user, the media platform, and the blockchain nodes of the blockchain to achieve secure and reliable data sharing between the first user and the second user.
[0031] See also Figure 2 , is a flow chart of a data sharing method provided by an embodiment of the present application, the method is applied to a SIM card of a first user, and the method comprises the following steps: S202, when the first user requests to share the target data, obtain a first authentication credential from the blockchain node.
[0032] As an example, the SIM card of the first user displays an operation interface containing target data through its built-in application, and when a click operation on a share button of "target data" is received through the operation interface, it is determined that the first user requests to share the target data.
[0033] The first authentication credential is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain. The second user refers to the user to receive the target data. The user information of the second user may include, for example, but is not limited to, the name and user ID of the second user.
[0034] In the embodiment of the present application, the above S202 can be implemented in various ways.
[0035] In one embodiment, the above S202 includes the following steps: S221: When a first user requests to share target data, a first sharing interface is displayed.
[0036] The first sharing interface includes a first option, and the first option is used to share the encrypted target data. Optionally, the first sharing interface may also include a second option, and the second option is used to share the unencrypted target data. The first sharing interface may have various appropriate forms, such as but not limited to pop-ups, cards, drawer navigation, bottom navigation bar, etc., which are not limited in the embodiments of the present application. As an example, the SIM card of the first user can assemble an active command Displaytext through a built-in application, and display the first sharing interface through the command.
[0037] For example, Figure 3 A first sharing interface in the form of a pop-up window is shown, which includes a description text "Do you choose encrypted sharing", a first option "Yes" and a second option "No".
[0038] S222: In response to the selection operation of the first option, display a second sharing interface.
[0039] The second sharing interface includes at least one relationship category. The at least one relationship category may include, but is not limited to: friends, colleagues, close friends, relatives and friends, etc.
[0040] The second sharing interface can have various appropriate forms, such as but not limited to pop-up windows, cards, drawer navigation, bottom navigation bar, etc., which are not limited in the embodiments of the present application. As an example, the first user's SIM card can assemble an active command Displaytext through a built-in application to obtain at least one relationship category from the locally stored relationship categories, and display the second sharing interface containing the obtained relationship category through the command Displaytext. For example, Figure 4 A second sharing interface in the form of a pop-up window is shown, which includes four relationship categories, namely friends, colleagues, close friends, and relatives and friends.
[0041] It should be noted that before the first user's SIM card starts the data sharing function, a configuration interface can be displayed for the first user to configure the relationship category, for example, the first user sets the relationship category with user B and user D to friends, sets the relationship category with user F to relatives and friends, sets the relationship category with user C to colleagues, sets the relationship category with user E to close friends, etc. Further, the first user's SIM card stores the relationship category set by the first user locally, but does not store specific relationship data. In this way, even if the first user's SIM card is lost, only the relationship category is lost, but it does not cause the leakage of private data such as specific relationship data.
[0042] S223, in response to a selection operation on at least one relationship category, sending a selected first relationship category to a blockchain node.
[0043] The first relationship category is used to indicate that a user whose relationship with the first user belongs to the first relationship category is to be the second user.
[0044] S224, receiving the first authentication credential returned by the blockchain node.
[0045] For example, specific user relationship data is stored in the blockchain. After receiving the first relationship category, the blockchain node determines, from the user relationship data stored in the blockchain, a user whose relationship with the first user belongs to the first relationship category as the second user, and generates a first authentication credential based on the user information and authentication key of the second user stored in the blockchain and returns it to the SIM card of the first user.
[0046] by Figure 4Taking the second sharing interface shown in FIG. 1 as an example, when a trigger operation (such as a click) on “friend” is received, the blockchain node determines that user B and user D are the second users based on the user relationship data stored in the blockchain, and obtains the user information of user B and user D from the blockchain to form a user information set R A ={user B's user information, user D's user information}. At the same time, the blockchain node also obtains user B's authentication key and user D's authentication key from the blockchain. Further, the blockchain node generates a first authentication credential HE corresponding to user B based on user B's authentication key and user information. B , and based on the authentication key and user information of user D, generate the first authentication credential HE corresponding to user D D , and send the first authentication credential corresponding to user B and the first authentication credential corresponding to user D to the SIM card of the first user. Thus, the SIM card of the first user can be based on the first authentication credential HE B The target data is encrypted with the private key of the first user and then shared with the SIM card of user B, and based on the first authentication credential HE D The target data is encrypted with the private key of the first user and then shared with the SIM card of user D.
[0047] In the above implementation, the SIM card of the first user displays the available relationship categories to the first user, and obtains the first authentication credential from the blockchain node according to the selected first relationship category. Compared with the method in which the first user directly selects the second user, it can not only avoid the user information of the second user from being leaked during the transmission process, but also realize batch and flexible selection of the second user.
[0048] In another embodiment, the above S202 includes the following steps: when the first user requests to share the target data, displaying the above first sharing interface; in response to the selection operation of the first option, displaying the third sharing interface, the third sharing interface includes multiple users available for sharing; in response to the selection operation of multiple users, determining the selected user as the second user, sending the user identifier of the selected second user to the blockchain node, and receiving the first authentication credential returned by the blockchain node.
[0049] The above describes some implementation methods of the above S202. Of course, it should be understood that the above S202 can also be implemented in other ways, which are not limited in the present embodiment.
[0050] It is worth noting that in the embodiment of the present application, the blockchain node can be any computer or device that can access the blockchain. As an example, the blockchain node includes a first terminal device into which the SIM card of the first user is inserted. In this case, the SIM card of the first user obtains the first authentication credential from the first terminal device.
[0051] S204: Encrypt the target data based on the first authentication credential and the private key of the first user to obtain a first ciphertext.
[0052] In the embodiment of the present application, the above S204 can be implemented in various ways.
[0053] In one implementation, the above S204 includes the following steps: encrypting the target data based on the private key of the first user to obtain a second ciphertext; inserting the first authentication credential into the data header of the second ciphertext to obtain the first ciphertext.
[0054] Specifically, the SIM card of the first user stores a pair of public keys pre-generated for the first user. and private key The public key of the first user is uploaded to the blockchain through the blockchain node for storage, and the private key of the first user is stored locally on the SIM card, and the private key is not visible to the outside, that is, "the private key does not come out of the card".
[0055] The first user's SIM card uses the first user's private key Encrypt the target data W to obtain the second ciphertext , Then, the first authentication credential is inserted into the data header of the second ciphertext by embedding, so as to obtain the first ciphertext.
[0056] In the above implementation, the first authentication credential and the encrypted target data can be obfuscated, which increases the difficulty of cracking the first authentication credential and even the target data, and is conducive to improving the security of data sharing.
[0057] In another embodiment, the above S204 includes the following steps: encrypting the first authentication credential and the target data respectively based on the private key of the first user, and concatenating the encrypted first authentication credential and the encrypted target data to obtain a first ciphertext.
[0058] The above describes some implementation methods of the above S204. Of course, it should be understood that the above S204 can also be implemented in other ways, which are not limited in the present embodiment.
[0059] S206: Send the first ciphertext to the SIM card of the second user.
[0060] In one implementation, the SIM card of the first user may directly send the first ciphertext to the SIM card of the second user via the server of the media platform.
[0061] In another embodiment, the SIM card of the first user generates a content cover of the target data based on the key information of the target data; the content cover and the first ciphertext are sent to the media platform for display, so that the media platform can respond to the trigger operation of the second user on the content cover and send the first ciphertext to the SIM card of the second user.
[0062] Among them, the key information may include keywords that describe the content of the target data. For example, if the target data is a landscape photo, the key information may include the keyword "landscape photo". The first user's SIM card generates cover content based on the keyword and sends it to the media platform for display. The cover content may include the keyword and may also include the user ID of the first user. The second user's SIM card accesses the media platform to obtain the cover content, and in response to the second user's triggering operation on the cover content (such as the second user clicking a view button), sends a request to the media platform. In response to the acquisition request, the media platform sends the first ciphertext to the second user's SIM card.
[0063] For example, the media platform is an instant messaging platform. Figure 5 As shown, the instant messaging platform sends the cover content to the instant messaging window between the second user and the first user, and the second user's SIM card responds to the second user's viewing operation of the cover content and sends a request to the media platform. In response to the request, the media platform sends the first ciphertext to the second user's SIM card.
[0064] In the above implementation, the first user's SIM card first shares the first ciphertext and the cover content of the target data to the media platform. When the second user requests to view the cover content, the media platform sends the first ciphertext to the second user's SIM card, thereby increasing the second user's autonomy and flexibility in accepting sharing.
[0065] In the data sharing method provided by the embodiment of the present application, when the first user requests to share the target data, the SIM card of the first user obtains the first authentication certificate for this sharing from the blockchain node, and uses the first authentication certificate and the private key of the first user to encrypt the target data to obtain the first ciphertext and send it to the SIM card of the second user. The authentication certificate is obtained by the blockchain node encrypting the user information of the first user and the user information of the second user based on the authentication key of the second user stored in the blockchain. Since the blockchain has the characteristics of decentralization and non-tamperability, and only the SIM card of the second user has the authentication key and user information of the second user except the blockchain node, only the blockchain node and the SIM card of the second user can obtain the first authentication certificate, and then obtain the target data from the first ciphertext. In this way, the encrypted sharing of the target data between the first user and the second user is realized, and the modification, deletion, etc. of the target data during the sharing process is avoided, and the security and credibility of data sharing are improved, especially the security and credibility of cross-platform data sharing.
[0066] Please refer to Figure 6 , is a flow chart of a data sharing method provided by an embodiment of the present application, the method is applied to a blockchain node, and the method comprises the following steps: S602, obtaining an authentication key of a second user and user information of the second user from the blockchain.
[0067] The second user is the user who is to receive the target data shared by the first user. The blockchain stores a large amount of user information, public keys, authentication keys, etc. Since the blockchain has the characteristics of decentralization and immutability, the transmission and storage of this information becomes safer, more efficient and more reliable.
[0068] In one embodiment, upon receiving the user identification of the second user sent by the SIM card of the first user, the blockchain node calls the smart contract to obtain the authentication key and user information of the second user from the blockchain.
[0069] In another embodiment, when the blockchain node receives the first relationship category sent by the SIM card of the first user, it calls the smart contract to obtain from the blockchain the user information of the user whose relationship with the first user belongs to the first relationship category as the user information of the second user, and obtains the authentication key of the second user from the blockchain.
[0070] For example, the blockchain stores user information, authentication keys, public keys, etc. of user A to user F, as well as the relationship categories among these users. Assume that user A, user B, and user D have a relationship category of friends. If the blockchain node receives the first relationship category "friends" sent by user A's SIM card, it obtains user information and authentication key of user B, and user information and authentication key of user D from the blockchain.
[0071] Through the above implementation, there is no need to transmit specific user information and user relationship data between the first user's SIM card and the blockchain node. Only the relationship category is transmitted, which can avoid the leakage of privacy information and further improve the security of the data sharing process.
[0072] S604: Encrypt the user information of the second user based on the authentication key of the second user to obtain a first authentication credential.
[0073] In the embodiment of the present application, S604 may be implemented in various appropriate ways.
[0074] In one embodiment, the number of authentication keys is at least two. In this case, the above S604 includes the following steps: S641: Determine a first authentication key and a second authentication key from at least two authentication keys.
[0075] As an example, two authentication keys may be randomly selected from at least two authentication keys, one of the authentication keys is used as the first authentication key, and the other authentication key is used as the second authentication key.
[0076] S642: Encrypt the user information of the first user based on the first authentication key to obtain a fourth ciphertext.
[0077] The user information is encrypted using the authentication key, and various encryption algorithms commonly used in the art may be used, such as but not limited to the DES (Data Encryption Standard) algorithm, the 3DES (Triple DES) algorithm, the AES (Advanced Encryption Standard) algorithm, etc., which are not limited to the embodiments of the present application.
[0078] S643: Encrypt the user information of the second user based on the second authentication key to obtain a fifth ciphertext.
[0079] S644: Generate a first authentication credential based on the fourth ciphertext and the fifth ciphertext.
[0080] As an example, the fourth ciphertext and the fifth ciphertext are concatenated to obtain a sixth ciphertext; then, a hash operation is performed on the sixth ciphertext, and the obtained hash value is used as the first authentication credential corresponding to the second user.
[0081] As another example, the fourth ciphertext and the fifth ciphertext are concatenated, and the concatenated ciphertext is used as the first authentication credential corresponding to the second user.
[0082] In the above embodiment, the first authentication key and the second authentication key determined from at least two authentication keys have high randomness. The two user information are encrypted respectively using the two authentication keys to obtain two ciphertexts, and then the first authentication credential is generated based on the two ciphertexts. This can increase the difficulty of cracking the first authentication credential, thereby further improving the security of data sharing.
[0083] The above shows some implementation methods of the above S604. Of course, it should be understood that the above S604 can also be implemented in other ways, and the embodiments of the present application are not limited to this. For example, the second user's authentication key is used to encrypt only the second user's user information to obtain the first authentication certificate. For another example, after the second user's user information is encrypted using the second user's authentication key, the encryption result is re-encrypted using the second user's public key to obtain the first authentication certificate.
[0084] It is worth noting that the first authentication credential corresponds to the second user one-to-one. That is to say, when there are multiple second users, the blockchain node encrypts the user information of each second user based on the authentication key of the second user to obtain the first authentication credential corresponding to the second user.
[0085] S606: Send the first authentication credential to the SIM card of the first user.
[0086] The first authentication credential is used by the SIM card of the first user to encrypt the target data and then send it to the SIM card of the second user.
[0087] In another embodiment, after the above S606, the method provided in the embodiment of the present application may further include: in response to the decryption request of the SIM card of the second user, calling the smart contract, encrypting the public key of the first user based on the public key of the second user to obtain a third ciphertext; and returning the third ciphertext to the SIM card of the second user. Since the private key of the second user is only stored in the SIM card of the second user, only the SIM card of the second user can decrypt the public key of the first user, which can prevent the public key of the first user from being obtained by illegal persons and cracking the target data, thereby further improving the security of data sharing.
[0088] In another embodiment, the blockchain node may also directly return the public key of the first user to the SIM card of the second user in response to the decryption request of the SIM card of the second user.
[0089] In the data sharing method provided by the embodiment of the present application, when the first user requests to share the target data, the SIM card of the first user obtains the first authentication certificate for this sharing from the blockchain node, and uses the first authentication certificate and the private key of the first user to encrypt the target data to obtain the first ciphertext and send it to the SIM card of the second user. The authentication certificate is obtained by the blockchain node encrypting the user information of the first user and the user information of the second user based on the authentication key of the second user stored in the blockchain. Since the blockchain has the characteristics of decentralization and non-tamperability, and only the SIM card of the second user has the authentication key and user information of the second user except the blockchain node, only the blockchain node and the SIM card of the second user can obtain the first authentication certificate, and then obtain the target data from the first ciphertext. In this way, the encrypted sharing of the target data between the first user and the second user is realized, and the modification, deletion, etc. of the target data during the sharing process is avoided, and the security and credibility of data sharing are improved, especially the security and credibility of cross-platform data sharing.
[0090] Please refer to Figure 7 , is a flow chart of a data sharing method provided by an embodiment of the present application, the method is applied to a SIM card of a second user, and the method comprises the following steps: S702: Receive a first ciphertext from a SIM card of a first user.
[0091] The first ciphertext is obtained by encrypting the target data by the SIM card of the first user based on the first authentication certificate and the private key of the first user. The first authentication certificate is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain.
[0092] S704: Generate a second authentication credential based on the authentication key and user information of the second user stored locally in the SIM card of the second user.
[0093] The specific implementation of the above S704 is Figure 6 The specific implementation of S604 in the illustrated embodiment is similar and will not be described in detail.
[0094] S706, decrypt the first ciphertext based on the second authentication credential and the public key of the first user to obtain target data.
[0095] In the embodiment of the present application, the above S706 can be implemented in various appropriate ways.
[0096] In one embodiment, the first ciphertext is obtained by inserting the first authentication credential into the data header of the second ciphertext, and the second ciphertext is obtained by encrypting the target data based on the private key of the first user. In this case, the above S706 includes: obtaining the first authentication credential and the second ciphertext from the first ciphertext; if the first authentication credential is consistent with the second authentication credential, sending a decryption request to the blockchain node, wherein the decryption request is used to request the public key of the first user; decrypting the second ciphertext based on the public key of the first user returned by the blockchain node to obtain the target data.
[0097] Considering that the number of authentication keys is at least two, the generation of the first authentication credential is random. In order to avoid misjudgment, if the first authentication credential is inconsistent with the second authentication credential, the operation of generating the second authentication credential and comparing the generated second authentication credential with the first authentication credential is repeated; if the comparison is consistent again, it is determined that the second user is an access user allowed by the first user; if the comparison is inconsistent again, it is determined that the second user is not an access user allowed by the first user.
[0098] For example, assume that the SIM card of user B receives the first ciphertext from the SIM card of user A and obtains the first authentication credential HE from the data header of the first ciphertext. B , user B's authentication key includes authentication key E 1 and authentication key E 2 .
[0099] In the first comparison process, user B's SIM card uses the authentication key E 1 Encrypt user A's user information to obtain the fourth ciphertext E 1-1 , use the authentication key to encrypt the user information of user B to obtain the fifth ciphertext E 1-2 , for the fourth ciphertext E 1-1 And the fifth ciphertext E 1-2 Perform splicing to obtain the splicing result E1-0 ; Then, the splicing result E 1-0 Perform hash operation to obtain the second authentication certificate HE B-1 If the second authentication certificate HE B-1 HE with first certification credentials B If the first ciphertext contains the public key of user A, user B is determined to be an access user allowed by user A, and then user B's SIM card sends a decryption request to the blockchain node to obtain user A's public key, so as to obtain the target data shared by user A from the first ciphertext. B-1 If it is inconsistent with the first authentication credential, the second comparison process will begin.
[0100] In the second comparison process, user B's SIM card uses the authentication key E 2Encrypt user A's user information to obtain the fourth ciphertext E 2-1 , using the authentication key E 1 Encrypt user B's user information to obtain the fifth ciphertext E 2-2 , for the fourth ciphertext E 2-1 And the fifth ciphertext E 2-2 Perform splicing to obtain the splicing result E 2-0 ; Then, the splicing result E 2-0 Perform hash operation to obtain a new second authentication hit HEB-2. B-2 HE with first certification credentials B If the second authentication credential HE is consistent, it is determined that the user is the access user allowed by user A, and then user B's SIM card sends a decryption request to the blockchain node to obtain user A's public key, so as to obtain the target data shared by user A from the first ciphertext. B-2 If it is inconsistent with the first authentication credential, it is determined that user B is not an access user allowed by user A, and the operation ends.
[0101] It is worth noting that if the blockchain node returns the third ciphertext obtained by encrypting the first user's public key with the second user's public key, the second user's SIM card obtains the second user's private key locally, decrypts the third ciphertext with the second user's private key, and obtains the first user's public key.
[0102] In another embodiment, the above S706 includes the following steps: sending a decryption request to the blockchain node, and receiving the public key of the first user returned by the blockchain node; then, based on the encryption and decryption method pre-negotiated and determined with the SIM card of the first user, using the second authentication certificate and the public key of the first user, decrypting the first ciphertext; if the decryption is successful, the target data is obtained; if the decryption fails, repeating the above operations of generating the second authentication certificate to decrypting the first ciphertext until the preset stop decryption condition is met, the operation is terminated. Among them, the stop decryption condition can be set according to actual needs, such as the number of decryption times reaching a threshold number, etc., which is not limited in the embodiment of the present application.
[0103] In another embodiment, the SIM card of the second user also discards the public key of the first user after the operation is completed to prevent the public key of the first user from being obtained by illegal persons, thereby further improving the security of the target data.
[0104] In the data sharing method provided by the embodiment of the present application, when the first user requests to share the target data, the SIM card of the first user obtains the first authentication certificate for this sharing from the blockchain node, and uses the first authentication certificate and the private key of the first user to encrypt the target data to obtain the first ciphertext and send it to the SIM card of the second user. The authentication certificate is obtained by the blockchain node encrypting the user information of the first user and the user information of the second user based on the authentication key of the second user stored in the blockchain. Since the blockchain has the characteristics of decentralization and non-tamperability, and only the SIM card of the second user has the authentication key and user information of the second user except the blockchain node, only the blockchain node and the SIM card of the second user can obtain the first authentication certificate, and then obtain the target data from the first ciphertext. In this way, the encrypted sharing of the target data between the first user and the second user is realized, and the modification, deletion, etc. of the target data during the sharing process is avoided, and the security and credibility of data sharing are improved, especially the security and credibility of cross-platform data sharing.
[0105] To facilitate the understanding of the data sharing method provided in the embodiment of the present application, Figure 8 , the interaction process between the first user's SIM card, the second user's SIM card, the media platform and the user terminal is described in detail. Figure 8 A flow chart of a data sharing method provided for an embodiment of the present application describes a specific implementation method of interaction between the first user's SIM card, the second user's SIM card, the blockchain, and the media platform. Figure 8 As shown, the method comprises the following steps: S801, when the first user requests to share target data, the SIM card of the first user displays a first sharing interface. The first sharing interface includes a first option. The first option is used to share the encrypted target data.
[0106] S802: The SIM card of the first user displays a second sharing interface in response to a selection operation on the first option.
[0107] The second sharing interface includes at least one relationship category.
[0108] S803: The SIM card of the first user sends the selected first relationship category to the blockchain node in response to a selection operation of at least one relationship category.
[0109] The first relationship category is used to indicate that a user whose relationship with the first user belongs to the first relationship category is to be the second user.
[0110] S804, based on the first relationship category, the blockchain node calls the smart contract to obtain from the blockchain the user information and authentication key of the second user whose relationship with the first user belongs to the first relationship category, and generates a first authentication credential based on the user information and authentication key of the second user and returns it to the SIM card of the first user.
[0111] S805: The SIM card of the first user encrypts the target data based on the first authentication credential and the private key of the first user to obtain a first ciphertext.
[0112] S806: The SIM card of the first user generates a content cover of the target data based on the key information of the target data.
[0113] S807: The SIM card of the first user sends the content cover and the first ciphertext to the media platform.
[0114] S808: The SIM card of the second user sends a request for obtaining the first ciphertext to the media platform in response to the second user's viewing operation on the content cover.
[0115] S809: The media platform sends the first ciphertext to the SIM card of the second user in response to the acquisition request.
[0116] S810: The SIM card of the second user generates a second authentication credential based on the authentication key and user information of the second user stored locally in the SIM card of the second user.
[0117] S811, the SIM card of the second user obtains the first authentication credential and the second ciphertext from the first ciphertext.
[0118] S812: If the first authentication credential is consistent with the second authentication credential, the SIM card of the second user sends a decryption request to the blockchain node.
[0119] The decryption request is used to request to obtain the public key of the first user.
[0120] S813, the blockchain node responds to the decryption request, calls the smart contract, uses the public key of the second user to encrypt the public key of the first user to obtain a third ciphertext, and returns the third ciphertext to the SIM card of the second user.
[0121] S814: The SIM card of the second user decrypts the third ciphertext using the private key of the second user to obtain the public key of the first user.
[0122] S815, the SIM card of the second user decrypts the second ciphertext using the second authentication credential to obtain the target data.
[0123] In this way, encrypted sharing of target data between the first user and the second user is achieved, which prevents the target data from being modified or deleted during the sharing process, thereby improving the security and credibility of data sharing, especially the security and credibility of cross-platform data sharing.
[0124] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0125] Based on the same inventive concept, the present application embodiment also provides a data sharing device. Fig. 9 , is a structural diagram of a data sharing device 900 provided in an embodiment of the present application, and the device 900 is applied to a SIM card of a first user. In a software implementation, the data sharing device 900 includes: A first acquisition module 910 is used to acquire a first authentication credential from a blockchain node when the first user requests to share target data; the first authentication credential is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain; A first encryption module 920, configured to encrypt the target data based on the first authentication credential and the private key of the first user to obtain a first ciphertext; The first sending module 930 is configured to send the first ciphertext to the SIM card of the second user.
[0126] In another embodiment, the first acquisition module is used to: In the case where the first user requests to share the target data, displaying a first sharing interface, the first sharing interface including a first option, the first option being used to share the encrypted target data; In response to a selection operation on the first option, displaying a second sharing interface, wherein the second sharing interface includes at least one relationship category; In response to a selection operation of the at least one relationship category, sending a selected first relationship category to a blockchain node, wherein the first relationship category is used to indicate that a user whose relationship with the first user belongs to the first relationship category is to be a second user; Receive a first authentication credential returned by the blockchain node.
[0127] In another embodiment, the first encryption module is used to: Encrypting the target data based on the private key of the first user to obtain a second ciphertext; Insert the first authentication credential into the data header of the second ciphertext to obtain the first ciphertext.
[0128] In another embodiment, the first sending module is used to: Based on the key information of the target data, generating a content cover of the target data; The content cover and the first ciphertext are sent to a media platform for display, so that the media platform can send the first ciphertext to the SIM card of the second user in response to a triggering operation of the content cover by the second user.
[0129] Obviously, the data sharing device in the embodiment of this specification can be used as the above Figure 2 The execution subject of the data sharing method shown in FIG. Figure 2 The functions realized are as follows. Since the principles are the same, they will not be described here.
[0130] Based on the same inventive concept, the present application embodiment also provides a data sharing device. Fig.10 , is a schematic diagram of a data sharing device 1000 provided in one embodiment of the present application, and the device 1000 is applied to a blockchain node. In a software implementation, the data sharing device 1000 includes: A second acquisition module 1010 is used to acquire an authentication key of a second user and user information of the second user from the blockchain, where the second user is a user to receive the target data shared by the first user; A second encryption module 1020, configured to encrypt the user information of the second user based on the authentication key to obtain a first authentication credential; The second sending module 1030 is configured to send the first authentication credential to the SIM card of the first user, where the first authentication credential is used by the SIM card of the first user to encrypt the target data and then send the encrypted data to the SIM card of the second user.
[0131] In another embodiment, the second acquisition module is used to: In the case of receiving the first relationship category sent by the SIM card of the first user, the smart contract is called to obtain from the blockchain the user information of the user whose relationship with the first user belongs to the first relationship category as the user information of the second user, and the authentication key of the second user is obtained from the blockchain.
[0132] In another embodiment, the second encryption module is further used to call the smart contract in response to a decryption request of the SIM card of the second user, and encrypt the public key of the first user based on the public key of the second user to obtain a third ciphertext; The second sending module is further used to return the third ciphertext to the SIM card of the second user; The decryption request is sent to the blockchain node when the SIM card of the second user receives the first ciphertext, the first ciphertext is obtained by encrypting the target data by the SIM card of the first user based on the first authentication credential and the private key of the first user, and the public key of the first user is used to obtain the target data from the first ciphertext.
[0133] In another embodiment, the number of the authentication keys is at least two; The second encryption module is used for: determining a first authentication key and a second authentication key from at least two of the authentication keys; Encrypting the user information of the first user based on the first authentication key to obtain a fourth ciphertext; Encrypting the user information of the second user based on the second authentication key to obtain a fifth ciphertext; A first authentication credential is generated based on the fourth ciphertext and the fifth ciphertext.
[0134] Obviously, the data sharing device in the embodiment of this specification can be used as the above Figure 6 The execution subject of the data sharing method shown in FIG. Figure 6 The functions realized are as follows. Since the principles are the same, they will not be described here.
[0135] Based on the same inventive concept, the present application embodiment also provides a data sharing device. Fig.11 , is a schematic diagram of a data sharing device 1100 provided in an embodiment of the present application, and the device 1100 is applied to a SIM card of a second user. In a software implementation, the data sharing device 1100 includes: A first receiving module 1110 is configured to receive a first ciphertext from a SIM card of a first user; the first ciphertext is obtained by encrypting the target data by the SIM card of the first user based on the first authentication credential and the private key of the first user, and the first authentication credential is generated by a blockchain node based on the authentication key and user information of the second user stored in the blockchain; A third encryption module 1120, configured to generate a second authentication credential based on the authentication key and user information of the second user stored locally on the SIM card of the second user; The first decryption module 1130 is used to decrypt the first ciphertext based on the second authentication credential and the public key of the first user to obtain the target data.
[0136] In another embodiment, the first ciphertext is obtained by inserting the first authentication credential into a data header of a second ciphertext, and the second ciphertext is obtained by encrypting the target data based on a private key of the first user; The first decryption module is used for: Obtaining the first authentication credential and the second ciphertext from the first ciphertext; If the first authentication credential is consistent with the second authentication credential, sending a decryption request to the blockchain node, wherein the decryption request is used to request to obtain the public key of the first user; The second ciphertext is decrypted based on the public key of the first user returned by the blockchain node to obtain the target data.
[0137] Obviously, the data sharing device in the embodiment of this specification can be used as the above Figure 7 The execution subject of the data sharing method shown in FIG. Figure 7 The functions realized are as follows. Since the principles are the same, they will not be described here.
[0138] Fig.12 This is a schematic diagram of the structure of a SIM card in an embodiment of the present application. Fig.12 At the hardware level, the SIM card includes a processor, and optionally an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the SIM card may also include hardware required for other services.
[0139] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.12 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0140] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0141] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data sharing device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations: When the first user requests to share the target data, obtaining a first authentication credential from the blockchain node; the first authentication credential is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain; Encrypting the target data based on the first authentication credential and the first user's private key to obtain a first ciphertext; The first ciphertext is sent to the SIM card of the second user.
[0142] Or, specifically, to do the following: Receive a first ciphertext from a SIM card of a first user; the first ciphertext is obtained by encrypting target data by the SIM card of the first user based on a first authentication credential and a private key of the first user, and the first authentication credential is generated by a blockchain node based on an authentication key and user information of a second user stored in the blockchain; generating a second authentication credential based on the authentication key and user information of the second user stored locally on the SIM card of the second user; The first ciphertext is decrypted based on the second authentication credential and the public key of the first user to obtain the target data.
[0143] The above application Figure 2 or Figure 7The method performed by the data sharing device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0144] The SIM card can also perform Figure 2 method, and realize the data sharing device in Figure 2 Alternatively, the SIM card may also perform the functions of the embodiment shown. Figure 7 method, and realize the data sharing device in Figure 7 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0145] Of course, in addition to the software implementation, the SIM card of the present application does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0146] Fig.13 This is a schematic diagram of the structure of a blockchain node in an embodiment of the present application. Please refer to Fig.13At the hardware level, the blockchain node includes a processor, and optionally an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the blockchain node may also include hardware required for other services.
[0147] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0148] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0149] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data sharing device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations: Obtaining an authentication key of a second user and user information of the second user from the blockchain, where the second user is a user to receive the target data shared by the first user; Encrypting the user information of the second user based on the authentication key to obtain a first authentication credential; The first authentication credential is sent to the SIM card of the first user. The first authentication credential is used by the SIM card of the first user to encrypt the target data and then send the encrypted data to the SIM card of the second user.
[0150] The above application Figure 6The method performed by the data sharing device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0151] The blockchain node can also execute Figure 6 method, and realize the data sharing device in Figure 6 The functions of the illustrated embodiment will not be described in detail in the embodiments of the present application.
[0152] Of course, in addition to software implementation methods, the blockchain node of this application does not exclude other implementation methods, such as logical devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logical unit, but can also be hardware or logical devices.
[0153] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a SIM card including multiple application programs, enable the SIM card to execute Figure 2 The method of the embodiment shown is specifically used to perform the following operations: When the first user requests to share the target data, obtaining a first authentication credential from the blockchain node; the first authentication credential is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain; Encrypting the target data based on the first authentication credential and the first user's private key to obtain a first ciphertext; The first ciphertext is sent to the SIM card of the second user.
[0154] The present application also provides a computer-readable storage medium that stores one or more programs, wherein the one or more programs include instructions that, when executed by a blockchain node that includes multiple application programs, enable the blockchain node to execute Figure 6 The method of the embodiment shown is specifically used to perform the following operations: Obtaining an authentication key of a second user and user information of the second user from the blockchain, where the second user is a user to receive the target data shared by the first user; Encrypting the user information of the second user based on the authentication key to obtain a first authentication credential; The first authentication credential is sent to the SIM card of the first user. The first authentication credential is used by the SIM card of the first user to encrypt the target data and then send the encrypted data to the SIM card of the second user.
[0155] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a SIM card including multiple application programs, enable the SIM card to execute Figure 7 The method of the embodiment shown is specifically used to perform the following operations: Receiving a first ciphertext from a SIM card of a first user; the first ciphertext is obtained by encrypting target data by the SIM card of the first user based on a first authentication credential and a private key of the first user, and the first authentication credential is generated by a blockchain node based on an authentication key and user information of the second user stored in a blockchain; generating a second authentication credential based on the authentication key and user information of the second user stored locally on the SIM card of the second user; The first ciphertext is decrypted based on the second authentication credential and the public key of the first user to obtain the target data.
[0156] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps in the data sharing method provided in the embodiment of the present application.
[0157] In short, the above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0158] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0159] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0160] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0161] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
Claims
1. A data sharing method, characterized in that: Applied to a SIM card of a first user, the method comprises: When the first user requests to share the target data, obtaining a first authentication credential from the blockchain node; the first authentication credential is generated by the blockchain node based on the authentication key and user information of the second user stored in the blockchain; Encrypting the target data based on the first authentication credential and the first user's private key to obtain a first ciphertext; The first ciphertext is sent to the SIM card of the second user.
2. The method according to claim 1, characterized in that The step of obtaining a first authentication credential from a blockchain node when the first user requests to share target data includes: In the case where the first user requests to share the target data, displaying a first sharing interface, the first sharing interface including a first option, the first option being used to share the encrypted target data; In response to a selection operation of the first option, displaying a second sharing interface, wherein the second sharing interface includes at least one relationship category; In response to a selection operation of the at least one relationship category, sending a selected first relationship category to a blockchain node, wherein the first relationship category is used to indicate that a user whose relationship with the first user belongs to the first relationship category is to be a second user; Receive a first authentication credential returned by the blockchain node.
3. The method according to claim 1, characterized in that The step of encrypting the target data based on the first authentication credential and the private key of the first user to obtain a first ciphertext includes: Encrypting the target data based on the private key of the first user to obtain a second ciphertext; Insert the first authentication credential into the data header of the second ciphertext to obtain the first ciphertext.
4. The method according to claim 1, characterized in that The sending the first ciphertext to the SIM card of the second user comprises: Based on the key information of the target data, generating a content cover of the target data; The content cover and the first ciphertext are sent to a media platform, so that the media platform sends the first ciphertext to a SIM card of the second user in response to a triggering operation of the second user on the content cover.
5. A data sharing method, characterized in that: Applied to a blockchain node, the method comprises: Obtaining an authentication key of a second user and user information of the second user from the blockchain, where the second user is a user to receive the target data shared by the first user; Encrypting the user information of the second user based on the authentication key to obtain a first authentication credential; The first authentication credential is sent to the SIM card of the first user. The first authentication credential is used by the SIM card of the first user to encrypt the target data and then send the encrypted data to the SIM card of the second user.
6. The method according to claim 5, characterized in that The obtaining the authentication key of the second user and the user information of the second user from the blockchain includes: In the case of receiving the first relationship category sent by the SIM card of the first user, the smart contract is called to obtain from the blockchain the user information of the user whose relationship with the first user belongs to the first relationship category as the user information of the second user, and the authentication key of the second user is obtained from the blockchain.
7. The method according to claim 6, characterized in that After sending the first authentication credential to the SIM card of the first user, the method further includes: In response to a decryption request from the SIM card of the second user, calling a smart contract, and encrypting the public key of the first user based on the public key of the second user to obtain a third ciphertext; Returning the third ciphertext to the SIM card of the second user; The decryption request is sent to the blockchain node when the SIM card of the second user receives the first ciphertext, the first ciphertext is obtained by encrypting the target data by the SIM card of the first user based on the first authentication credential and the private key of the first user, and the public key of the first user is used to obtain the target data from the first ciphertext.
8. The method according to claim 5, characterized in that The number of the authentication keys is at least two; The encrypting the user information of the second user based on the authentication key to obtain the first authentication credential includes: Determining a first authentication key and a second authentication key from at least two of the authentication keys; Encrypting the user information of the first user based on the first authentication key to obtain a fourth ciphertext; Encrypting the user information of the second user based on the second authentication key to obtain a fifth ciphertext; A first authentication credential is generated based on the fourth ciphertext and the fifth ciphertext.
9. A data sharing method, characterized in that: Applied to the SIM card of the second user, the method comprises: Receiving a first ciphertext from a SIM card of a first user; the first ciphertext is obtained by encrypting target data by the SIM card of the first user based on a first authentication credential and a private key of the first user, and the first authentication credential is generated by a blockchain node based on an authentication key and user information of the second user stored in a blockchain; generating a second authentication credential based on the authentication key and user information of the second user stored locally on the SIM card of the second user; The first ciphertext is decrypted based on the second authentication credential and the public key of the first user to obtain the target data.
10. The method according to claim 9, characterized in that The first ciphertext is obtained by inserting the first authentication credential into a data header of the second ciphertext, and the second ciphertext is obtained by encrypting the target data based on the private key of the first user; The decrypting the first ciphertext based on the second authentication credential and the public key of the first user to obtain the target data includes: Obtaining the first authentication credential and the second ciphertext from the first ciphertext; If the first authentication credential is consistent with the second authentication credential, sending a decryption request to the blockchain node, wherein the decryption request is used to request to obtain the public key of the first user; The second ciphertext is decrypted based on the public key of the first user returned by the blockchain node to obtain the target data.
Citation Information
Patent Citations
File authorization access method, device and system based on block chain
CN110636043A
E-mail encryption method, first client and blockchain system
CN111464494A
Privacy protection method and device based on block chain and electronic equipment
CN112199714A
Authentication information processing method, device and equipment and storage medium
CN112199721A
File transmission method and device, electronic equipment and computer readable medium
CN114268447A