WO2022057275A1 - 校验数据的方法、装置、设备和计算机可读介质 - Google Patents

校验数据的方法、装置、设备和计算机可读介质 Download PDF

Info

Publication number
WO2022057275A1
WO2022057275A1 PCT/CN2021/092033 CN2021092033W WO2022057275A1 WO 2022057275 A1 WO2022057275 A1 WO 2022057275A1 CN 2021092033 W CN2021092033 W CN 2021092033W WO 2022057275 A1 WO2022057275 A1 WO 2022057275A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
hash
file
certificate
blockchain
Prior art date
Application number
PCT/CN2021/092033
Other languages
English (en)
French (fr)
Inventor
柴鹏辉
Original Assignee
京东科技信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 京东科技信息技术有限公司 filed Critical 京东科技信息技术有限公司
Publication of WO2022057275A1 publication Critical patent/WO2022057275A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the present disclosure relates to the field of computer technology, and in particular, to a method, apparatus, device, and computer-readable medium for verifying data.
  • the blockchain is a shared database, and the data or information stored in it has the characteristics of unforgeability, traceability, traceability, openness and transparency, and collective maintenance. Based on the above characteristics, blockchain technology has laid a solid foundation of trust and created a reliable cooperation mechanism.
  • the embodiments of the present disclosure provide a method, apparatus, device, and computer-readable medium for verifying data, which can reduce the risk of data leakage in the process of verifying data using a blockchain.
  • a method for verifying data including:
  • the blockchain transaction identifier sent by the user obtain the certificate data from the blockchain certificate storage platform, and the certificate data includes the ciphertext of the original file, the decrypted file of the original file and the hash of the original file;
  • the hash of the file to be verified is consistent with the hash of the original file, and the certificate data is verified according to the hash of the certificate data and the hash of the certificate data in the blockchain.
  • the ciphertext of the original file, the decrypted file of the original file, and the hash of the original file are set according to a preset on-chain data template.
  • the method also includes:
  • the blockchain certificate deposit platform determines the blockchain transaction identifier based on the certificate deposit data
  • the blockchain certificate deposit platform feeds back the blockchain transaction identifier to the user.
  • the blockchain certificate deposit platform determines the blockchain transaction identifier based on the certificate deposit data, including:
  • the blockchain certificate storage platform establishes and stores the certificate storage data according to the original file sent by the user;
  • the blockchain certificate deposit platform verifies that the deposit data matches the hash of the deposit data, then uploads the hash of the deposit data to the chain, and determines the area based on the deposit data.
  • Blockchain transaction logo
  • obtaining the deposit data from the block chain deposit platform including:
  • the blockchain transaction identifier obtain the deposit data from the blockchain deposit platform, and display the user's deposit information to receive the user's secret key.
  • parse the ciphertext of the original file to obtain the hash of the file to be verified including:
  • the hash of the to-be-verified file is obtained based on the to-be-verified file.
  • verifying the certificate data includes:
  • the ciphertext of the original file, the decrypted file of the original file, and the hash of the original file are distinguished by identifiers.
  • the method also includes:
  • the verifying that the blockchain transaction identifier is valid includes:
  • the method also includes:
  • the certificate data is modified.
  • an apparatus for verifying data including:
  • the acquisition module is used to obtain the certificate data from the blockchain certificate deposit platform according to the block chain transaction identifier sent by the user, and the certificate data includes the ciphertext of the original file, the decrypted file of the original file and the original file of the original file. hash;
  • a parsing module configured to parse the ciphertext of the original file according to the user's secret key and the decrypted file of the original file to obtain the hash of the file to be verified;
  • the verification module is used for the hash of the to-be-verified file to be consistent with the hash of the original file. Descriptive data.
  • the ciphertext of the original file, the decrypted file of the original file, and the hash of the original file are set according to a preset on-chain data template.
  • an electronic device for verifying data including:
  • processors one or more processors
  • the one or more programs when executed by the one or more processors, cause the one or more processors to implement the method as described above.
  • a computer-readable medium having a computer program stored thereon, the program implementing the above method when executed by a processor.
  • an embodiment of the above invention has the following advantages or beneficial effects: according to the block chain transaction identifier sent by the user, the certificate data is obtained from the block chain certificate storage platform, and the certificate data includes the ciphertext of the original file and the decryption of the original file.
  • the hash of the file and the original folder according to the user's secret key and decrypted file, parse the ciphertext of the original file to obtain the hash of the file to be verified; the hash of the file to be verified is consistent with the hash of the original file, according to the evidence
  • the hash of the data and the hash of the certificate data in the blockchain verify the certificate data. In the process of verifying data on the blockchain, only the hash of the evidence data needs to be uploaded to the chain. Even if the hash of the evidence data is stolen, the original file will not be leaked, so the risk of data leakage can be reduced.
  • FIG. 1 is a schematic diagram of a main flow of a method for verifying data according to an embodiment of the present disclosure
  • FIG. 2 is a schematic diagram of an application scenario of verification data according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of an on-chain data template according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart of a block chain certificate deposit platform feeding back a block chain transaction identifier according to an embodiment of the present disclosure
  • FIG. 5 is a schematic flowchart of determining a blockchain transaction identifier according to an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart of obtaining certificate data from a blockchain certificate deposit platform according to an embodiment of the present disclosure
  • FIG. 7 is a schematic flowchart of parsing ciphertext of an original file according to an embodiment of the present disclosure
  • FIG. 8 is a schematic flowchart of comparing hashes according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of interaction of verification data according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of interaction of data uploading on the chain according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic diagram of the main structure of an apparatus for verifying data according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present disclosure.
  • users can use the notary platform to verify the data. Specifically, the user uploads the original file on the notary platform, and verifies the authenticity of the original file based on the hash of the original file. If the original file is successfully verified based on the hash of the original file, a notarial certificate will be issued; if the original file fails to be verified based on the hash of the original file, a notary certificate will not be issued.
  • the original document needs to be properly preserved, if lost, it will not be able to participate in the lawsuit. Backing up original files in multiple places still poses the risk of data leakage. For example, in the case of saving the original file, the original file may be modified intentionally, accidentally or by hacking.
  • FIG. 1 is a schematic diagram of the main process of a method for verifying data according to an embodiment of the present disclosure, obtaining the certificate data from the blockchain certificate deposit platform, parsing the ciphertext of the original file, and comparing the hash of the certificate data.
  • the hash of the certificate data in the Xihe blockchain to verify the certificate data As shown in Figure 1, it specifically includes the following steps:
  • S101 according to the blockchain transaction identifier sent by the user, obtain certificate data from the blockchain certificate deposit platform, where the certificate data includes the ciphertext of the original file, the decrypted file of the original file, and the hash of the original file.
  • a notary platform may be used as the execution body of each step.
  • the notary platform receives the blockchain transaction identifier sent by the user, and obtains the depository data from the blockchain depository platform.
  • the evidence data includes the hash of the original file, the ciphertext of the original file, and the decrypted file of the original file.
  • FIG. 2 is a schematic diagram of an application scenario of verification data according to an embodiment of the present disclosure.
  • the user can upload the original file to the blockchain certification platform, or send the secret key to the notary platform.
  • the blockchain depository platform uploads the hash of the depository data to the chain.
  • the notary platform is used to verify the data.
  • an on-chain data template can be preset, so that the hash of the original file, the ciphertext of the original file, and the decrypted file of the original file can be set according to the preset on-chain data template.
  • FIG. 3 is a schematic diagram of an on-chain data template according to an embodiment of the present disclosure.
  • the on-chain data template includes three parts. The first part: the hash of the original file; the second part: the ciphertext of the original file; the third part: the decrypted file of the original file.
  • each part can be distinguished by an identifier.
  • the first portion is located between the first identification and the second identification; the second portion is between the second identification and the third identification; the third portion is between the third identification and the fourth identification.
  • the content in each part can be preset, and Figure 3 is just an example. That is, it can be set as follows: Part 1: the ciphertext of the original file; Part 2: the hash of the original file; Part 3: the decrypted file of the original file.
  • the certification data including the hash of the original file, the ciphertext of the original file, and the decrypted file of the original file are generated on the blockchain certification platform.
  • FIG. 4 is a schematic flowchart of a blockchain certificate deposit platform feeding back a blockchain transaction identifier according to an embodiment of the present disclosure, specifically including:
  • the blockchain certificate depository platform determines the blockchain transaction identifier based on the depository data.
  • the certificate storage data is stored in the blockchain certificate storage platform.
  • the user uploads the original file to the blockchain certification platform, and then generates and stores the certification data on the blockchain certification platform.
  • FIG. 5 is a schematic flowchart of determining a blockchain transaction identifier according to an embodiment of the present disclosure, which specifically includes:
  • the blockchain certificate storage platform establishes and stores certificate storage data according to the original file sent by the user.
  • the original file is the file that the user needs to verify. Then calculate the hash of the original file.
  • SDK software development kit
  • the original file is encrypted with the public key to obtain the ciphertext of the original file.
  • the private key corresponding to the public key is at the user. That is to say, the public key is stored in the blockchain certificate deposit platform.
  • the decrypted file of the original file is nested.
  • the decrypted file of the original file may be a decryption script of the original file.
  • the decryption script may include commonly used decryption algorithms or custom decryption algorithms.
  • the ciphertext of the original file can be decrypted, thereby obtaining the original file.
  • the hash of the original file, the ciphertext of the original file, and the decrypted file of the original file are set as the evidence data according to the preset data template on the chain.
  • the hash of the certificate data needs to be calculated.
  • the blockchain certificate deposit platform verifies that the deposit data matches the hash of the deposit data, then uploads the hash of the deposit data to the chain, and determines the blockchain transaction identifier based on the deposit data.
  • the blockchain depository platform receives the depository data and the hash of the depository data through the depository interface, and then verifies the depository data and the hash of the depository data.
  • a hash that verifies the forensic data is computed based on the forensic data. If the hash of the verification data is the same as the hash of the data, the verification is successful; if the hash of the verification data is different from the hash of the verification data, the verification fails.
  • the hash of the evidence data can be uploaded to the chain. After the hash of the evidence data is on the chain, it can be stored in different locations. Even if the hash of the evidence data is leaked, it is difficult to decrypt the hash of the original file because there is no private key, and the risk of original file leakage is reduced.
  • the blockchain transaction identifier is determined based on the deposit data, so as to obtain the deposit data on the blockchain deposit platform according to the blockchain transaction identifier.
  • the blockchain certification platform establishes the certification data, and uploads the hash of the certification data to the chain, thereby reducing the risk of original file leakage.
  • the blockchain certificate deposit platform feeds back the blockchain transaction identifier to the user.
  • the blockchain certificate deposit platform After the blockchain certificate deposit platform determines the blockchain transaction ID, it can feed back the blockchain transaction ID to the user. In this way, users can initiate notarization based on the blockchain transaction ID.
  • the blockchain depository platform can synchronize the hash of the depository data and the blockchain transaction identifier to the notary platform. The purpose of this is to prepare for the verification of the depository data.
  • the notary platform generates a notary ID based on the hash of the data stored in the certificate and the blockchain transaction ID. And return the notarized identification to the blockchain certification platform.
  • the blockchain certificate deposit platform can establish the corresponding relationship between the notarization logo and the blockchain transaction logo.
  • the user uploads the original file to the blockchain certification platform, and the blockchain certification platform uploads the hash of the certification data to the chain, thereby reducing the risk of original file leakage.
  • FIG. 6 is a schematic flowchart of obtaining certificate storage data from a blockchain certificate storage platform according to an embodiment of the present disclosure, which specifically includes the following steps:
  • the notary platform queries the notarization ID according to the blockchain transaction ID. If the notarization ID can be queried, the blockchain transaction ID is checked to be valid; if the notarized ID is not found, the blockchain transaction ID is checked to be invalid.
  • S602 obtain the deposit data from the blockchain deposit platform, and display the user's deposit information to receive the user's secret key.
  • the blockchain transaction ID If the blockchain transaction ID is valid, you can use the blockchain transaction ID to obtain the deposit data from the blockchain deposit platform.
  • the purpose of obtaining the evidence data is to verify the evidence data.
  • the user's certificate information is displayed to receive the user's secret key. After seeing the certificate information, the user can enter the key corresponding to the certificate information.
  • the deposit information may include the name of the deposit data, the deposit time of the deposit data, the hash of the deposit data that has been uploaded to the chain, and the notarization identifier corresponding to the blockchain transaction identifier.
  • the user's secret key belongs to the private key.
  • the hash of the file to be verified can be obtained.
  • FIG. 7 is a schematic flowchart of parsing the ciphertext of an original file according to an embodiment of the present disclosure, which specifically includes:
  • the data on the chain is the hash of the data stored in the certificate.
  • the file to be verified is a file that needs to be verified. If the verification is successful, the document to be verified is the original document.
  • the decrypted file of the original file and the ciphertext of the original file need to be obtained.
  • the decrypted file of the original file and the ciphertext of the original file are stored in the proof data, then the decrypted file of the original file and the ciphertext of the original file can be obtained from the proof data according to the preset on-chain data template. Relevant files can be quickly obtained by using the preset data template on the chain.
  • the decrypted file of the original file is located in the first segment, and the ciphertext of the original file is located in the second segment. Then, the decrypted file of the original file can be obtained from the first paragraph in the on-chain data template of the evidence-based data, and the ciphertext of the original file can be obtained from the second paragraph of the on-chain data template of the evidence-based data.
  • the ciphertext of the original file can be parsed to obtain the file to be verified.
  • the document to be verified may or may not be the same as the original document.
  • the hash of the file to be verified can be calculated.
  • a standard hash-256 algorithm may be used to generate a hash of the file to be verified according to the file to be verified.
  • the ciphertext of the original file can be parsed, and then the hash of the file to be verified can be obtained.
  • the hash of the file to be verified is consistent with the hash of the original file, and the certificate data is verified according to the hash of the certificate data and the hash of the certificate data in the blockchain.
  • the attestation data can be verified.
  • FIG. 8 is a schematic flowchart of comparing hashes according to an embodiment of the present disclosure, which specifically includes:
  • the hash of the file to be verified is consistent with the hash of the original file, and the hash of the evidence data is obtained in the blockchain.
  • the hash of the file to be verified is the same as the hash of the original file, it means that the possibility of modification of the evidence data in the blockchain evidence platform is small, and the evidence data in the blockchain can be obtained to be used in the block chain.
  • the hash of the evidence data in the chain is used as the benchmark for comparison.
  • the deposit data is verified.
  • the verification of the certificate data on the blockchain certificate platform is consistent with the hash of the certificate data in the blockchain, then the verification of the certificate data is successful, and the notarial certificate can be fed back to the user; the blockchain certificate If the hash of the certificate data on the platform is different from the hash of the certificate data in the blockchain, the verification of the certificate data fails, and the verification failure can be reported to the user.
  • the certificate data is verified by comparing the hash of the certificate data of the blockchain certificate storage platform with the hash of the certificate data in the blockchain.
  • the certificate data is obtained from the blockchain certificate storage platform, and the certificate data includes the ciphertext of the original file, the decrypted file of the original file, and the original folder.
  • the user's secret key and decrypted file parse the ciphertext of the original file to obtain the hash of the file to be verified; the hash of the file to be verified is consistent with the hash of the original file, according to the hash and The hash of the certificate data in the blockchain, verify the certificate data.
  • verifying data on the blockchain only the hash of the evidence data needs to be uploaded to the chain. Even if the hash of the evidence data is stolen, the original file will not be leaked, so the risk of data leakage can be reduced.
  • FIG. 9 is a schematic diagram of the interaction of verification data according to an embodiment of the present disclosure
  • FIG. 9 includes a user, a blockchain certificate deposit platform and a notary platform, and specifically includes:
  • the user sends a request for a verification page to the notary platform.
  • the notary platform displays the verification page to the user.
  • the user can enter the blockchain transaction ID and secret key on the verification page.
  • the notary platform can verify the certificate data corresponding to the blockchain transaction identifier.
  • the notary platform queries the notarization logo according to the blockchain transaction logo. If the notarization logo can be found, it will verify that the blockchain transaction logo is valid; if the notarized logo is not found, the blockchain transaction logo will be invalid.
  • the notary platform Based on the blockchain transaction identifier, the notary platform sends a request to obtain the data of the deposit certificate to the blockchain depository platform.
  • the blockchain certification platform After the blockchain certification platform receives the request for obtaining the certification data, it feeds back the certification data to the notary platform.
  • the notary platform calculates the hash of the file to be verified based on the ciphertext of the original file and the decrypted file of the original file in the attestation data.
  • the hash of the file to be verified is consistent with the hash of the original file, and the hash of the data stored in the blockchain certification platform is consistent with the hash of the stored data in the blockchain, and the verification of the stored data is successful.
  • the hash of the file to be verified is consistent with the hash of the original file, compare the hash of the data stored in the blockchain certification platform with the hash of the data stored in the blockchain.
  • the hash of the certificate data on the blockchain certificate platform is consistent with the hash of the certificate data in the blockchain, and the verification of the certificate data is successful.
  • the notary platform sends the notary certificate to the user.
  • the user only needs to send the blockchain transaction identifier and secret key to the notary platform to verify the data, and then receive the notarization certificate, which is simple to operate and reduces the risk of data leakage.
  • FIG. 10 is a schematic diagram of the interaction of data uploading according to an embodiment of the present disclosure.
  • a solution for data uploading is exemplified, including:
  • the user sends the original data to the blockchain depository platform for the purpose of uploading the hash of the depository data to the chain.
  • the SDK is used in the blockchain certification platform, and the original file is encrypted with the public key to obtain the ciphertext of the original file, and then the decrypted file of the original file is nested, and the hash of the original file is generated.
  • the preset on-chain data template set the hash of the original file, the ciphertext of the original file, and the decrypted file of the original file as the certificate data. And then generate the hash of the evidence data.
  • the storage certificate data matches the hash of the storage certificate data.
  • the blockchain depository platform receives the depository data and the hash of the depository data through the depository interface, and then verifies that the depository data and the hash of the depository data match.
  • the blockchain depository platform sends the blockchain transaction ID to the user, so that the user can notarize through the blockchain transaction ID.
  • the blockchain depository platform sends the blockchain transaction identifier and the hash of the depository data to the notary platform.
  • the notary platform generates a notary ID based on the hash of the data stored in the certificate and the blockchain transaction ID.
  • the notary platform feeds back the notary logo to the blockchain depository platform.
  • the blockchain depository platform establishes a corresponding relationship based on the notarization logo and the blockchain transaction logo.
  • the hash of the original data is stored in the blockchain through the blockchain certification platform for use in notarization.
  • FIG. 11 is a schematic diagram of the main structure of a device for verifying data according to an embodiment of the present disclosure.
  • the device for verifying data can implement a method for verifying data.
  • the device for verifying data is specifically include:
  • the obtaining module 1101 is used to obtain the certificate data from the blockchain certificate deposit platform according to the block chain transaction identifier sent by the user, and the certificate data includes the ciphertext of the original file, the decrypted file of the original file and the original file. the hash;
  • a parsing module 1102 configured to parse the ciphertext of the original file according to the user's secret key and the decrypted file of the original file, to obtain the hash of the file to be verified;
  • the verification module 1103 is used for the hash of the document to be verified is consistent with the hash of the original file, and the verification is performed according to the hash of the certificate data and the hash of the certificate data in the blockchain. the depository data.
  • the ciphertext of the original file, the decrypted file of the original file, and the hash of the original file are set according to a preset on-chain data template.
  • the obtaining module 1101 is further configured to control the blockchain certificate storage platform to determine the storage data based on the certificate storage data after the storage certificate data is stored in the blockchain certificate storage platform. the blockchain transaction identifier;
  • the obtaining module 1101 is further configured to control the blockchain certificate deposit platform to create and store the certificate deposit data according to the original file sent by the user;
  • Blockchain transaction logo
  • the obtaining module 1101 is specifically configured to verify that the blockchain transaction identifier is valid
  • the blockchain transaction identifier obtain the deposit data from the blockchain deposit platform, and display the user's deposit information to receive the user's secret key.
  • the parsing module is specifically configured to obtain the decrypted file of the original file and the ciphertext of the original file in the certificate data according to a preset on-chain data template;
  • the hash of the to-be-verified file is obtained based on the to-be-verified file.
  • the verification module 1103 is specifically used for the hash of the file to be verified is consistent with the hash of the original file, and then obtains the hash of the certificate data in the blockchain ;
  • FIG. 12 illustrates an exemplary system architecture 1200 of a method of verifying data or an apparatus for verifying data to which embodiments of the present disclosure may be applied.
  • the system architecture 1200 may include terminal devices 1201 , 1202 , and 1203 , a network 1204 and a server 1205 .
  • the network 1204 is a medium used to provide a communication link between the terminal devices 1201 , 1202 , 1203 and the server 1205 .
  • Network 1204 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
  • the user can use the terminal devices 1201, 1202, 1203 to interact with the server 1205 through the network 1204 to receive or send messages and the like.
  • Various communication client applications may be installed on the terminal devices 1201 , 1202 and 1203 , such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).
  • the terminal devices 1201, 1202, 1203 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.
  • the server 1205 may be a server that provides various services, such as a background management server (just an example) that provides support for shopping websites browsed by the terminal devices 1201, 1202, and 1203.
  • the background management server can analyze and process the received product information query request and other data, and feed back the processing results (such as target push information, product information—just an example) to the terminal device.
  • the method for verifying data provided by the embodiments of the present disclosure is generally performed by the server 1205 , and accordingly, the apparatus for verifying data is generally set in the server 1205 .
  • terminal devices, networks and servers in FIG. 12 are merely illustrative. There can be any number of terminal devices, networks and servers according to implementation needs.
  • FIG. 13 shows a schematic structural diagram of a computer system 1300 suitable for implementing a terminal device of an embodiment of the present disclosure.
  • the terminal device shown in FIG. 13 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.
  • a computer system 1300 includes a central processing unit (CPU) 1301, which can be loaded into a random access memory (RAM) 1303 according to a program stored in a read only memory (ROM) 1302 or a program from a storage section 1308 Instead, various appropriate actions and processes are performed.
  • RAM random access memory
  • ROM read only memory
  • various programs and data necessary for the operation of the system 1300 are also stored.
  • the CPU 1301, the ROM 1302, and the RAM 1303 are connected to each other through a bus 1304.
  • An input/output (I/O) interface 1305 is also connected to bus 1304 .
  • the following components are connected to the I/O interface 1305: an input section 1306 including a keyboard, a mouse, etc.; an output section 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc. ; and a communication section 1309 including a network interface card such as a LAN card, a modem, and the like.
  • the communication section 1309 performs communication processing via a network such as the Internet.
  • Drivers 1310 are also connected to I/O interface 1305 as needed.
  • a removable medium 1311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1310 as needed so that a computer program read therefrom is installed into the storage section 1308 as needed.
  • embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods illustrated in the flowcharts.
  • the computer program may be downloaded and installed from the network via the communication portion 1309, and/or installed from the removable medium 1311.
  • CPU central processing unit
  • the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device .
  • Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • the modules involved in the embodiments of the present disclosure may be implemented in software or hardware.
  • the described modules can also be provided in a processor, for example, it can be described as: a processor includes a sending unit, an obtaining unit, a determining unit and a first processing unit. Wherein, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • the sending unit may also be described as "a unit that sends a request for obtaining pictures to the connected server".
  • the present disclosure also provides a computer-readable medium.
  • the computer-readable medium may be included in the device described in the above-mentioned embodiments, or it may exist alone without being assembled into the device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by a device, the device includes:
  • the blockchain transaction identifier sent by the user obtain the certificate data from the blockchain certificate storage platform, and the certificate data includes the ciphertext of the original file, the decrypted file of the original file and the hash of the original file;
  • the hash of the file to be verified is consistent with the hash of the original file, and the certificate data is verified according to the hash of the certificate data and the hash of the certificate data in the blockchain.
  • the storage data is obtained from the blockchain storage platform, and the storage data includes the ciphertext of the original file, the decrypted file of the original file, and the original file.
  • the user's secret key and decrypted file parse the ciphertext of the original file to obtain the hash of the file to be verified; the hash of the file to be verified is consistent with the hash of the original file, according to the hash of the stored data
  • the hash of the certificate data in the blockchain to verify the certificate data.
  • verifying data on the blockchain only the hash of the evidence data needs to be uploaded to the chain. Even if the hash of the evidence data is stolen, the original file will not be leaked, so the risk of data leakage can be reduced.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

