Information processing method, device, equipment and storage medium for decentralized applications
By verifying and encrypting users' social information in decentralized applications, information security issues are solved, ensuring that information can only be decrypted during authorized times, improving application security.
Patent Information
- Application Number
- CN202010212033.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-24
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-03-24
AI Technical Summary
Information security issues in decentralized applications. Users can view application information in the blockchain at any time, which increases the risk of information being used casually.
By obtaining the user's social information, it is sent to the blockchain consensus node to verify whether it contains sensitive information. If there is no sensitive information, it is encrypted and stored in the blockchain. The release information is generated and displayed on the target application interface. The encrypted information is only allowed in Decryption at a specific time.
It significantly improves the information security of decentralized applications, prevents information from being obtained by unauthorized users, and reduces information security risks.
Smart Images

Figure CN111444202B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an information processing method, apparatus, device and storage medium for decentralized applications. Background Art
[0002] With the development of blockchain technology, many Dapps (Decentralized Applications) have appeared on the blockchain network, such as game Dapps, shopping Dapps, etc.
[0003] As the types of decentralized applications increase, the information security of decentralized applications becomes particularly important. However, for most decentralized applications, although the application information can be stored in the blockchain and due to the immutability of the blockchain, the application information in the blockchain will not be tampered with. However, since users can access the blockchain at any time, the application information of decentralized applications can also be viewed by users at any time, and the application information displayed on the application interface of decentralized applications is also easily obtained by other users, thereby increasing the risk of decentralized applications being used arbitrarily by users. Therefore, how to improve the information security of decentralized applications has become an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, device, and storage medium for information processing of a decentralized application, which can improve the information security of the decentralized application and have high applicability.
[0005] The present application provides a method for processing information of a decentralized application, the method comprising:
[0006] Obtaining social information of the first user, and sending the social information to a consensus node in the blockchain, so that the consensus node verifies whether the social information contains sensitive information, and the social information carries a publishing address of the social information;
[0007] When the social information does not contain the sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in the blockchain;
[0008] Obtaining a storage address of the first encrypted social information, and generating publishing information according to the storage address and the first encrypted social information;
[0009] A first target application interface is determined according to the publishing address of the social information, and the published information is displayed to the first user on the first target application interface.
[0010] The present application embodiment provides an information processing device for a decentralized application, the device comprising:
[0011] A first acquisition module is used to acquire the social information of the first user, and send the social information to a consensus node in the blockchain, so that the consensus node verifies whether the social information contains sensitive information, and the social information carries a publishing address of the social information;
[0012] an encryption module, configured to, when the social information does not contain the sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in the blockchain;
[0013] A second acquisition module is used to acquire the storage address of the first encrypted social information, and generate the release information according to the storage address and the first encrypted social information;
[0014] The first determination module is used to determine a first target application interface according to the publishing address of the social information, and display the published information to the first user on the first target application interface.
[0015] In a possible implementation, the encryption module includes:
[0016] A first determining unit, configured to determine at least one plaintext block according to the social information;
[0017] The encryption unit is used to encrypt each plaintext block according to the encryption key of the decentralized application to obtain at least one ciphertext block, and generate the first encrypted social information of the social information according to the at least one ciphertext block.
[0018] In a possible implementation, the encryption module includes:
[0019] a signing unit, configured to send a private key acquisition request to the first user to acquire the private key and the first user identifier of the first user, and to sign the first encrypted social information according to the private key to obtain the second encrypted social information;
[0020] A marking unit is used to mark the second encrypted social information according to the first user identifier, and store the marked second encrypted social information in the blockchain.
[0021] In a possible implementation manner, the social information further carries a target date; and the encryption unit includes:
[0022] a generating unit, configured to generate a decryption time identifier according to the target date, and mark the first encrypted social information according to the decryption time identifier, wherein the decryption time identifier is used to mark that the first encrypted social information is allowed to be decrypted before the target date;
[0023] A storage unit is used to store the marked first encrypted social information in the above-mentioned blockchain.
[0024] In a possible implementation manner, the above device further includes:
[0025] The third acquisition module is further configured to, when receiving a viewing request from a second user for viewing the published information, obtain the storage address from the published information, and obtain the first encrypted social information from the blockchain according to the storage address;
[0026] The second determination module is further used to determine the at least one ciphertext block according to the first encrypted social information, and decrypt the at least one ciphertext block according to the decryption key of the decentralized application to obtain the at least one plaintext block;
[0027] The third determination module is further used to determine the above-mentioned social information according to the above-mentioned at least one plaintext block, and display the above-mentioned social information to the above-mentioned second user on the second target application interface.
[0028] In a possible implementation, the third acquisition module includes:
[0029] A first acquisition unit is used to acquire the second encrypted social information from the blockchain according to the storage address, and determine whether the second encrypted social carries the first user identifier;
[0030] a sending unit, configured to send a public key acquisition request carrying a second user identifier of the second user to the first user when the second encrypted social information carries the first user identifier, so as to obtain the public key of the first user, wherein the second user identifier enables the first user to determine whether to allow the second user to view the social information;
[0031] A decryption unit is used to decrypt the second encrypted social information according to the public key to obtain the first encrypted social information.
[0032] In a possible implementation, the second determining module includes:
[0033] A second acquisition unit is used to determine an acquisition date of the first encrypted social information from the blockchain, and determine the target date according to the decryption identifier carried by the first encrypted social information;
[0034] The second determining unit is configured to match the acquisition date with the target date, and when the acquisition date is before the target date, determine the at least one ciphertext block according to the first encrypted social information.
[0035] In a third aspect, an embodiment of the present application provides a device, the device comprising a processor and a memory, the processor and the memory being connected to each other. The memory is used to store a computer program that supports the terminal device to execute the method provided by any of the above possible implementations, the computer program comprising program instructions, and the processor is configured to call the above program instructions to execute the method provided by any of the above possible implementations.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method provided by any possible implementation method described above.
[0037] In the embodiment of the present application, when a decentralized application publishes a user's social information, it can verify whether there is sensitive information in the social information according to the consensus node, which can reduce information security issues caused by sensitive information. Furthermore, the decentralized application can encrypt the social information to obtain encrypted information, and display the published information obtained from the encrypted information on the application interface, so that other users can only view the encrypted social information on the application interface, which greatly improves the information security of the decentralized application and has high applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 It is a scenario diagram of the information processing method of the decentralized application provided in the embodiment of the present application;
[0040] Figure 2 It is a flow chart of the information processing method of the decentralized application provided in the embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of a scenario for encrypting social information provided by an embodiment of the present application;
[0042] Figure 4 is another schematic diagram of a scenario for encrypting social information provided by an embodiment of the present application;
[0043] Figure 5 It is a schematic diagram of the block structure provided in the embodiment of the present application;
[0044] Figure 6 This is another flowchart of the information processing method of the decentralized application provided in the embodiment of the present application;
[0045] Figure 7 It is a schematic diagram of a scenario for verifying a viewing request provided in an embodiment of the present application;
[0046] Figure 8 It is a structural diagram of an information processing device for a decentralized application provided in an embodiment of the present application;
[0047] Fig. 9 It is a schematic diagram of the structure of the device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. 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 creative work are within the scope of protection of this application.
[0049] See also Figure 1 , Figure 1 Schematic diagram of the information processing method of decentralized applications provided by the embodiment of the present application. Figure 1 In the example, the decentralized application 10 runs on the blockchain 30. When the user 10 publishes social information through the decentralized application 20, the decentralized application 10 can obtain the social information of the user 10. To ensure that the published information of the user 10 does not contain sensitive information, the decentralized application 20 can send the social information to the consensus node in the blockchain 30, so that the consensus node in the blockchain 30 verifies whether the social information contains sensitive information. When the social information does not contain sensitive information, the decentralized application 30 can encrypt the social information according to the preset encryption method to obtain encrypted social information, and store the encrypted social information in the blockchain 30. Further, the decentralized application 20 can generate the published information according to the storage address of the encrypted social information in the blockchain 30, and the encrypted social information obtained by encrypting the social information by the preset encryption method. At this time, the decentralized application can determine the target application interface 40 according to the publishing address carried in the social information, and display the published information to the user on the target application interface 40. At this time, when other users view the social information of the user 10 through the decentralized application 20 , the encrypted social information is displayed on the target application interface 40 , thereby improving the information security of the decentralized application 20 .
[0050] See also Figure 2 , Figure 2 It is a flow chart of the information processing method of the decentralized application provided in the embodiment of the present application. Figure 2 The information processing method of the decentralized application shown may include the following steps S201 to S204.
[0051] S201. Obtain social information of a first user, and send the social information to a consensus node in a blockchain, so that the consensus node verifies whether the social information contains sensitive information, and the social information carries a publishing address of the social information.
[0052] In some feasible implementations, when the first user accesses the decentralized application, the decentralized application can monitor the user operation instructions of the first user in real time, and when the information release instruction triggered by the user is detected, the decentralized application can obtain the social information of the first user. At the same time, the decentralized application can send the social information of the first user to the consensus node in the blockchain, so that the consensus node verifies whether the social information of the first user contains sensitive information. Specifically, each consensus node in the blockchain can verify whether the social information of the first user contains sensitive words, and each consensus node sends a signature confirmation message to the decentralized application when it is determined that the social information of the first user does not contain sensitive information. The decentralized application can receive the signature confirmation message sent by each consensus node, and when the number of signature confirmation messages received exceeds half of the number of all consensus nodes in the blockchain, the decentralized application can determine that the social information of the first user does not contain sensitive information. Among them, the signature confirmation message sent by each consensus node is encrypted and signed by the private key of the consensus node, which can ensure that the signature confirmation message will not be tampered with in the process of the consensus node sending the signature confirmation message to the decentralized application, and on the other hand, it can enable the decentralized application to determine the source of the signature confirmation message. Therefore, after receiving the signature confirmation message sent by the consensus node, the decentralized application can determine whether there is a signature confirmation message sent by the preset consensus node according to the digital signature of the signature confirmation message. If there is a signature confirmation message sent by the preset consensus node, the decentralized application can also determine that the social information of the first user does not contain sensitive information. It should be noted that the specific implementation method of the above-mentioned decentralized application based on the consensus node in the blockchain to verify whether the social information of the first user contains sensitive information can be determined according to the actual application scenario, and is not limited here. Among them, when each consensus node verifies the social information, it can determine whether the social information contains sensitive words in the above-mentioned preset sensitive word dictionary through the preset sensitive word dictionary. If the social information does not contain any sensitive words in the above-mentioned preset sensitive word dictionary, the consensus node can determine that the social information does not contain sensitive information. Optionally, the consensus node can also call a smart contract to enable other nodes with information recognition capabilities in the blockchain to verify whether there is sensitive information in the social information. Alternatively, the consensus node can also determine whether the URL link contained in the social information is an illegal link, or whether the content corresponding to the link is legal information, etc., which can be determined according to the actual application scenario, and is not limited here.
[0053] S202: When the social information does not contain sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in a blockchain.
[0054] In some feasible implementations, when the social information of the first user does not contain sensitive information, the decentralized application may encrypt the social information according to a preset encryption method to obtain the first encrypted social information. Specifically, the decentralized application may split the social information into at least one plaintext block, and the length of each plaintext block is the same. The specific length includes but is not limited to 64 bits, 128 bits, etc., which can be determined according to the actual application scenario and is not limited here. Furthermore, the decentralized application may encrypt each plaintext block according to the decentralized application's own encryption key to obtain ciphertext blocks equal to the number of plaintext blocks, so that the obtained at least one ciphertext block can be concatenated to obtain the first encrypted social information of the social information. See Figure 3 , Figure 3 Schematic diagram of a scenario for encrypting social information provided by an embodiment of the present application. Figure 3 As shown, assuming that the social information is a piece of information with a length of 192 bits, the decentralized application can split the social information into plaintext block 1, plaintext block 2 and plaintext block 3, and the length of each plaintext block is 64 bits. At this time, the decentralized application can use its own encryption key to encrypt each plaintext block to obtain ciphertext block 1, ciphertext block 2 and ciphertext block 3, and the length of each ciphertext block is 64 bits. Furthermore, the decentralized application can concatenate ciphertext block 1, ciphertext block 2 and ciphertext block 3 to obtain the first encrypted social information with a length of 192 bits.
[0055] Optionally, in some feasible trial methods, in order to further improve the security of social information, the decentralized application may introduce an initialization vector when using the decryption key to encrypt the social information. Specifically, after splitting the social information into multiple plaintext blocks, the decentralized application may use the encryption key to encrypt the initialization vector and the first plaintext block to obtain a ciphertext block containing the initialization vector. Furthermore, the decentralized application uses the encryption key to encrypt the ciphertext block corresponding to the first plaintext block and the second plaintext block to obtain the second ciphertext block, and so on until the last ciphertext block is obtained. At this time, the decentralized application may determine the last ciphertext block obtained as the first encrypted social information of the social information. See Figure 4 , Figure 4 FIG. 1 is another schematic diagram of another scenario of encrypting social information provided by an embodiment of the present application. Figure 4In the example, the decentralized application also splits the social information into three plaintext blocks (plaintext block 1, plaintext block 2, and plaintext block 3). The decentralized application can encrypt the initialization vector and plaintext block 1 together with the encryption key to obtain ciphertext block 1, further encrypt ciphertext block 1 and plaintext block 2 together with the encryption key to obtain ciphertext block 2, and finally encrypt ciphertext block 2 and plaintext block 3 together with the encryption key to obtain ciphertext block 3. After the above encryption process, the decentralized application can obtain the final ciphertext block 3, and determine ciphertext block 3 as the first encrypted social information of the social information.
[0056] It should be noted that when the decentralized application splits social information into at least one plaintext block, if the length of the last plaintext block is less than the length of other plaintext blocks, the decentralized application can use a preset padding code to pad the length of the last plaintext block to the same length as other plaintext blocks. The specific content of the above-mentioned preset padding code includes but is not limited to numbers and letters, etc., which can be determined according to the actual application scenario and is not limited here. For example, when the decentralized application splits social information into 64-bit plaintext blocks, assuming that the length of the first plaintext block is 64 bits and the length of the second plaintext block is 61 bits, the decentralized application can add three zeros after the second plaintext block to pad the length of the second plaintext block to 64 bits. Among them, the above-mentioned initialization vector is an input value of a fixed length, such as a random number or a quasi-random number, etc., which can also be determined according to the actual application scenario and is not limited here. Among them, decentralized applications can also use encryption algorithms such as DES (Data Encryption Standard), AES (Advanced Encryption Standard) and 3DES when encrypting social information. The specific encryption algorithms can be determined according to the actual application scenario and are not restricted here.
[0057] Optionally, in some feasible implementations, after the decentralized application obtains the social information, if the user's social information also carries a target date, it means that the user hopes that the social information can only be viewed by other users before the target date. Therefore, the decentralized application can mark the first encrypted social information according to the target date to indicate the decryptable time of the first encrypted social information. Specifically, the decentralized application can generate a decryption time identifier based on the target date carried by the social information, and use the decryption time identifier to mark the first encrypted social information to indicate that the first encrypted social information is allowed to be decrypted by the decentralized application before the target date, and further store the first encrypted social information marked by the decryption time identifier in the blockchain. Among them, when the first encrypted social information process is stored, a new block can be generated and the first encrypted social information and the encrypted social information corresponding to other social information of the user can be stored in the new block. For details, see Figure 5 , Figure 5 Schematic diagram of the block structure provided by the embodiment of the present application. The blockchain contains multiple blocks, such as Figure 5 As shown, each block includes a block header and a block body. The block header stores information such as the Merkle tree root, version number, timestamp, and difficulty value, and the block body stores input information (encrypted social information); each block takes the previous block as the parent block, and the next block also includes a block header and a block body. The block header stores the Merkle tree root of the current block, the block header feature value of the parent block, the version number, timestamp, and difficulty value, and so on, so that the block data stored in each block in the blockchain is associated with the block data stored in the previous block, ensuring the security of the input information in the block. When generating a new block, the hash value of the Merkle tree root of the new block can be obtained based on each encrypted social confidence; then, the update timestamp is updated to the time when the first encrypted social information is stored, and different random numbers are tried, and the feature value calculation is performed multiple times, so that the calculated feature value can satisfy the following formula:
[0058] SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x)) <TARGET
[0059] Among them, version (version number) is the version information of the relevant block protocol in the blockchain; prev_hash is the block header feature value of the parent block of the new block; merkle root is the Merkle tree root; ntime is the update time of the update timestamp; nbits is the current difficulty, which is a fixed value within a period of time and is determined again after exceeding the fixed time period; x is a random number; TARGET is the feature value threshold, which can be determined based on nbits. In this way, when the random number that satisfies the above formula is calculated, the information can be stored accordingly, the block header and block body can be generated, the new block can be obtained and the new block can be put on the chain.
[0060] Among them, encrypted social information 1, encrypted social information 2, encrypted social information 3 and encrypted social information 4 can be organized together in the form of a Merkle tree. Taking encrypted social information 1 and encrypted social information 2 as examples, the hash value 1 corresponding to encrypted social information 1 can be calculated through hash calculation; similarly, the hash value 2 corresponding to encrypted social information 2 can be calculated through hash calculation. Further, by connecting hash value 1 and hash value 2 in series and continuing to perform hash transformation, we can get Figure 5 The hash value 12 is shown. Similarly, for encrypted social information 3 and encrypted social information 4, through such recursive calculation layer by layer, we can get Figure 5The hash value 34 shown in FIG. 1 can further be used to concatenate the hash value 12 and the hash value 34 to perform a hash transformation until only one root (i.e. Figure 5 At this point, the hash value of all encrypted social information obtained last can be used as the Merkle tree root of the new block.
[0061] In some feasible implementations, in order to further improve the security of the first encrypted social information, or when the first user specifies that some users can decrypt the first encrypted social information, the decentralized application can send a private key acquisition request to the first user to obtain the first user's private key and the first user's user identifier, and further sign the first encrypted social information according to the first user's private key to obtain the second encrypted social information.
[0062] S203: Obtain a storage address of the first encrypted social information, and generate publishing information according to the storage address and the first encrypted social information.
[0063] In some feasible implementations, in order to avoid directly publishing the social information of the first user and further improve the information security of the decentralized application, the decentralized application can display the encrypted social information on the first application interface. Specifically, the decentralized application can obtain the storage address of the first encrypted social information in the blockchain, such as the block height of the target block storing the first encrypted social information, etc., which can be determined according to the actual application scenario and is not limited here. And further generate the release information according to the storage address of the first encrypted social information and the first encrypted social information, the above release information is used to display to the first user and other users through the decentralized application, and the above release information is presented as the first encrypted social information and carries the storage address of the first encrypted social information, so that other users can obtain the storage address carried by the release information after browsing the release information, obtain the corresponding first encrypted social information from the blockchain, and then decrypt the first encrypted social information to obtain the actual social information of the first user.
[0064] S204: Determine a first target application interface according to the publishing address of the social information, and display the published information to the first user on the first target application interface.
[0065] In some feasible implementations, after the decentralized application determines the publishing information corresponding to the social information, it can obtain the publishing address carried by the social information to determine the first target application interface according to the publishing address. Among them, the above-mentioned publishing address can be used to describe the information sent to the specified user, or it can be a specific publishing location of the decentralized application, etc., which can be determined according to the actual application scenario and is not limited here. Among them, when the above-mentioned publishing address is used to describe the information sent to the specified user, the decentralized application can determine the communication interface between the first user and the user as the first target application interface. When the above-mentioned publishing address is a specific publishing address of the decentralized application, such as the default information publishing page, the decentralized application can use the default information publishing page as the above-mentioned first target application interface. Therefore, the specific form of the above-mentioned first target application interface can also be determined according to the actual application scenario, which is not limited here.
[0066] In the embodiment of the present application, when a decentralized application publishes a user's social information, it can verify whether there is sensitive information in the social information according to the consensus node, which can reduce information security issues caused by sensitive information. Furthermore, the decentralized application can encrypt the social information to obtain encrypted information, and display the published information obtained from the encrypted information on the application interface, so that other users can only view the encrypted social information on the application interface, which greatly improves the information security of the decentralized application and has high applicability.
[0067] See also Figure 6 , Figure 6 This is another flow chart of the information processing method of the decentralized application provided in the embodiment of the present application. Figure 6 The information processing method of the decentralized application shown may include the following steps S601 to S207.
[0068] S601. Acquire social information of a first user, and send the social information to a consensus node in a blockchain, so that the consensus node verifies whether the social information contains sensitive information, and the social information carries a publishing address of the social information.
[0069] S602: When the social information does not contain sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in a blockchain.
[0070] S603: Obtain a storage address of the first encrypted social information, and generate publishing information according to the storage address and the first encrypted social information.
[0071] S604: Determine a first target application interface according to the publishing address of the social information, and display the published information to the first user on the first target application interface.
[0072] In some feasible implementations, the specific implementations of the above steps S604 to S604 can be found in Figure 2 The implementation method shown in steps S201 to S204 will not be repeated here.
[0073] S605: When a viewing request for viewing the published information is received from the second user, a storage address is obtained from the published information, and the first encrypted social information is obtained from the blockchain according to the storage address.
[0074] In some feasible implementations, since the social information of the first user is presented in an encrypted form on the first target application interface of the decentralized application, for other users (hereinafter referred to as the second user for convenience of description), when the second user browses the published information corresponding to the first user on the above-mentioned first target application interface through the decentralized application, it is necessary to obtain the first encrypted social information corresponding to the published information from the blockchain and decrypt the first encrypted social information before viewing the actual social information of the first user corresponding to the published information. Therefore, when the decentralized application receives a user's viewing request for viewing the published information, it can obtain the corresponding storage address from the published information on the first target application interface, and determine the target block from the blockchain according to the storage address, and then obtain the first encrypted social information corresponding to the published information from the target block. Optionally, in order to ensure the information security of any information processing link of the decentralized application (including receiving the above-mentioned viewing request) and to prevent the viewing request of the second user from being tampered with and becoming an invalid request, after receiving the viewing request of the second user, the decentralized application can obtain the digital signature of the published information carried in the viewing request and the public key of the second user, and further verify whether the viewing request of the second user is valid according to the digital signature of the published information and the public key of the second user. Specifically, the decentralized application can perform a hash calculation on the published information on the first target application interface to obtain the first summary of the published information, and decrypt the digital signature of the published information according to the public key of the second user to obtain the second summary of the published information. At this time, the decentralized application can match the first summary of the published information with the second summary information. If the first summary and the second summary are consistent, it means that the decentralized application has not been tampered with before receiving the above-mentioned viewing request, so the decentralized application can determine that the above-mentioned viewing request is a valid request. Among them, the digital signature of the above-mentioned publishing information is obtained by the second user signing the summary of the published information (obtained by the second user performing a hash calculation on the published information) according to the private key of the second user.
[0075] See also Figure 7 , Figure 7 Schematic diagram of a verification and viewing request provided in an embodiment of the present application. Figure 7In the example, assuming that the digital signature of the published information is 0010101, the decentralized application uses the public key of the second user to decrypt the digital signature to obtain the first summary 1000100. On the other hand, the decentralized application can perform a hash calculation on the published information to obtain the second summary information, and when the second summary information is 1000100, the decentralized application determines that the viewing request of the second user is a valid request. The message digest algorithm used by the second user to perform hash calculation on the release and the decentralized application to perform hash calculation on the release information is consistent, and the message digest algorithm includes but is not limited to Cyclic Redundancy Check-8 (CRC8), Cyclic Redundancy Check-16 (CRC16), Cyclic Redundancy Check-32 (CRC32), Message-Digest Algorithm 2 (MD2), Message-Digest Algorithm 4 (MD4), Message-Digest Algorithm 5 (MD5), Secure Hash Algorithm 1 (SHA1), Secure Hash Algorithm 256 (SHA256), Secure Hash Algorithm 384 (SHA384), Secure Hash Algorithm 512 (SHA512), and Secure Hash Algorithm 512. 512, SHA512), RACE Integrity Primitives Evaluation Message Digest (RIPEMD), PANAMA, TIGER, and Adler-3 algorithms, etc., can be determined based on actual application scenarios and are not limited here. The length and form of the digest obtained by different information digest algorithms are different. For example, a digest represented by an 8-bit hexadecimal number can be obtained based on CRC32, a digest represented by a 32-bit hexadecimal number can be obtained based on MD5, and a digest with a length of 32 bytes (256 bits) can be obtained based on SHA256.
[0076] Optionally, in some feasible implementations, when the encrypted social information obtained by the decentralized application from the blockchain according to the storage address is the second encrypted social information, it means that the first user does not allow the second user to directly view the social information of the first user based on the decentralized application. At the same time, since the decentralized application does not determine whether the second encrypted social information corresponds to the first encrypted social information of the first user's social information, the decentralized application can determine whether the obtained second encrypted social information carries the user identifier of the first user. When the second encrypted social information carries the user identifier of the first user, it means that the second encrypted social information corresponds to the published information on the first target application interface. At this time, the decentralized application can obtain the second user identifier of the second user and send a public key acquisition request carrying the second user identifier to the first user, wherein the above-mentioned second user identifier is used to enable the first user to determine whether to allow the second user to view the corresponding social information. When the first user allows the second user to view the corresponding social information, the decentralized application obtains the public key of the first user and decrypts the second encrypted social information according to the public key of the first user to obtain the first encrypted social information of the first user's social information. Based on the above implementation, the social information published by the first user in the decentralized application can only be actually browsed by some users, which can improve the information security of the decentralized application.
[0077] S606: Determine at least one ciphertext block according to the first encrypted social information, and decrypt the at least one ciphertext block according to a decryption key of the decentralized application to obtain at least one plaintext block.
[0078] In some feasible implementations, after obtaining the first encrypted social information corresponding to the published information, the decentralized application may obtain the decryption identifier carried by the first encrypted social information, and further determine the target date corresponding to the first encrypted social information based on the decryption identifier. The target date is used to indicate that the first encrypted social information is allowed to be decrypted by the decentralized application before the target date, so that the decentralized application can determine the time when the first encrypted social information is obtained from the blockchain as the acquisition date, and the acquisition date is used to indicate the decryption time when the decentralized application decrypts the first encrypted social information. At this time, the decentralized application matches the acquisition date with the target date. When the acquisition date is before the target date, it indicates that the decentralized application can decrypt the first encrypted social information at this time. Furthermore, when the first encrypted social information is composed of multiple ciphertext blocks, the decentralized application can split the first encrypted social information into at least one ciphertext block, wherein the length of each ciphertext block is consistent, such as 64 bits and 128 bits, etc., which can be determined according to the actual application scenario.
[0079] S607: Determine social information according to at least one plaintext block, and display the social information to the second user on the second target application interface.
[0080] In some feasible implementations, the decentralized application may further use the decryption key of the decentralized application to decrypt each ciphertext block to obtain at least one plaintext block. At this time, the obtained at least one plaintext block may be concatenated to obtain the social information of the first user corresponding to the published information. Wherein, when the first encrypted social information is obtained by the decentralized application according to the symmetric encryption method, the encryption key and decryption key of the decentralized application are the same key. When the decentralized application uses other encryption methods to encrypt the social information to obtain the first encrypted social information, the encryption key and decryption key of the decentralized application correspond to the encryption key and decryption key of the encryption method adopted, which can be determined according to the actual encryption method and is not limited here. Further, after the decentralized application decrypts the first encrypted social information to obtain the social information of the first user, the decentralized application can display the above social information to the second user through the second target application interface. Wherein, the above second target application can be a communication interface between the first user and the second user, or it can be a default information display interface of the decentralized application, which can be determined according to the actual application scenario and is not limited here.
[0081] It should be noted that the specific implementation method of the decentralized application decrypting the first encrypted social information to obtain the social information corresponds to the decentralized application encrypting the first encrypted social information, which can be specifically determined according to the encryption method adopted by the decentralized application and will not be repeated here.
[0082] In the embodiment of the present application, when a decentralized application publishes a user's social information, it can verify whether there is sensitive information in the social information based on the consensus node, which can reduce information security issues caused by sensitive information. Furthermore, the decentralized application can encrypt the social information to obtain encrypted information, and display the published information obtained from the encrypted information on the application interface, so that other users can only view the encrypted social information on the application interface, which greatly improves the information security of the decentralized application. At the same time, when other users need to view the user's social information, they need to decrypt the encrypted social information in the blockchain to obtain the user's social information, which can effectively reduce the risk of decentralized application information being obtained by other users, and has high applicability.
[0083] See also Figure 8 , Figure 8 1 is a schematic diagram of the structure of the information processing device of the decentralized application provided in the embodiment of the present application. The device 1 provided in the embodiment of the present application includes:
[0084] A first acquisition module 11 is used to acquire the social information of the first user, and send the social information to a consensus node in the blockchain, so that the consensus node verifies whether the social information contains sensitive information, and the social information carries a publishing address of the social information;
[0085] An encryption module 12, configured to, when the social information does not contain the sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in the blockchain;
[0086] A second acquisition module 13 is used to acquire the storage address of the first encrypted social information, and generate release information according to the storage address and the first encrypted social information;
[0087] The first determining module 14 is used to determine a first target application interface according to the publishing address of the social information, and display the published information to the first user on the first target application interface.
[0088] In some feasible implementations, the encryption module 12 includes:
[0089] A first determining unit 121, configured to determine at least one plaintext block according to the social information;
[0090] The encryption unit 122 is used to encrypt each plaintext block according to the encryption key of the decentralized application to obtain at least one ciphertext block, and generate the first encrypted social information of the social information according to the at least one ciphertext block.
[0091] In some feasible implementations, the encryption module 12 includes:
[0092] The signing unit 123 is configured to send a private key acquisition request to the first user to acquire the private key and the first user identifier of the first user, and to sign the first encrypted social information according to the private key to obtain the second encrypted social information;
[0093] The marking unit 124 is used to mark the second encrypted social information according to the first user identifier, and store the marked second encrypted social information in the blockchain.
[0094] In some feasible implementations, the social information also carries a target date; the encryption unit 12 includes:
[0095] A generating unit 125, configured to generate a decryption time identifier according to the target date, and mark the first encrypted social information according to the decryption time identifier, wherein the decryption time identifier is used to mark that the first encrypted social information is allowed to be decrypted before the target date;
[0096] The storage unit 126 is used to store the marked first encrypted social information in the above-mentioned blockchain.
[0097] In some feasible implementations, the device 1 further includes:
[0098] The third acquisition module 15 is further used to obtain the storage address from the published information when receiving a viewing request from the second user for viewing the published information, and to obtain the first encrypted social information from the blockchain according to the storage address;
[0099] The second determination module 16 is further configured to determine the at least one ciphertext block according to the first encrypted social information, and decrypt the at least one ciphertext block according to the decryption key of the decentralized application to obtain the at least one plaintext block;
[0100] The third determination module 17 is further configured to determine the social information according to the at least one plaintext block, and display the social information to the second user on the second target application interface.
[0101] In some feasible implementations, the third acquisition module 15 includes:
[0102] A first acquisition unit 151 is used to acquire the second encrypted social information from the blockchain according to the storage address, and determine whether the second encrypted social information carries the first user identifier;
[0103] The sending unit 152 is configured to send a public key acquisition request carrying the second user identifier of the second user to the first user when the second encrypted social information carries the first user identifier, so as to obtain the public key of the first user, and the second user identifier allows the first user to determine whether to allow the second user to view the social information;
[0104] The decryption unit 153 is configured to decrypt the second encrypted social information according to the public key to obtain the first encrypted social information.
[0105] In some feasible implementations, the second determining module 16 includes:
[0106] The second acquisition unit 161 is used to determine the acquisition date of the first encrypted social information from the blockchain, and determine the target date according to the decryption identifier carried by the first encrypted social information;
[0107] The second determining unit 162 is configured to match the acquisition date with the target date, and when the acquisition date is before the target date, determine the at least one ciphertext block according to the first encrypted social information.
[0108] In a specific implementation, the above-mentioned device 1 can execute the above-mentioned functions through its built-in functional modules. Figure 2 and / or Figure 6 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0109] In the embodiment of the present application, when a decentralized application publishes a user's social information, it can verify whether there is sensitive information in the social information based on the consensus node, which can reduce information security issues caused by sensitive information. Furthermore, the decentralized application can encrypt the social information to obtain encrypted information, and display the published information obtained from the encrypted information on the application interface, so that other users can only view the encrypted social information on the application interface, which greatly improves the information security of the decentralized application. At the same time, when other users need to view the user's social information, they need to decrypt the encrypted social information in the blockchain to obtain the user's social information, which can effectively reduce the risk of decentralized application information being obtained by other users, and has high applicability.
[0110] See also Fig. 9 , Fig. 9 Schematic diagram of the structure of the device provided in the embodiment of the present application. Fig. 9 As shown, the device 1000 in this embodiment may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1004 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig. 9 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.
[0111] exist Fig. 9In the device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:
[0112] Obtaining social information of the first user, and sending the social information to a consensus node in the blockchain, so that the consensus node verifies whether the social information contains sensitive information, and the social information carries a publishing address of the social information;
[0113] When the social information does not contain the sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in the blockchain;
[0114] Obtaining a storage address of the first encrypted social information, and generating publishing information according to the storage address and the first encrypted social information;
[0115] A first target application interface is determined according to the publishing address of the social information, and the published information is displayed to the first user on the first target application interface.
[0116] In some feasible implementations, the processor 1001 is configured to:
[0117] Determine at least one plaintext block based on the social information;
[0118] Each plaintext block is encrypted according to the encryption key of the decentralized application to obtain at least one ciphertext block, and the first encrypted social information of the social information is generated according to the at least one ciphertext block.
[0119] In some feasible implementations, the processor 1001 is configured to:
[0120] Sending a private key acquisition request to the first user to acquire the private key and the first user identifier of the first user, and signing the first encrypted social information according to the private key to obtain the second encrypted social information;
[0121] The second encrypted social information is marked according to the first user identifier, and the marked second encrypted social information is stored in the blockchain.
[0122] In some feasible implementations, the social information further carries a target date; and the processor 1001 is configured to:
[0123] generating a decryption time identifier according to the target date, and marking the first encrypted social information according to the decryption time identifier, wherein the decryption time identifier is used to mark that the first encrypted social information is allowed to be decrypted before the target date;
[0124] The marked first encrypted social information is stored in the blockchain.
[0125] In some feasible implementations, the processor 1001 is further configured to:
[0126] When receiving a viewing request from a second user for viewing the published information, obtaining the storage address from the published information, and obtaining the first encrypted social information from the blockchain according to the storage address;
[0127] Determining the at least one ciphertext block according to the first encrypted social information, and decrypting the at least one ciphertext block according to the decryption key of the decentralized application to obtain the at least one plaintext block;
[0128] The social information is determined according to the at least one plaintext block, and the social information is displayed to the second user on a second target application interface.
[0129] In some feasible implementations, the processor 1001 is configured to:
[0130] Obtain the second encrypted social information from the blockchain according to the storage address, and determine whether the second encrypted social carries the first user identifier;
[0131] When the second encrypted social information carries the first user identifier, a public key acquisition request carrying the second user identifier of the second user is sent to the first user to acquire the public key of the first user, and the second user identifier enables the first user to determine whether to allow the second user to view the social information;
[0132] The second encrypted social information is decrypted according to the public key to obtain the first encrypted social information.
[0133] In some feasible implementations, the processor 1001 is configured to:
[0134] Determining a date of obtaining the first encrypted social information from the blockchain, and determining the target date according to the decryption identifier carried by the first encrypted social information;
[0135] The acquisition date is matched with the target date, and when the acquisition date is before the target date, the at least one ciphertext block is determined according to the first encrypted social information.
[0136] It should be understood that in some feasible implementations, the processor 1001 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0137] In a specific implementation, the device 1000 can execute the above-mentioned functions through its built-in functional modules. Figure 2 and / or Figure 6 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0138] In the embodiment of the present application, when a decentralized application publishes a user's social information, it can verify whether there is sensitive information in the social information based on the consensus node, which can reduce information security issues caused by sensitive information. Furthermore, the decentralized application can encrypt the social information to obtain encrypted information, and display the published information obtained from the encrypted information on the application interface, so that other users can only view the encrypted social information on the application interface, which greatly improves the information security of the decentralized application. At the same time, when other users need to view the user's social information, they need to decrypt the encrypted social information in the blockchain to obtain the user's social information, which can effectively reduce the risk of decentralized application information being obtained by other users, and has high applicability.
[0139] The present application also provides a computer-readable storage medium, which stores a computer program and is executed by a processor to implement Figure 2 and / or Figure 6 For the methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0140] The computer-readable storage medium may be an internal storage unit of the task processing device provided in any of the aforementioned embodiments, such as a hard disk or memory of an electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device. The computer-readable storage medium may also include a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0141] The terms "first", "second", etc. in the claims, specification and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. Displaying the phrase at various positions in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" used in the present application specification and the attached claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations.
[0142] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0143] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for information processing of decentralized applications, characterized in that: The method comprises: Acquire social information of the first user, and send the social information to a consensus node in the blockchain, so that the consensus node verifies whether the social information contains sensitive information, wherein the social information carries a publishing address of the social information; When the social information does not contain the sensitive information, encrypting the social information according to a preset encryption method to obtain first encrypted social information, and storing the first encrypted social information in the blockchain; Acquire a storage address of the first encrypted social information, and generate publishing information according to the storage address and the first encrypted social information; Determine a first target application interface according to the publishing address of the social information, and display the published information to the first user on the first target application interface; When receiving a viewing request from a second user for viewing the published information, acquiring the storage address from the published information; If the second encrypted social information is obtained from the blockchain according to the storage address, determining whether the second encrypted social information carries the first user identifier; When the second encrypted social information carries the first user identifier, sending a public key acquisition request carrying the second user identifier of the second user to the first user to acquire the public key of the first user, wherein the second user identifier is used to enable the first user to determine whether to allow the second user to view the social information; The second encrypted social information is decrypted according to the public key to obtain the first encrypted social information, so as to determine social information from the first encrypted social information and display the corresponding social information through the second target application interface.
2. The method according to claim 1, characterized in that: The step of encrypting the social information according to a preset encryption method to obtain the first encrypted social information includes: Determining at least one plaintext block according to the social information; Each plaintext block is encrypted according to the encryption key of the decentralized application to obtain at least one ciphertext block, and first encrypted social information of the social information is generated according to the at least one ciphertext block.
3. The method according to claim 1, characterized in that The storing the first encrypted social information in the blockchain includes: Sending a private key acquisition request to the first user to acquire the private key and the first user identifier of the first user, and signing the first encrypted social information according to the private key to obtain second encrypted social information; The second encrypted social information is marked according to the first user identifier, and the marked second encrypted social information is stored in the blockchain.
4. The method according to claim 1, characterized in that: The social information also carries a target date; and storing the first encrypted social information in the blockchain includes: generating a decryption time identifier according to the target date, and marking the first encrypted social information according to the decryption time identifier, wherein the decryption time identifier is used to mark that decryption of the first encrypted social information is allowed before the target date; The marked first encrypted social information is stored in the blockchain.
5. The method according to claim 1, characterized in that The method further comprises: Determining at least one ciphertext block according to the first encrypted social information, and decrypting the at least one ciphertext block according to the decryption key of the decentralized application to obtain the at least one plaintext block; The social information is determined according to the at least one plaintext block, and the social information is displayed to the second user on a second target application interface.
6. The method according to claim 5, characterized in that The determining at least one ciphertext block according to the first encrypted social information includes: Determining a date of obtaining the first encrypted social information from the blockchain, and determining a target date corresponding to the first encrypted social information according to a decryption identifier carried by the first encrypted social information; The acquisition date is matched with the target date, and when the acquisition date is before the target date, at least one ciphertext block is determined according to the first encrypted social information.
7. An information processing device for decentralized applications, characterized in that: The device comprises: A first acquisition module, configured to acquire social information of a first user, and send the social information to a consensus node in a blockchain so that the consensus node verifies whether the social information contains sensitive information, wherein the social information carries a publishing address of the social information; an encryption module, configured to, when the social information does not contain the sensitive information, encrypt the social information according to a preset encryption method to obtain first encrypted social information, and store the first encrypted social information in the blockchain; A second acquisition module, configured to acquire a storage address of the first encrypted social information, and generate release information according to the storage address and the first encrypted social information; A first determination module, configured to determine a first target application interface according to a publishing address of the social information, and display the published information to the first user on the first target application interface; The device further includes: a third acquisition module, wherein the third acquisition module includes: a unit configured to obtain the storage address from the published information when receiving a viewing request from a second user for viewing the published information; A first acquisition unit, configured to determine whether the second encrypted social information carries the first user identifier if second encrypted social information is acquired from the blockchain according to the storage address; a sending unit, configured to send a public key acquisition request carrying a second user identifier of a second user to the first user, so as to acquire the public key of the first user, when the second encrypted social information carries the first user identifier, wherein the second user identifier is used to enable the first user to determine whether to allow the second user to view the social information; A decryption unit is used to decrypt the second encrypted social information according to the public key to obtain the first encrypted social information, so as to determine the social information from the first encrypted social information and display the corresponding social information through the second target application interface.
8. A device, characterized in that comprising a processor and a memory, wherein the processor and the memory are connected to each other; The memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 6.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