提供了校验数据的方法、装置、设备和计算机可读介质。方法包括:根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,存证数据包括原始文件的密文、原始文件的解密文件和原始文件的哈希(S101);按照用户的秘钥和原始文件的解密文件,解析原始文件的密文,得到待验证文件的哈希(S102);待验证文件的哈希与原始文件的哈希一致,根据存证数据的哈希和区块链中存证数据的哈希,校验存证数据(S103)。该实施方式在采用区块链校验数据的过程中,能够减少数据泄露的风险。

Description

校验数据的方法、装置、设备和计算机可读介质
相关申请的交叉引用
本申请要求享有2020年9月15日提交的申请号为202010968243.X的中国发明专利申请的优先权,其全部内容通过引用并入本文。
技术领域
本公开涉及计算机技术领域,尤其涉及一种校验数据的方法、装置、设备和计算机可读介质。
背景技术
区块链是一个共享数据库,存储于其中的数据或信息,具有不可伪造、全程留痕、可以追溯、公开透明和集体维护等特征。基于上述特征,区块链技术奠定了坚实的信任基础,创造了可靠的合作机制。
在实现本公开过程中,发明人发现现有技术中至少存在如下问题:采用区块链校验数据的过程中,数据泄露的风险较大。
发明内容
有鉴于此,本公开的实施例提供一种校验数据的方法、装置、设备和计算机可读介质,在采用区块链校验数据的过程中,能够减少数据泄露的风险。
为实现上述目的,根据本公开的实施例的一个方面,提供了一种校验数据的方法,包括:
根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,所述存证数据包括原始文件的密文、原始文件的解密文件和所述原始文件的哈希;
按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希;
所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中所述存证数据的哈希,校验所述存证数据。
所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希是按照预设上链数据模板设置的。
所述方法还包括:
所述存证数据存储至所述区块链存证平台后,所述区块链存证平台基于所述存证数据确定所述区块链交易标识;
所述区块链存证平台向所述用户反馈所述区块链交易标识。
所述存证数据存储至所述区块链存证平台后,所述区块链存证平台基于所述存证数据确定所述区块链交易标识,包括:
所述区块链存证平台依据用户发送的原始文件,建立并存储所述存证数据;
所述区块链存证平台校验所述存证数据与所述存证数据的哈希匹配,则将所述存证数据的哈希上链,并基于所述存证数据确定所述区块链交易标识。
所述根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,包括:
检验所述区块链交易标识有效;
根据所述区块链交易标识,从区块链存证平台获取存证数据,并显示用户的存证信息以接收所述用户的秘钥。
所述按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希,包括:
按照预设上链数据模板在所述存证数据中,获取所述原始文件的解密文件和所述原始文件的密文;
按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始 文件的密文,得到所述待验证文件;
基于所述待验证文件得到所述待验证文件的哈希。
所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中存证数据的哈希,校验所述存证数据,包括:
所述待验证文件的哈希与所述原始文件的哈希一致,则在区块链中获取所述存证数据的哈希;
比较所述存证数据的哈希和区块链中存证数据的哈希,校验所述存证数据。
在所述预设上链数据模板中,所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希之间以标识区分。
所述方法还包括:
所述区块链存证平台校验所述存证数据与所述存证数据的哈希不匹配,则验证失败。
所述检验所述区块链交易标识有效,包括:
依据区块链交易标识查询公证标识,查询到公证标识,则区块链交易标识有效。
所述方法还包括:
所述待验证文件的哈希与所述原始文件的哈希不同,则所述存证数据被修改。
根据本公开的实施例的第二方面,提供了一种校验数据的装置,包括:
获取模块,用于根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,所述存证数据包括原始文件的密文、原始文件的解密文件和所述原始文件的哈希;
解析模块,用于按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希;
校验模块,用于所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中所述存证数据的哈希,校验所述存证数据。
所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希是按照预设上链数据模板设置的。
根据本公开的实施例的第三方面,提供了一种校验数据的电子设备,包括:
一个或多个处理器;
存储装置,用于存储一个或多个程序,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上述的方法。
根据本公开的实施例的第四方面,提供了一种计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现如上述的方法。
上述发明中的一个实施例具有如下优点或有益效果:根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,存证数据包括原始文件的密文、原始文件的解密文件和原始文件夹的哈希;按照用户的秘钥和解密文件,解析原始文件的密文,得到待验证文件的哈希;待验证文件的哈希与原始文件的哈希一致,根据存证数据的哈希和区块链中存证数据的哈希,校验存证数据。在区块链校验数据的过程中,仅需要将存证数据的哈希上链,即使存证数据的哈希被盗取,也不会泄露原始文件,因此能够减少数据泄露的风险。
上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。
附图说明
附图用于更好地理解本公开,不构成对本公开的不当限定。其中:
图1是根据本公开的实施例的校验数据的方法的主要流程的示意图;
图2是根据本公开的实施例的校验数据的应用场景示意图;
图3是根据本公开的实施例的上链数据模板的示意图;
图4是根据本公开的实施例的区块链存证平台反馈区块链交易标识的流程示意图;
图5是根据本公开的实施例的确定区块链交易标识的流程示意图;
图6是根据本公开的实施例的从区块链存证平台获取存证数据的流程示意图;
图7是根据本公开的实施例的解析原始文件的密文的流程示意图;
图8是根据本公开的实施例的比较哈希的流程示意图;
图9是根据本公开的实施例的校验数据的交互示意图;
图10是根据本公开的实施例的数据上链的交互示意图;
图11是根据本公开的实施例的校验数据的装置的主要结构的示意图;
图12是本公开的实施例可以应用于其中的示例性系统架构图;
图13是适于用来实现本公开的实施例的终端设备或服务器的计算机系统的结构示意图。
具体实施方式
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开的实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。
目前,在区块链校验数据的过程中,用户可以利用公证平台校验数据。具体来说,用户在公证平台上传原始文件,依据原始文件的哈 希,校验原始文件的真实性。根据原始文件的哈希校验原始文件成功,则出具公证书;根据原始文件的哈希校验原始文件失败,则不能出具公证书。
原始文件需要妥善保存,如丢失就无法参与诉讼。在多处备份原始文件依然存在数据泄露的风险。如:保存原始文件的情况下,原始文件可能有意、无意或被黑客攻击被修改。
因此,在区块链校验数据的过程中,数据泄露的风险较大。
为了解决在区块链校验数据的过程中,数据泄露的风险较大的技术问题,可以采用以下本公开的实施例中的技术方案。
参见图1,图1是根据本公开的实施例的校验数据的方法主要流程的示意图,从区块链存证平台获取存证数据,解析原始文件的密文,通过比较存证数据的哈希和区块链中存证数据的哈希,校验存证数据。如图1所示,具体包括以下步骤:
S101、根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,存证数据包括原始文件的密文、原始文件的解密文件和原始文件的哈希。
在本公开的实施例中,可以以公证平台作为各步骤的执行主体。其中,公证平台接收用户发送的区块链交易标识,并从区块链存证平台获取存证数据。需要说明的是,存证数据包括原始文件的哈希、原始文件的密文和原始文件的解密文件。
参见图2,图2是根据本公开的实施例的校验数据的应用场景示意图。其中,用户可以向区块链存证平台上传原始文件,也可以向公证平台发送秘钥。区块链存证平台将存证数据的哈希上链。公证平台用于校验数据。
在本公开的实施例中,可以预先设置上链数据模板,这样原始文件的哈希、原始文件的密文和原始文件的解密文件可以按照预设上链数据模板设置。依据预设上链数据模板设置数据,以便于根据预设上链数据模板获取相关数据。
参见图3,图3是根据本公开的实施例的上链数据模板的示意图。其中,上链数据模板包括三部分。第一部分:原始文件的哈希;第二部分:原始文件的密文;第三部分:原始文件的解密文件。
其中,每部分之间可以以标识区分。作为一个示例,第一部分位于第一标识和第二标识之间;第二部分位于第二标识和第三标识之间;第三部分位于第三标识和第四标识之间。每部分中内容可以预先设置,图3仅是一个示例。也就是说,可以按照以下方式设置:第一部分:原始文件的密文;第二部分:原始文件的哈希;第三部分:原始文件的解密文件。
在本公开的实施例中,包括原始文件的哈希、原始文件的密文和原始文件的解密文件的存证数据是在区块链存证平台生成的。
参见图4,图4是根据本公开的实施例的区块链存证平台反馈区块链交易标识的流程示意图,具体包括:
S401、存证数据存储至区块链存证平台后,区块链存证平台基于存证数据确定区块链交易标识。
在本公开的实施例中,在区块链存证平台存储有存证数据。其中,用户上传原始文件至区块链存证平台,然后在区块链存证平台生成并存储存证数据。
参见图5,图5是根据本公开的实施例的确定区块链交易标识的流程示意图,具体包括:
S501、区块链存证平台依据用户发送的原始文件,建立并存储存证数据。
用户可以向区块链存证平台发送原始文件。在本公开的实施例中,原始文件就是用户需要验证的文件。然后计算原始文件的哈希。
在区块链存证平台中采用软件开发工具包(SDK),利用公钥加密原始文件得到原始文件的密文。需要说明的是,与公钥对应的私钥在用户处。也就说,公钥存储于区块链存证平台中。
然后,再嵌套原始文件的解密文件。作为一个示例,原始文件的解密文件可以是原始文件的解密脚本。如:该解密脚本可以包括常用解密算法,也可以包括定制解密算法。
在本公开的实施例中,采用用户处的私钥和原始文件的解密文件,就可以解密原始文件的密文,进而得到原始文件。
最后,将原始文件的哈希、原始文件的密文和原始文件的解密文件,按照预设上链数据模板设置为存证数据。
为了在区块链存证平台存储存证数据,需要计算存证数据的哈希。
S502、区块链存证平台校验存证数据与存证数据的哈希匹配,则将存证数据的哈希上链,并基于存证数据确定区块链交易标识。
区块链存证平台通过存证接口接收存证数据和存证数据的哈希,然后验证存证数据和存证数据的哈希。作为一个示例,基于存证数据计算验证存证数据的哈希。若验证存证数据的哈希与存证数据的哈希一致,则验证成功;若验证存证数据的哈希与验证数据的哈希不同,则验证失败。
在验证存证数据的哈希与存证数据的哈希一致的情况下,可以将存证数据的哈希上链。存证数据的哈希上链后,可以分别存储于不同的位置,即使存证数据的哈希发生泄漏,由于没有私钥,难以解密原始文件的哈希,原始文件泄漏的风险降低。
另外,基于存证数据确定区块链交易标识,以按照区块链交易标识在区块链存证平台获取存证数据。
在图5的实施例中,由区块链存证平台建立存证数据,并将存证数据的哈希上链,进而减低原始文件泄漏的风险。
S402、区块链存证平台向用户反馈区块链交易标识。
在区块链存证平台确定区块链交易标识后,就可以向用户反馈区块链交易标识。这样,用户可以基于区块链交易标识发起公证。
此外,区块链存证平台可以将存证数据的哈希和区块链交易标识,同步至公证平台,这样做的目的在于:为校验存证数据做准备。公证平台根据存证数据的哈希和区块链交易标识,生成公证标识。并将公证标识返回至区块链存证平台。区块链存证平台可以建立公证标识与 区块链交易标识的对应关系。
在图4的实施例中,用户上传原始文件至区块链存证平台,区块链存证平台将存证数据的哈希上链,进而减低原始文件泄漏的风险。
参见图6,图6是根据本公开的实施例的从区块链存证平台获取存证数据的流程示意图,具体包括以下步骤:
S601、检验区块链交易标识有效。
为了提高校验数据的效率,避免无效的区块链交易标识带来的影响。可以检验区块链交易标识是否有效,在检验区块链交易标识有效的情况下,可以获取存证数据。
作为一个示例,公证平台依据区块链交易标识查询公证标识,若能查询到公证标识,则检验区块链交易标识有效;若未查询到公证标识,则检验区块链交易标识无效。
S602、根据区块链交易标识,从区块链存证平台获取存证数据,并显示用户的存证信息以接收用户的秘钥。
区块链交易标识有效,则可以以区块链交易标识,从区块链存证平台获取存证数据。获取存证数据的目的在于:验证存证数据。
此外,显示用户的存证信息以接收用户的秘钥。用户看到存证信息后,可以输入与存证信息对应的秘钥。
作为一个示例,存证信息可以包括存证数据的名称、存证数据的存证时间、已经上链存证数据的哈希和区块链交易标识对应的公证标识。
在图6的实施例中,为了提高校验数据的效率,可以检测区块链交易标识是否有效,对于有效的区块链交易标识再获取存证数据。
S102、按照用户的秘钥和解密文件,解析原始文件的密文,得到待验证文件的哈希。
为了在公证平台解密存证数据中原始文件的密文,则需要从用户处获取秘钥。其中,用户的秘钥属于私钥。
按照用户的秘钥和解密文件,进而就可以得到待验证文件的哈希。
参见图7,图7是根据本公开的实施例的解析原始文件的密文的流程示意图,具体包括:
S701、按照预设上链数据模板在存证数据中,获取解密文件和原始文件的密文。
在本公开的实施例中,上链数据为存证数据的哈希,为了校验存证数据的哈希是否与上链数据一致,则需要计算得到待验证文件的哈希。其中,待验证文件是需要验证的文件。在验证成功的情况下,待验证文件即原始文件。
首先,需要获取原始文件的解密文件和原始文件的密文。原始文件的解密文件和原始文件的密文存储于存证数据中,那么可以按照预设上链数据模板在存证数据中,获取原始文件的解密文件和原始文件的密文。采用预设上链数据模板能够迅速获取相关文件。
作为一个示例,在上链数据模板中,原始文件的解密文件位于第一段,原始文件的密文位于第二段。则可以在存证数据的上链数据模板中的第一段中获取原始文件的解密文件,在存证数据的上链数据模板中的第二段中获取原始文件的密文。
S702、按照用户的秘钥和原始文件的解密文件,解析原始文件的密文,得到待验证文件。
按照用户的秘钥,采用原始文件的解密文件,就可以解析原始文件的密文,得到待验证文件。待验证文件有可能与原始文件相同,也有可能与原始文件不同。
S703、基于待验证文件得到待验证文件的哈希。
根据待验证文件,可以计算得到待验证文件的哈希。作为一个示例,可以根据待验证文件,使用标准hash-256算法生成待验证文件的哈希。
在图7的实施例中,为校验存证数据,可以解析原始文件的密文,进而得到待验证文件的哈希。
S103、待验证文件的哈希与原始文件的哈希一致,根据存证数据 的哈希和区块链中存证数据的哈希,校验存证数据。
通过比较存证数据的哈希和区块链中存证数据的哈希,就可以校验存证数据。
参见图8,图8是根据本公开的实施例的比较哈希的流程示意图,具体包括:
S801、待验证文件的哈希与原始文件的哈希一致,则在区块链中获取存证数据的哈希。
待验证文件的哈希与原始文件的哈希一致,则说明区块链存证平台中存证数据被修改的可能性较小,则可以获取区块链中的存证数据,以在区块链中的存证数据的哈希为基准,进行比较。
而待验证文件的哈希与原始文件的哈希不同,则说明区块链存证平台中的存证数据被修改。
S802、比较存证数据的哈希和区块链中存证数据的哈希,校验存证数据。
通过比较区块链存证平台的存证数据的哈希和区块链中存证数据的哈希,校验存证数据。
具体来说,区块链存证平台的存证数据的哈希和区块链中存证数据的哈希一致,则校验存证数据成功,可以向用户反馈公证书;区块链存证平台的存证数据的哈希和区块链中存证数据的哈希不同,则校验存证数据失败,可以向用户反馈校验失败。
在图8的实施例中,通过比较区块链存证平台的存证数据的哈希和区块链中存证数据的哈希,校验存证数据。
在上述本公开的实施例中,根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,存证数据包括原始文件的密文、原始文件的解密文件和原始文件夹的哈希;按照用户的秘钥和解密文件,解析原始文件的密文,得到待验证文件的哈希;待验证文件的哈希与原始文件的哈希一致,根据存证数据的哈希和区块链中存证数据的哈希,校验存证数据。在区块链校验数据的过程中,仅需要将存证数据 的哈希上链,即使存证数据的哈希被盗取,也不会泄露原始文件,因此能够减少数据泄露的风险。
参见图9,图9是根据本公开的实施例的校验数据的交互示意图,图9中包括用户、区块链存证平台和公证平台,具体包括:
S901、请求校验页面。
用户向公证平台发送请求校验页面的请求。
S902、显示校验页面。
公证平台向用户显示校验页面。
S903、输入区块链交易标识和秘钥。
用户可以在校验页面上输入区块链交易标识和秘钥。这样,公证平台可以验证区块链交易标识对应的存证数据。
S904、校验区块链交易标识有效。
公证平台依据区块链交易标识查询公证标识,若能查询到公证标识,则检验区块链交易标识有效;若未查询到公证标识,则检验区块链交易标识无效。
S905、获取存证数据。
公证平台基于区块链交易标识,向区块链存证平台发送获取存证数据的请求。
S906、反馈存证数据。
区块链存证平台接收到获取存证数据的请求后,向公证平台反馈存证数据。
S907、计算得到待验证文件的哈希。
公证平台基于存证数据中原始文件的密文和原始文件的解密文件,计算得到待验证文件的哈希。
S908、待验证文件的哈希与原始文件的哈希一致,且区块链存证平台存证数据的哈希和区块链中存证数据的哈希一致,校验存证数据成功。
在公证平台,待验证文件的哈希与原始文件的哈希一致的情况下,比较区块链存证平台存证数据的哈希和区块链中存证数据的哈希。区 块链存证平台存证数据的哈希和区块链中存证数据的哈希一致,校验存证数据成功。
S901、发送公证书。
校验数据成功的情况下,公证平台向用户发送公证书。
在图9的实施例中,用户仅需要向公证平台发送区块链交易标识和秘钥,就可以校验数据,进而收到公证书,操作简单的同时减少数据泄露的风险。
参见图10,图10是根据本公开的实施例的数据上链的交互示意图,结合图10示例性说明数据上链的方案,具体包括:
S1001、发送原始数据。
用户向区块链存证平台发送原始数据,目的在于将存证数据的哈希上链。
S1002、生成存证数据和存证数据的哈希。
在区块链存证平台中采用SDK,利用公钥加密原始文件得到原始文件的密文,再嵌套原始文件的解密文件,以及生成原始文件的哈希。按照预设上链数据模板,将原始文件的哈希、原始文件的密文和原始文件的解密文件,设置为存证数据。进而生成存证数据的哈希。
S1003、存证数据和存证数据的哈希匹配。
区块链存证平台通过存证接口接收存证数据和存证数据的哈希,然后验证存证数据和存证数据的哈希匹配。
S1004、存证数据的哈希上链。
将存证数据的哈希在区块链中存储,并生成区块链交易标识。
S1005、发送区块链交易标识。
区块链存证平台向用户发送区块链交易标识,以便用户通过区块链交易标识进行公证。
S1006、发送区块链交易标识。
区块链存证平台向公证平台发送区块链交易标识和存证数据的哈希。
S1007、生成公证标识。
公证平台根据存证数据的哈希和区块链交易标识,生成公证标识。
S1008、反馈公证标识。
公证平台向区块链存证平台反馈公证标识。区块链存证平台根据公证标识和区块链交易标识建立对应关系。
在图10的实施例中,通过区块链存证平台,将原始数据的哈希存储至区块链中,以便在公证时使用。
参见图11,图11是根据本公开的实施例的校验数据的装置的主要结构的示意图,校验数据的装置可以实现校验数据的方法,如图11所示,校验数据的装置具体包括:
获取模块1101,用于根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,所述存证数据包括原始文件的密文、原始文件的解密文件和所述原始文件的哈希;
解析模块1102,用于按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希;
校验模块1103,用于所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中所述存证数据的哈希,校验所述存证数据。
在本公开的一个实施例中,所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希是按照预设上链数据模板设置的。
在本公开的一个实施例中,获取模块1101,还用于控制所述存证数据存储至所述区块链存证平台后,控制所述区块链存证平台基于所述存证数据确定所述区块链交易标识;
控制所述区块链存证平台向所述用户反馈所述区块链交易标识。
在本公开的一个实施例中,获取模块1101,还用于控制所述区块链存证平台依据用户发送的原始文件,建立并存储所述存证数据;
控制所述区块链存证平台校验所述存证数据与所述存证数据的哈希匹配,则将所述存证数据的哈希上链,并基于所述存证数据确定所述区块链交易标识。
在本公开的一个实施例中,获取模块1101,具体用于检验所述区 块链交易标识有效;
根据所述区块链交易标识,从区块链存证平台获取存证数据,并显示用户的存证信息以接收所述用户的秘钥。
在本公开的一个实施例中,解析模块,具体用于按照预设上链数据模板在所述存证数据中,获取所述原始文件的解密文件和所述原始文件的密文;
按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到所述待验证文件;
基于所述待验证文件得到所述待验证文件的哈希。
在本公开的一个实施例中,校验模块1103,具体用于所述待验证文件的哈希与所述原始文件的哈希一致,则在区块链中获取所述存证数据的哈希;
比较所述存证数据的哈希和区块链中存证数据的哈希,校验所述存证数据。
图12示出了可以应用本公开的实施例的校验数据的方法或校验数据的装置的示例性系统架构1200。
如图12所示,系统架构1200可以包括终端设备1201、1202、1203,网络1204和服务器1205。网络1204用以在终端设备1201、1202、1203和服务器1205之间提供通信链路的介质。网络1204可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。
用户可以使用终端设备1201、1202、1203通过网络1204与服务器1205交互,以接收或发送消息等。终端设备1201、1202、1203上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等(仅为示例)。
终端设备1201、1202、1203可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。
服务器1205可以是提供各种服务的服务器,例如对用户利用终端 设备1201、1202、1203所浏览的购物类网站提供支持的后台管理服务器(仅为示例)。后台管理服务器可以对接收到的产品信息查询请求等数据进行分析等处理,并将处理结果(例如目标推送信息、产品信息--仅为示例)反馈给终端设备。
需要说明的是,本公开的实施例所提供的校验数据的方法一般由服务器1205执行,相应地,校验数据的装置一般设置于服务器1205中。
应该理解,图12中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。
下面参考图13,其示出了适于用来实现本公开的实施例的终端设备的计算机系统1300的结构示意图。图13示出的终端设备仅仅是一个示例,不应对本公开的实施例的功能和使用范围带来任何限制。
如图13所示,计算机系统1300包括中央处理单元(CPU)1301,其可以根据存储在只读存储器(ROM)1302中的程序或者从存储部分1308加载到随机访问存储器(RAM)1303中的程序而执行各种适当的动作和处理。在RAM 1303中,还存储有系统1300操作所需的各种程序和数据。CPU 1301、ROM 1302以及RAM 1303通过总线1304彼此相连。输入/输出(I/O)接口1305也连接至总线1304。
以下部件连接至I/O接口1305:包括键盘、鼠标等的输入部分1306;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1307;包括硬盘等的存储部分1308;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1309。通信部分1309经由诸如因特网的网络执行通信处理。驱动器1310也根据需要连接至I/O接口1305。可拆卸介质1311,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1310上,以便于从其上读出的计算机程序根据需要被安装入存储部分1308。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程 序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1309从网络上被下载和安装,和/或从可拆卸介质1311被安装。在该计算机程序被中央处理单元(CPU)1301执行时,执行本公开的系统中限定的上述功能。
需要说明的是,本公开所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们 有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开的实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括发送单元、获取单元、确定单元和第一处理单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定,例如,发送单元还可以被描述为“向所连接的服务端发送图片获取请求的单元”。
作为另一方面,本公开还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备包括:
根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,所述存证数据包括原始文件的密文、原始文件的解密文件和所述原始文件的哈希;
按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希;
所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中所述存证数据的哈希,校验所述存证数据。
根据本公开的实施例的技术方案,根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,存证数据包括原始文件的密文、原始文件的解密文件和原始文件夹的哈希;按照用户的秘钥和解密文件,解析原始文件的密文,得到待验证文件的哈希;待验证文件的哈希与原始文件的哈希一致,根据存证数据的哈希和区块链中存证数据的哈希,校验存证数据。在区块链校验数据的过程中,仅需要将存证数据的哈希上链,即使存证数据的哈希被盗取,也不会泄露原始文件, 因此能够减少数据泄露的风险。
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。

Claims (15)

  1. 一种校验数据的方法,包括:
    根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,所述存证数据包括原始文件的密文、原始文件的解密文件和所述原始文件的哈希;
    按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希;
    所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中所述存证数据的哈希,校验所述存证数据。
  2. 根据权利要求1所述校验数据的方法,其中,所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希是按照预设上链数据模板设置的。
  3. 根据权利要求1所述校验数据的方法,其中,所述方法还包括:
    所述存证数据存储至所述区块链存证平台后,所述区块链存证平台基于所述存证数据确定所述区块链交易标识;
    所述区块链存证平台向所述用户反馈所述区块链交易标识。
  4. 根据权利要求3所述校验数据的方法,其中,所述存证数据存储至所述区块链存证平台后,所述区块链存证平台基于所述存证数据确定所述区块链交易标识,包括:
    所述区块链存证平台依据用户发送的原始文件,建立并存储所述存证数据;
    所述区块链存证平台校验所述存证数据与所述存证数据的哈希匹配,则将所述存证数据的哈希上链,并基于所述存证数据确定所述区块链交易标识。
  5. 根据权利要求1所述校验数据的方法,其中,所述根据用户发 送的区块链交易标识,从区块链存证平台获取存证数据,包括:
    检验所述区块链交易标识有效;
    根据所述区块链交易标识,从区块链存证平台获取存证数据,并显示用户的存证信息以接收所述用户的秘钥。
  6. 根据权利要求1或2所述校验数据的方法,其中,所述按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希,包括:
    按照预设上链数据模板在所述存证数据中,获取所述原始文件的解密文件和所述原始文件的密文;
    按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到所述待验证文件;
    基于所述待验证文件得到所述待验证文件的哈希。
  7. 根据权利要求1或2所述校验数据的方法,其中,所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中存证数据的哈希,校验所述存证数据,包括:
    所述待验证文件的哈希与所述原始文件的哈希一致,则在区块链中获取所述存证数据的哈希;
    比较所述存证数据的哈希和区块链中存证数据的哈希,校验所述存证数据。
  8. 根据权利要求2所述校验数据的方法,其中,在所述预设上链数据模板中,所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希之间以标识区分。
  9. 根据权利要求3所述校验数据的方法,其中,所述方法还包括:
    所述区块链存证平台校验所述存证数据与所述存证数据的哈希不匹配,则验证失败。
  10. 根据权利要求5所述校验数据的方法,其中,所述检验所述区块链交易标识有效,包括:
    依据区块链交易标识查询公证标识,查询到公证标识,则区块链交易标识有效。
  11. 根据权利要求1或2所述校验数据的方法,其中,所述方法还包括:
    所述待验证文件的哈希与所述原始文件的哈希不同,则所述存证数据被修改。
  12. 一种校验数据的装置,包括:
    获取模块,用于根据用户发送的区块链交易标识,从区块链存证平台获取存证数据,所述存证数据包括原始文件的密文、原始文件的解密文件和所述原始文件的哈希;
    解析模块,用于按照所述用户的秘钥和所述原始文件的解密文件,解析所述原始文件的密文,得到待验证文件的哈希;
    校验模块,用于所述待验证文件的哈希与所述原始文件的哈希一致,根据所述存证数据的哈希和区块链中所述存证数据的哈希,校验所述存证数据。
  13. 根据权利要求1所述校验数据的装置,其中,所述原始文件的密文、所述原始文件的解密文件和所述原始文件的哈希是按照预设上链数据模板设置的。
  14. 一种校验数据的电子设备,包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-11中任一所述的方法。
  15. 一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-11中任一所述的方法。
PCT/CN2021/092033 2020-09-15 2021-05-07 校验数据的方法、装置、设备和计算机可读介质 WO2022057275A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010968243.XA CN112131599B (zh) 2020-09-15 2020-09-15 校验数据的方法、装置、设备和计算机可读介质
CN202010968243.X 2020-09-15

Publications (1)

Publication Number Publication Date
WO2022057275A1 true WO2022057275A1 (zh) 2022-03-24

Family

ID=73846754

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/092033 WO2022057275A1 (zh) 2020-09-15 2021-05-07 校验数据的方法、装置、设备和计算机可读介质

Country Status (2)

Country Link
CN (1) CN112131599B (zh)
WO (1) WO2022057275A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117827969A (zh) * 2023-12-22 2024-04-05 深圳哈希可信互联科技有限公司 数字公证方法、公证数据获取方法、设备和存储介质
CN117932696A (zh) * 2024-03-21 2024-04-26 中国信息通信研究院 一种基于区块链的数据分布式存储验证方法、介质及设备

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112131599B (zh) * 2020-09-15 2024-08-16 京东科技信息技术有限公司 校验数据的方法、装置、设备和计算机可读介质
CN113792349A (zh) * 2021-09-17 2021-12-14 上海万向区块链股份公司 基于区块链的数据存证校验方法及系统
CN114417391B (zh) * 2022-03-31 2022-07-15 浙江数秦科技有限公司 基于区块链的实验室论文存证系统
CN116192398A (zh) * 2023-01-05 2023-05-30 重庆易保全网络科技有限公司 基于区块链的电子证据认证和交换方法及系统
CN116401718A (zh) * 2023-06-08 2023-07-07 科大讯飞股份有限公司 基于区块链的数据保护方法及装置、电子设备和存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815530A (zh) * 2016-12-26 2017-06-09 北京爱接力科技发展有限公司 数据存证方法、数据校验方法及装置
US20180109516A1 (en) * 2016-10-13 2018-04-19 Coinplug, Inc. Method for providing certificate service based on smart contract and server using the same
CN108549825A (zh) * 2018-03-14 2018-09-18 中链科技有限公司 一种文件存证、验真和举证方法及装置
US20190098015A1 (en) * 2017-09-26 2019-03-28 Phm Associates Limited Integrity of Data Records
CN109740384A (zh) * 2019-01-11 2019-05-10 众安信息技术服务有限公司 基于区块链的数据存证方法和装置
CN111130751A (zh) * 2019-11-04 2020-05-08 杭州云萃流图网络科技有限公司 基于区块链的约定信息处理方法、装置、系统及电子设备
CN111523131A (zh) * 2020-04-16 2020-08-11 丝链(常州)控股有限公司 一种安全性高的加密数据存储方法
KR102147083B1 (ko) * 2019-09-30 2020-08-24 주식회사 디지털존 블록체인 기술을 이용한 전자문서 유효성 검증 시스템 및 그것의 제어 방법
CN112131599A (zh) * 2020-09-15 2020-12-25 北京海益同展信息科技有限公司 校验数据的方法、装置、设备和计算机可读介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260675B (zh) * 2015-10-16 2017-03-15 北京源创云网络科技有限公司 电子数据一致性验证方法、装置、系统及存证验证平台
KR20170054848A (ko) * 2015-11-10 2017-05-18 주식회사 리마커블소프트 전자통신 기기의 외부 정보 저장방법 및 이를 이용한 전자통신 기기의 외부 정보 인증 방법
US10114980B2 (en) * 2016-07-21 2018-10-30 Acronis International Gmbh System and method for verifying data integrity using a blockchain network
KR20190031989A (ko) * 2017-09-19 2019-03-27 주식회사 케이티 블록체인 기반의 전자 계약 처리 시스템 및 방법
CN111159651B (zh) * 2019-11-22 2024-02-09 上海华瑞银行股份有限公司 区块链在线存证方法与系统
CN111291339B (zh) * 2020-02-19 2024-02-06 上海方付通商务服务有限公司 一种区块链数据的处理方法、装置、设备及存储介质
CN111552676A (zh) * 2020-04-26 2020-08-18 北京众享比特科技有限公司 基于区块链的存证方法、装置、设备及介质

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180109516A1 (en) * 2016-10-13 2018-04-19 Coinplug, Inc. Method for providing certificate service based on smart contract and server using the same
CN106815530A (zh) * 2016-12-26 2017-06-09 北京爱接力科技发展有限公司 数据存证方法、数据校验方法及装置
US20190098015A1 (en) * 2017-09-26 2019-03-28 Phm Associates Limited Integrity of Data Records
CN108549825A (zh) * 2018-03-14 2018-09-18 中链科技有限公司 一种文件存证、验真和举证方法及装置
CN109740384A (zh) * 2019-01-11 2019-05-10 众安信息技术服务有限公司 基于区块链的数据存证方法和装置
KR102147083B1 (ko) * 2019-09-30 2020-08-24 주식회사 디지털존 블록체인 기술을 이용한 전자문서 유효성 검증 시스템 및 그것의 제어 방법
CN111130751A (zh) * 2019-11-04 2020-05-08 杭州云萃流图网络科技有限公司 基于区块链的约定信息处理方法、装置、系统及电子设备
CN111523131A (zh) * 2020-04-16 2020-08-11 丝链(常州)控股有限公司 一种安全性高的加密数据存储方法
CN112131599A (zh) * 2020-09-15 2020-12-25 北京海益同展信息科技有限公司 校验数据的方法、装置、设备和计算机可读介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117827969A (zh) * 2023-12-22 2024-04-05 深圳哈希可信互联科技有限公司 数字公证方法、公证数据获取方法、设备和存储介质
CN117932696A (zh) * 2024-03-21 2024-04-26 中国信息通信研究院 一种基于区块链的数据分布式存储验证方法、介质及设备

Also Published As

Publication number Publication date
CN112131599A (zh) 2020-12-25
CN112131599B (zh) 2024-08-16

Similar Documents

Publication Publication Date Title
WO2022057275A1 (zh) 校验数据的方法、装置、设备和计算机可读介质
US11683187B2 (en) User authentication with self-signed certificate and identity verification and migration
CA3058238C (en) Data isolation in blockchain networks
WO2019179541A2 (en) Improving integrity of communications between blockchain networks and external data sources
US20200084045A1 (en) Establishing provenance of digital assets using blockchain system
WO2019101240A2 (en) Authentication based on a recoverd public key
CA3027741A1 (en) Blockchain systems and methods for user authentication
EP3673640B1 (en) Processing data elements stored in blockchain networks
CN113765968A (zh) 一种文件传输方法、装置和系统
CN111193704B (zh) Http通信方法、装置及可读存储介质
US9544153B1 (en) Compression of cryptographic chaining certificates
WO2022088710A1 (zh) 一种镜像管理方法及装置
KR20210014084A (ko) 블록체인을 이용한 전자 데이터 제공 방법 및 그 시스템
TW201032084A (en) System for managing the external access of electronic file and method of the same
CN111832046A (zh) 一种基于区块链技术的可信数据存证方法
CN113761585A (zh) 一种数据处理方法、装置和系统
CN114157414B (zh) 一种关于数字货币的身份凭证生成方法、验证方法及系统
US20240202677A1 (en) Digital Currency Payment Method, Apparatus, and System
CN115222528A (zh) 一种交易过程中拆分数字货币的方法、终端及系统
CN115222391A (zh) 一种对交易过程中的数字货币进行验证的方法和终端
CN112783973A (zh) 确定数据完整性的方法、相关装置和数据完整性保护系统
CN110611656A (zh) 一种基于主身份多重映射的身份管理方法、装置及系统

Legal Events

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

Ref document number: 21868113

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21868113

Country of ref document: EP

Kind code of ref document: A1