WO2021051757A1 - 一种基于二维码的文件获取方法及设备、二维码生成方法 - Google Patents

一种基于二维码的文件获取方法及设备、二维码生成方法 Download PDF

Info

Publication number
WO2021051757A1
WO2021051757A1 PCT/CN2020/078469 CN2020078469W WO2021051757A1 WO 2021051757 A1 WO2021051757 A1 WO 2021051757A1 CN 2020078469 W CN2020078469 W CN 2020078469W WO 2021051757 A1 WO2021051757 A1 WO 2021051757A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
file
encrypted
unique value
dimensional code
Prior art date
Application number
PCT/CN2020/078469
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 尤尼泰克(嘉兴)信息技术有限公司
Priority to US17/422,934 priority Critical patent/US11979505B2/en
Publication of WO2021051757A1 publication Critical patent/WO2021051757A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09CCIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
    • G09C5/00Ciphering apparatus or methods not provided for in the preceding groups, e.g. involving the concealment or deformation of graphic data such as designs, written or printed messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3263Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving certificates, e.g. public key certificate [PKC] or attribute certificate [AC]; Public key infrastructure [PKI] arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K19/00Record carriers for use with machines and with at least a part designed to carry digital markings
    • G06K19/06Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code
    • G06K19/06009Record carriers for use with machines and with at least a part designed to carry digital markings characterised by the kind of the digital marking, e.g. shape, nature, code with optically detectable marking
    • G06K19/06046Constructional details

Definitions

  • the present invention relates to the field of software methods, especially two-dimensional code technology.
  • the current technology does not provide good security protection for downloaded content. Generally, what content is downloaded and what content is displayed. This will create a series of problems. First, users cannot obtain the content they need; second, users may obtain some content that carries Trojan horses. From the perspective of the service provider, the service provider may cause data confusion when maintaining the terminal server, causing the user to obtain some other user's information, resulting in irreparable consequences.
  • a set of secure information protection process is designed so that there will be no errors in the process of information circulation on the network, preventing information tampering, and ensuring information security.
  • the present invention solves the technical problems of easy tampering and poor security when data is obtained based on two-dimensional code storage in the prior art, and realizes safe and reliable information protection.
  • the present invention provides
  • a file acquisition method based on a QR code including:
  • Step 1 Parse the two-dimensional code to obtain two-dimensional code encoded data, the encoded data includes: a first unique value, encrypted data, and signature data;
  • Step 2 Verify the signature data
  • Step 3 n-1 data segment l n-1 storage address S n-1 ; n is the number of data segments obtained after file splitting;
  • Step 4 Obtain the nith data segment l ni of the encrypted file according to the storage address S ni of the nith data segment l ni , analyze the nith data segment l ni , and obtain the nith part A ni of the encrypted file
  • the storage address S n-(i+1) of the n-(i+1) data segment l n-(i+ 1), i 1, 2, 3,..., n-2; according to the first data segment
  • the storage address S 1 of l 1 obtains the first data segment of the encrypted file, analyzes the first data segment to obtain the first part A 1 of the encrypted file; integrates the first part A 1 to the nth part A of the encrypted file n , obtain encrypted files;
  • Step 5 Verify the encrypted file according to the first unique value to obtain the decrypted file.
  • the step 5 includes:
  • Step 5.1 Calculate the unique value of the encrypted file to obtain the second unique value of the encrypted file
  • Step 5.2 Compare the second unique value with the first unique value. If the second unique value is equal to the first unique value, decrypt the encrypted file, and if the second unique value is not equal to the first unique value, stop the file decryption process.
  • the step 2 includes:
  • the digital certificate is used to verify the signature data. If the digital certificate verifies that the signature is correct, step 3 is executed; if the verification fails, the execution of the two-dimensional code-based file acquisition method is suspended.
  • the n-th data segment by the head character X n, A n and the n-th part of the encrypted file stitching composition, comprising the displacement X n T, n the analysis of the data segment is mapped characters head x n obtains the n-1th storage address S n-1 , and the head character x n corresponds to the server storage address one-to-one, or the storage address is calculated by using a preset function relationship between the server storage address and the displacement T.
  • a method for generating a QR code including:
  • Step 1 Calculate the encrypted file to obtain the first unique value
  • Step 2 Split the encrypted file to obtain the first part A 1 , the second part A 2 , to the nth part A n of the encrypted file, and the first part A 1 and the second part A 2 of the encrypted file to
  • the n-1 part An-1 is stored to n-1 storage addresses S 1 , S 2 , to S n-1 on the server, and the encrypted file address is obtained;
  • Step 3 Encrypt the n-th data segment l n and the encrypted file address to obtain encrypted data;
  • the n-th data segment l n is the storage address S n- of the n-1th data segment on the server obtained after analysis. 1 and the data section of Part A n of the encrypted file;
  • Step 4 Sign the first unique value and encrypted data to obtain signature data
  • Step 5 Encode the first unique value, encrypt the data, and the signature data to form a QR code.
  • the calculation performed on the file in step 3 includes: irreversible acquisition of data
  • the step 4 includes using a digital certificate to sign the encrypted data for the first unique value.
  • the n-th data segment by the head character X n, A n and the n-th part of the encrypted file stitching composition, comprising the displacement X n T, n the analysis of the data segment is mapped characters head x n obtains the n-1th storage address S n-1 , and the head character x n corresponds to the server storage address one-to-one, or the storage address is calculated by using a preset function relationship between the server storage address and the displacement T.
  • a file acquisition device based on a QR code including:
  • the scanning and analyzing unit is used to obtain and analyze a two-dimensional code to obtain encoded data
  • a data processing unit configured to obtain encrypted data, a first unique value, and signature data according to the encoded data
  • a data decryption unit where the data decryption unit is used to verify the signature data
  • file downloading unit for downloading the encrypted file from the encrypted file address; integrating the first encrypted file portion 1 A 1, the second portion A 2, A n to n-th unit, to obtain an encrypted file;
  • a file verification unit which is used to verify encrypted files.
  • the document verification unit includes:
  • a unique value calculation subunit performs a unique value calculation for the encrypted file to obtain a second unique value
  • the comparison subunit is used to compare the first unique value with the second unique value; if the second unique value is equal to the first unique value, decrypt the encrypted file, if the second unique value is not equal to the first unique value , Abort the file decryption process.
  • the data decryption unit uses a digital certificate to verify the signature data, and if the verification passes, step 3 is executed, and if the verification fails, the execution of the two-dimensional code-based file acquisition method is suspended.
  • the n-th data segment by the head character X n, A n and the n-th part of the encrypted file stitching composition, comprising the displacement X n T, n the analysis of the data segment is mapped characters head x n obtains the n-1th storage address S n-1 , and the head character x n corresponds to the server storage address one-to-one, or the storage address is calculated by using a preset function relationship between the server storage address and the displacement T.
  • the invention provides a method and equipment for obtaining a file based on a two-dimensional code, and a method for generating a two-dimensional code, which stores the signature data, the unique value and the URL data code in the two-dimensional code, and flexibly utilizes the data certificate technology and the unique value verification technology, While ensuring the security of the download link in the QR code, it also ensures the reliability of the downloaded document.
  • Fig. 1 is a flowchart of a method for generating a QR code according to Embodiment 1 of the present invention
  • FIG. 2 is a flowchart of a file acquisition method based on a two-dimensional code provided by the second embodiment of the present invention
  • the present invention provides a two-dimensional code-based file acquisition method and device, and a two-dimensional code generation method.
  • This embodiment provides a two-dimensional code encoding method, as shown in FIG. 1, and the steps are as follows:
  • the unique value is an irreversible value, that is, it is possible to calculate the text content through the unique value in reverse. This can protect the text information from leaking.
  • the calculation method of the unique value can be SHA-256, SM3 and other cryptographic hash function algorithms.
  • the process of storing the above text can be uploaded by the user himself or completed by the agent of the service provider.
  • the type of text can be picture, text, video, audio and other information files that can be binarized.
  • the above-mentioned digital certificate may be a CA organization with a national digital certificate license, or a digital certificate produced by the service provider itself.
  • the encryption process must be the certificate private key. This can ensure that only the certificate public key is contained on the decryption device, and the private key does not need to be exposed.
  • the present invention adds information safety protection measures at the two-dimensional code download address data level and the document data level, which can effectively prevent information from being tampered with, and prevent documents from being dropped and modified.
  • the present invention uses split storage, and the storage address A storage method that requires progressive calculation through a preset mapping method can save storage space, effectively protect text information, and prevent file tampering.
  • This embodiment provides a method and device for generating a two-dimensional code, as shown in FIG. 2.
  • the decoding and decoding equipment contains digital certificates, which specifically include:
  • Scan analysis module capture the image of the QR code and try to analyze it to obtain the QR code
  • Data processing module Separate the two-dimensional code data, obtain encrypted data, unique value A, signature information.
  • Data verification module Use digital certificates to verify the authenticity of the information obtained in the QR code. If the digital certificate is verified correctly, it means that the encrypted data and the unique value A are valid information and have not been tampered with. If the digital certificate is incorrectly verified, it means that the QR code data may be tampered with, and no further operation is required.
  • Data decoding module for the encrypted address, use the digital certificate to decode the data. After the decoding is successful, the URL of the network request address and the last data group written into the QR code are obtained; the last data group is separated to obtain the last data segment and the data at the end.
  • the 8-bit data of the group header is processed according to the preset function or corresponding table to obtain the file storage location of the penultimate segment, and the data group of the penultimate segment is obtained from the storage location of the penultimate segment.
  • the second data segment is separated to obtain the 8-bit data corresponding to the header of the segment, the storage location of the third-to-last segment is obtained, and all the data segments of the file are obtained.
  • Download document module Download documents through URL, obtain data segments located in all locations and combine them into files. Download documents are not allowed to be opened immediately to prevent virus threats.
  • File verification module Perform unique value processing on multiple data segments that are merged and downloaded to obtain unique value B, and compare unique values A and B. If the data is consistent, it means that the obtained document is the original data stored at that time. If the comparison is inconsistent, it means that the downloaded document has been tampered with and the information is incorrect. Or the downloaded file may be a virus, there is a risk, it is not allowed to open, to protect the user's safety.
  • the analysis process includes:
  • the AB is inconsistent, it proves that the document is at risk and the operation is suspended; if the AB is consistent, it proves that the downloaded document is a user uploaded document and can be downloaded safely.
  • the present invention encodes the signature data and the calculated unique value together with the URL into the QR code, and flexibly uses digital certificate technology, including digital certificate encryption and decryption and signature extension technology, to ensure the safety of information.
  • digital certificate technology including digital certificate encryption and decryption and signature extension technology, to ensure the safety of information.
  • the verification mechanism uses the principle that after the same data undergoes a unique value operation, the same value is generated to compare the unique value of the same information at different stages, so as to prove whether the information has been tampered with, and to ensure information security without leakage.
  • the method for obtaining a data carrier of a two-dimensional code provided by the embodiment of the present invention has the following beneficial effects:
  • the present invention uses the combination of two-dimensional code and digital certificate encryption and decryption and signature methods to improve data security and effectively prevent data from tampering;
  • the asymmetric encryption setting to verify the reliability of the data is used to strengthen the data security of the download address
  • the two-dimensional code information protection method of the present invention can verify the security of text information in the final step, ensure that the downloaded text is the initial uploaded text, and ensure the one-to-one correspondence of information acquisition.
  • the split storage adopted by the present invention and the storage address needs to be obtained by progressive calculation through a preset mapping method, can save storage space, effectively protect text information, and prevent file tampering.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

本发明涉及数据识别领域,特别是二维码技术。本发明提出一种基于二维码的文件获取方法,包括:步骤1:解析二维码,获得二维码编码数据,所述编码数据包括:第一唯一值,加密数据,签名数据;步骤2:验证签名数据;步骤3:解密加密数据,获得文件地址及第n数据段ln;步骤4:根据第n数据段ln及文件地址获取加密文件;步骤5:根据第一唯一值核验加密文件,获得解密文件。本发明解决了基于二维码存储获取数据时易篡改,安全性差的技术问题,实现安全可靠的信息保护。

Description

一种基于二维码的文件获取方法及设备、二维码生成方法 技术领域
本发明涉及软件方法领域,特别是二维码技术。
背景技术
现有技术对于二维码的使用,一般都是通过网络请求的形式达到相应的需求,而数据内容是存储在终端的。现有技术虽然可以实现很多功能,但是其信息的安全性是不可靠的。
首先,由于现有技术的二维码生成解析技术大都是公开技术,所以篡改二维码内的数据,改变其URL网络地址是相当容易实现的。这是现有技术中存在的弱点一,不法分子可以利用这点,让用户通过他们篡改的地址下载内容,以达到其非法目的。
再者,现在技术对于下载内容并没有做很好的安全性保护。一般都是下载什么内容,展示什么内容。这将产生一些列问题。第一,用户无法获得其需要的内容;第二,用户可能获取一些携带木马的内容。站在服务商角度,服务商可能在维护终端服务器时,导致数据错乱,导致用户获取了一些其他用户的信息,产生无法弥补的后果。
所以针对现有技术,设计一套安全的信息保护流程,使得信息在网络流通过程中不会出现误差,防止信息篡改,保证信息安全。
发明内容
本发明为解决现有技术存在的基于二维码存储获取数据时易篡改,安全性差的技术问题,实现安全可靠的信息保护,本发明提供
一种基于二维码的文件获取方法,包括:
步骤1:解析二维码,获得二维码编码数据,所述编码数据包括:第一唯一值,加密数据,签名数据;
步骤2:验证签名数据;
步骤3:若签名数据验证通过,则解密加密数据,获得加密文件地址及第n数据段l n,解析第n数据段l n获得所述加密文件的第n部A n及位于服务器上的第n-1数据段l n-1的存储地址S n-1;n为文件拆分后获得的数据段个数;
步骤4:根据第n-i数据段l n-i的存储地址S n-i获取所述加密文件的第n-i数据段l n-i,解析所述第n-i数据段l n-i,获得所述加密文件的第n-i部A n-i及第n-(i+1)数据段l n-(i+1)的存储地址S n-(i+1),i=1,2,3,……,n-2;根据第1数据段l 1的存储地址S 1获取所述加密文件的第1数据段,解析第1数据段获得所述加密文件的第1部A 1;整合所述加密文件第1部A 1至第n部A n,获得加密文件;
步骤5:根据第一唯一值核验加密文件,获得解密文件。
优选的,所述步骤5包括:
步骤5.1:对加密文件做唯一值计算,获得加密文件的第二唯一值;
步骤5.2:对比第二唯一值与第一唯一值,若第二唯一值与第一唯一值相等,则解密加密文件,若第二唯一值与第一唯一值不等,则中止文件解密过程。
优选的,所述步骤2包括:
利用数字证书验证所述签名数据,若数字证书验证签名正确,则执行步骤3;若验证失败,则中止执行所述的基于二维码的文件获取方法。
优选的,所述第n数据段由头部字符x n,及所述加密文件的第n部A n拼接组成,所述x n包括位移T,所述解析第n数据段为映射头部字符x n获得第n-1存储地址S n-1,所述头部字符x n与服务器存储地址一一对应,或利用预设的服务器存储地址与位移T的函数关系计算得到存储地址。
一种二维码生成方法,包括:
步骤1:针对加密文件进行计算,获得第一唯一值;
步骤2:拆分加密文件,获得所述加密文件的第1部A 1,第2部A 2,至第n部A n,将加密文件的第1部A 1,第2部A 2,至第n-1部An-1存储至服务器上的n-1个存储地址S 1,S 2,至S n-1,并获得加密文件地址;
步骤3:针对第n数据段l n,及加密文件地址进行加密,获得加密数据;所述第n数据段l n为解析后获得位于服务器上的第n-1数据段的存储地址S n-1及加密文件第A n部的数据段;
步骤4:针对所述第一唯一值,及加密数据进行签名,获得签名数据;
步骤5:编码第一唯一值,加密数据,及签名数据形成二维码。
优选的,所述步骤3针对文件进行的计算包括:不可逆向获取数
据信息算法,或密码散列函数算法。
优选的,所述步骤4包括,利用数字证书针对所述第一唯一值,加密数据进行签名。
优选的,所述第n数据段由头部字符x n,及所述加密文件的第n部A n拼接组成,所述x n包括位移T,所述解析第n数据段为映射头部字符x n获得第n-1存储地址S n-1,所述头部字符x n与服务器存储地址一一对应,或利用预设的服务器存储地址与位移T的函数关系计算得到存储地址。
一种基于二维码的文件获取设备,包括:
扫描解析单元,所述扫描解析单元用于获取并解析二维码,获得编码数据;
数据处理单元,所述数据处理单元用于根据编码数据获得加密数据,第一唯一值,签名数据;
数据解密单元,所述数据解密单元用于验证签名数据;
若签名数据验证通过,则解密加密数据,获得加密文件地址及第n数据段l n,解析第n数据段l n获得所述加密文件的第n部A n及位于服务器上的第n-1数据段l n-1的存储地址S n-1;n为文件拆分后获得的数据段个数;根据第n-i数据段l n-i的存储地址S n-i获取所述加密文件的第n-i数据段l n-i,解析所述第n-i数据段l n-i,获得所述加密文件的第n-i部A n-i及第n-(i+1)数据段l n-(i+1)的存储地址S n-(i+1),i=1,2,3,……,n-2;根据第1数据段l 1的存储地址S 1获取所述加密文 件的第1数据段,解析第1数据段获得所述加密文件的第1部A 1
文件下载及组合单元,所述文件下载单元用于根据加密文件地址下载加密文件;整合所述加密文件第1部A 1,第2部A 2,至第n部A n,获得加密文件;
文件核验单元,所述文件核验单元用于核验加密文件。
优选的,所述文件核验单元包括:
唯一值计算子单元,所述唯一值计算子单元针对加密文件进行唯一值计算,获得第二唯一值;
比较子单元,所述比较子单元用于比较第一唯一值与第二唯一值;若第二唯一值与第一唯一值相等,解密加密文件,若第二唯一值与第一唯一值不等,中止文件解密过程。
优选的,所述数据解密单元利用数字证书验证签名数据,若验证通过,则执行步骤3,若验证不通过,则中止执行所述的基于二维码的文件获取方法。
优选的,所述第n数据段由头部字符x n,及所述加密文件的第n部A n拼接组成,所述x n包括位移T,所述解析第n数据段为映射头部字符x n获得第n-1存储地址S n-1,所述头部字符x n与服务器存储地址一一对应,或利用预设的服务器存储地址与位移T的函数关系计算得到存储地址。
本发明提供的一种基于二维码的文件获取方法及设备,二维码生成方法,将签名数据、唯一值与网址数据编码存储至二维码,灵活利 用数据证书技术,唯一值核验技术,保证二维码内下载链接安全的同时,确保下载文档的可靠性。
附图说明
图1为本发明实施例一提供的二维码生成方法流程图
图2为本发明实施例二提供的基于二维码的文件获取方法流程图
具体实施方式
下面结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护范围。
鉴于现有的方法存在的基于二维码存储获取数据时易篡改,安全性差的技术问题,本发明提供一种基于二维码的文件获取方法及设备、二维码生成方法。
实施例一
本实施例提供了一种二维码编码方法,如图1所示,步骤如下:
1.计算文件唯一值。唯一值为不可逆值,即无论如何都可能通过唯一值反向计算出文本内容。这可以保护文本信息不会泄露。唯一值的计算方法,可以为SHA-256,SM3等密码散列函数算法。
2.将文件转化为16位数据文件,并将拆分16位数据文件为n份,获得n个数据段,将上述数据段存放在服务区的n个位置。随机选择一个10以内的数字Y。
将第一头部文件00000000,和第一段数据段拼接获得第一数据组存放于第一数据区,计算第一数据区按照预设在本地或二维码里的的函数关系计算获得位置x 1,将位置参数x 1与Y做函数关系获得第二头部文件,再将第二头部文件与第二数据段整合存放于第二数据区,计算第一数据区按照预设在本地或二维码里的的函数关系计算获得位置x 2,将文件的第三数据段存储至位置第三数据区……;直到第n段数据段长度不足32位时,保存数据表,将与x n-1相关的第n头部文件和剩下的末尾数据段数写入二维码的末段数据组。
获得网络地址,或者是该网络地址的映射地址。
上述文本存放的过程可以由用户自己上传,或者是由服务商代理完成。文本的类型可以为,图片,文字,视频,音频等可二进制化的信息文件。
3.将网络地址和末段数据组通过数字证书私钥加密,生成加密数据。
上述数字证书,可以是拥有国家数字证书执照的CA机构,也可以是服务商自己生产的数字证书。加密过程必须为证书私钥。这样可以保证解密设备上只含有证书公钥,不需要暴露私钥。
4.将唯一值A,加密数据,利用数字证书进行签名,生成签名信息。
5.将签名信息,唯一值A,加密数据,整合生成二维码。
本发明在二维码下载地址数据层面,及文档数据层面都加入了信息安全保护措施,可以有效的防止信息被篡改,防止文档被掉包修改 等问题;本发明采用的拆分存储,且存储地址需经预设映射方式进行递进的计算获得的存储方式,可节约存储空间,有效保护文本信息,防止文件篡改。
实施例二
本实施例提供一种二维码生成方法及设备,如图2所示。
解码及解码设备内含有数字证书,具体包括:
1.扫描解析模块:捕捉二维码图像,并尝试解析,获得二维码
内数据;
2.数据处理模块:分离二维码数据,获取加密数据,唯一值A,签名信息。
3.数据验证模块:利用数字证书验签二维码内获取信息的真实性。如果数字证书验签正确,则说明加密数据及唯一值A为有效信息,未被篡改过。如果数字证书验签错误,则说明二维码数据可能存在被篡改的风险,不再进行下一步操作。
数据解码模块:针对加密地址,利用数字证书进行数据解码,解码成功之后获得网络请求地址URL及写入二维码的末段数据组;分离末段数据组,获得末尾数据段及位于末段数据组头部的8位数据,根据预设的函数或对应表格处理上述8位数据获得倒数第二段的文件存储位置,从倒数第二段的存储位置获得该倒数第二段的数据组,倒数第二段数据段并分离获得对应该段的头部的8位数据,获得倒数第三段的存储位置,循环至获得文件的所有数据段。
4.下载文档模块:通过URL下载文档,获得位于所有位置的数 据段组合为文件下载文档不允许立即打开,防止病毒威胁。
5.文件核验模块:对合并下载的多个数据段做唯一值处理,获得唯一值B,比对唯一值A和B。如果数据一致,说明获取的文档为当时存储的原始数据。如比对不一致,说明下载文档已被篡改,信息有误。或者下载文档可能为病毒,存在风险,不允许打开,保护用户使用安全。
解析流程包括:
解析二维码,获取二维码内的加密地址,唯一值A,签名信息;
数据信息验签;
加密信息解密,获得网址链接;
通过网址链接下载文档,计算文档唯一值B
对比唯一值A与唯一值B;
若AB不一致,证明文档存在风险,中止运行;若AB一致,证明下载文档为用户上传文档,可安全下载。
本发明将签名数据,以及计算获得的唯一值与网址一起编码至二维码内,灵活的运用数字证书技术,包括数字证书的加解密及延签技术,来保证信息的安全,通过唯一值的核验机制,利用相同数据经过唯一值运算之后,产生的值相同的原理,对比不同阶段下,相同信息的唯一值,从而证明信息是否被篡改,保证信息安全无泄漏。
综上所述,本发明的实施例提供的二维码的数据载体获取方法,具有以下有益效果:
(1)本发明利用二维码与数字证书的加解密和签名方法的结合, 提高数据的安全性,有效防止数据防篡;
(2)本发明的二维码编码及解码流程中,通过验证数据可靠性的非对称性加密设置,来加强下载地址数据安全;
(3)本发明的二维码信息保护方法,可以在最终步骤验证文本信息的安全性,确保下载文本为初始上传文本,保证信息获取的一一对应性。
(4)本发明采用的拆分存储,且存储地址需经预设映射方式进行递进的计算获得的存储方式,可节约存储空间,有效保护文本信息,防止文件篡改。
以上所述的具体实施例,对本发明的目的,技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施例,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (12)

  1. 一种基于二维码的文件获取方法,其特征在于,包括:
    步骤1:解析二维码,获得二维码编码数据,所述编码数据包括:第一唯一值,加密数据,签名数据;
    步骤2:验证签名数据;
    步骤3:若签名数据验证通过,则解密加密数据,获得加密文件地址及第n数据段I n,解析第n数据段I n获得所述加密文件的第n部A n及位于服务器上的第n-1数据段I n-1的存储地址S n-1;n为文件拆分后获得的数据段个数;
    步骤4:根据第n-i数据段I n-i的存储地址S n-i获取所述加密文件的第n-i数据段I n-i,解析所述第n-i数据段I n-i,获得所述加密文件的第n-i部A n-i及第n-(i+1)数据段I n-(i+1)的存储地址S n-(i+1),i=1,2,3,……,n-2;根据第1数据段I 1的存储地址S 1获取所述加密文件的第1数据段,解析第1数据段获得所述加密文件的第1部A 1;整合所述加密文件第1部A 1至第n部A n,获得加密文件;
    步骤5:根据第一唯一值核验加密文件,获得解密文件。
  2. 一种如权利要求1所述的基于二维码的文件获取方法,其特征在于,所述步骤5包括:
    步骤5.1:对加密文件做唯一值计算,获得加密文件的第二唯一值;
    步骤5.2:对比第二唯一值与第一唯一值,若第二唯一值与第一唯一值相等,则解密加密文件,若第二唯一值与第一唯一值不等,则中止文件解密过程。
  3. 一种如权利要求1所述的基于二维码的文件获取方法,其特征在于,所述步骤2包括:
    利用数字证书验证所述签名数据,若数字证书验证签名正确,则执行步骤3;若验证失败,则中止执行所述的基于二维码的文件获取方法。
  4. 一种如权利要求1所述的基于二维码的文件获取方法,其特征在于,所述第n数据段由头部字符x n,及所述加密文件的第n部A n拼接组成,所述x n包括位移T,所述解析第n数据段为映射头部字符x n获得第n-1存储地址S n-1,所述头部字符x n与服务器存储地址一一对应,或利用预设的服务器存储地址与位移T的函数关系计算得到存储地址。
  5. 一种二维码生成方法,其特征在于,包括:
    步骤1:针对加密文件进行计算,获得第一唯一值;
    步骤2:拆分加密文件,获得所述加密文件的第1部A 1,第2部A 2,至第n部A n,将加密文件的第1部A 1,第2部A 2,至第n-1部An-1存储至服务器上的n-1个存储地址S 1,S 2,至S n-1,并获得加密文件地址;
    步骤3:针对第n数据段I n,及加密文件地址进行加密,获得加密数据;所述第n数据段I n为解析后获得位于服务器上的第n-1数据段的存储地址S n-1及加密文件第A n部的数据段;
    步骤4:针对所述第一唯一值,及加密数据进行签名,获得签名数据;
    步骤5:编码第一唯一值,加密数据,及签名数据形成二维码。
  6. 一种如权利要求5所述二维码生成方法,其特征在于,所述步骤3针对文件进行的计算包括:不可逆向获取数据信息算法,或密码散列函数算法。
  7. 一种如权利要求5所述二维码生成方法,其特征在于,所述步骤4包括,利用数字证书针对所述第一唯一值,加密数据进行签名。
  8. 一种如权利要求5所述二维码生成方法,其特征在于,所述第n数据段由头部字符x n,及所述加密文件的第n部A n拼接组成,所述x n包括位移T,所述解析第n数据段为映射头部字符x n获得第n-1存储地址S n-1,所述头部字符x n与服务器存储地址一一对应,或利用预设的服务器存储地址与位移T的函数关系计算得到存储地址。
  9. 一种基于二维码的文件获取设备,其特征在于,包括:
    扫描解析单元,所述扫描解析单元用于获取并解析二维码,获得编码数据;
    数据处理单元,所述数据处理单元用于根据编码数据获得加密数据,第一唯一值,签名数据;
    数据解密单元,所述数据解密单元用于验证签名数据;
    若签名数据验证通过,则解密加密数据,获得加密文件地址及第n数据段I n,解析第n数据段I n获得所述加密文件的第n部A n及位于服务器上的第n-1数据段I n-1的存储地址S n-1;n为文件拆分后获得的数据段个数;根据第n-i数据段I n-i的存储地址S n-i获取所述加密文件的第n-i数据段I n-i,解析所述第n-i数据段I n-i,获得所述加密文 件的第n-i部A n-i及第n-(i+1)数据段I n-(i+1)的存储地址S n-(i+1),i=1,2,3,......,n-2;根据第1数据段I 1的存储地址S 1获取所述加密文件的第1数据段,解析第1数据段获得所述加密文件的第1部A 1
    文件下载及组合单元,所述文件下载单元用于根据加密文件地址下载加密文件;整合所述加密文件第1部A 1,第2部A 2,至第n部A n,获得加密文件;
    文件核验单元,所述文件核验单元用于核验加密文件。
  10. 一种如权利要求9所述基于二维码的文件获取设备,其特征在于,所述文件核验单元包括:
    唯一值计算子单元,所述唯一值计算子单元针对加密文件进行唯一值计算,获得第二唯一值;
    比较子单元,所述比较子单元用于比较第一唯一值与第二唯一值;若第二唯一值与第一唯一值相等,解密加密文件,若第二唯一值与第一唯一值不等,中止文件解密过程。
  11. 一种如权利要求9所述基于二维码的文件获取设备,其特征在于,所述数据解密单元利用数字证书验证签名数据,若验证通过,则执行步骤3,若验证不通过,则中止执行所述的基于二维码的文件获取方法。
  12. 一种如权利要求9所述基于二维码的文件获取设备,其特征在于,所述第n数据段由头部字符x n,及所述加密文件的第n部A n拼接组成,所述x n包括位移T,所述解析第n数据段为映射头部字符x n获得第n-1存储地址S n-1,所述头部字符x n与服务器存储地址 一一对应,或利用预设的服务器存储地址与位移T的函数关系计算得到存储地址。
PCT/CN2020/078469 2019-09-18 2020-03-09 一种基于二维码的文件获取方法及设备、二维码生成方法 WO2021051757A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/422,934 US11979505B2 (en) 2019-09-18 2020-03-09 File acquisition method and device based on two-dimensional code and two-dimensional code generating method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910881097.4A CN110391914B (zh) 2019-09-18 2019-09-18 一种基于二维码的文件获取方法及设备、二维码生成方法
CN201910881097.4 2019-09-18

Publications (1)

Publication Number Publication Date
WO2021051757A1 true WO2021051757A1 (zh) 2021-03-25

Family

ID=68289697

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078469 WO2021051757A1 (zh) 2019-09-18 2020-03-09 一种基于二维码的文件获取方法及设备、二维码生成方法

Country Status (3)

Country Link
US (1) US11979505B2 (zh)
CN (1) CN110391914B (zh)
WO (1) WO2021051757A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124390A (zh) * 2021-11-24 2022-03-01 贵州大学 一种基于物理隔离的发送方法、接收方法及系统

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110391914B (zh) * 2019-09-18 2019-12-31 尤尼泰克(嘉兴)信息技术有限公司 一种基于二维码的文件获取方法及设备、二维码生成方法
CN111209579A (zh) * 2020-01-03 2020-05-29 玉溪市电子政务内网信息技术中心 一种涉密文件利用二维码多重加密的电子解析设备及方法
CN111950005A (zh) * 2020-08-07 2020-11-17 甘肃紫光智能交通与控制技术有限公司 一种公路工程资料上传方法及系统
CN112668031A (zh) * 2021-03-15 2021-04-16 尤尼泰克(嘉兴)信息技术有限公司 一种用于网络文件保护的编解码方法、装置
CN112989434A (zh) * 2021-03-22 2021-06-18 合肥信息工程监理咨询有限公司 一种电子文档加密防篡改、解密验证方法
CN115834809B (zh) * 2022-11-28 2023-09-29 深圳市汇健智慧医疗有限公司 一种复合手术室施工及局部验收数据管理方法
CN116306754B (zh) * 2023-05-18 2023-08-04 浙江美丽健乳业有限公司 一种二维码的生成方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170012781A1 (en) * 2014-02-06 2017-01-12 Rd2Buzz Brasil Consultoria E Internet Ltda. A Solution For Generating And Issuing Security Codes With Guaranteed Issuer Authenticity And Origin
CN106897761A (zh) * 2017-03-06 2017-06-27 山东渔翁信息技术股份有限公司 一种二维码生成方法及装置
CN108632020A (zh) * 2018-05-15 2018-10-09 浙江鲸腾网络科技有限公司 数据发送方法、接收方法及装置
CN110391914A (zh) * 2019-09-18 2019-10-29 尤尼泰克(嘉兴)信息技术有限公司 一种基于二维码的文件获取方法及设备、二维码生成方法

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8825999B2 (en) * 2007-10-20 2014-09-02 Blackout, Inc. Extending encrypting web service
US20150006895A1 (en) * 2009-06-01 2015-01-01 Maidsafe Foundation Distributed network system
CA2868581C (en) * 2010-03-19 2016-03-29 mr.QR10 GMBH & CO. KG Concept for communicating between different entities using different data portions for different channels
US20120259635A1 (en) * 2011-04-05 2012-10-11 Ekchian Gregory J Document Certification and Security System
US20140019755A1 (en) * 2012-07-12 2014-01-16 Unisys Corporation Data storage in cloud computing
CN104615939B (zh) * 2013-12-31 2017-06-13 腾讯科技(深圳)有限公司 单据生成方法、验证方法、装置和系统
US10404462B2 (en) * 2014-06-10 2019-09-03 Unisys Corporation Systems and methods for document authenticity validation by encrypting and decrypting a QR code
CN105809066B (zh) * 2014-12-29 2019-02-01 深圳Tcl数字技术有限公司 加密数据的存储方法及终端
US20170243204A1 (en) * 2016-02-19 2017-08-24 Private Giant Method and system for secure object transfer
CN106452756B (zh) * 2016-11-08 2018-03-30 王栋 可离线验证安全二维码构造验证方法与装置
CN108681760B (zh) * 2018-05-15 2021-09-14 恒生电子股份有限公司 数据发送方法、接收方法及装置
CN110147351B (zh) * 2019-05-20 2021-07-13 中国刑事警察学院 一种Office文件数据分片识别、排序、重组方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170012781A1 (en) * 2014-02-06 2017-01-12 Rd2Buzz Brasil Consultoria E Internet Ltda. A Solution For Generating And Issuing Security Codes With Guaranteed Issuer Authenticity And Origin
CN106897761A (zh) * 2017-03-06 2017-06-27 山东渔翁信息技术股份有限公司 一种二维码生成方法及装置
CN108632020A (zh) * 2018-05-15 2018-10-09 浙江鲸腾网络科技有限公司 数据发送方法、接收方法及装置
CN110391914A (zh) * 2019-09-18 2019-10-29 尤尼泰克(嘉兴)信息技术有限公司 一种基于二维码的文件获取方法及设备、二维码生成方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHAH ALTAF T.; PARIHAR VIKRAMSINGH R.: "Overview and an approach for QR-code based messaging and file sharing on android platform in view of security", 2017 INTERNATIONAL CONFERENCE ON COMPUTING METHODOLOGIES AND COMMUNICATION (ICCMC), IEEE, 18 July 2017 (2017-07-18), pages 371 - 373, XP033315347, DOI: 10.1109/ICCMC.2017.8282711 *
XIAO, BENHAI ET AL.: "QR Code Design of Information Security Based on Rijndael Encryption Algorithm and SHA512 Encryption Algorithm", COMPUTER SYSTEMS & APPLICATIONS, vol. 24, no. 7, 31 July 2015 (2015-07-31), pages 149 - 154, XP055792753, ISSN: 1003-3254 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114124390A (zh) * 2021-11-24 2022-03-01 贵州大学 一种基于物理隔离的发送方法、接收方法及系统

Also Published As

Publication number Publication date
CN110391914B (zh) 2019-12-31
US11979505B2 (en) 2024-05-07
CN110391914A (zh) 2019-10-29
US20220070005A1 (en) 2022-03-03

Similar Documents

Publication Publication Date Title
WO2021051757A1 (zh) 一种基于二维码的文件获取方法及设备、二维码生成方法
US11366878B2 (en) Method and apparatus for delivering encoded content
CN109067524B (zh) 一种公私钥对生成方法及系统
CN110798315B (zh) 基于区块链的数据处理方法、装置及终端
US20110126022A1 (en) Method for generating an advanced electronic signature for an electronic document
US7606768B2 (en) Voice signature with strong binding
JP2001518269A (ja) 電子暗号パッキング
BRPI0821205B1 (pt) Métodos para prover uma autorização de programa digital, para renderizar um conteúdo digital em um dispositivo e para autenticar a validade do dispositivo que renderiza o conteúdo digital, e, dispositivo para renderizar um conteúdo digital.
CN108199827B (zh) 客户端代码完整性校验方法、存储介质、电子设备及系统
WO2022193620A1 (zh) 一种用于网络文件保护的编解码方法、装置
RU2010105036A (ru) Проверка кода мас без его раскрытия
KR102258700B1 (ko) 블록체인 기반의 스마트 전자계약 체결방법 및 시스템
CN114430346A (zh) 登录方法、装置及电子设备
WO2020057389A1 (zh) 一种签名验证方法、装置、电子设备及可读存储介质
CN102222195A (zh) 电子书阅读方法和系统
JP2004234641A (ja) コンテンツファイル制作者の認証方式およびそのプログラム
CN108322311B (zh) 数字证书的生成方法及装置
CN107330340B (zh) 文件加密方法、设备、文件解密方法、设备及存储介质
CN107391970B (zh) Flash应用程序中的函数访问控制方法及装置
CN114637985A (zh) 一种基于多环境参数的Android应用登录伪造识别方法
CN101043334B (zh) 加密和认证数据以及解密和验证数据真实性的方法和装置
CN111385083B (zh) 密钥保护方法及密钥保护系统
CN110457954B (zh) 合同管理装置与方法
CN111859408A (zh) 文件加密、解密方法及装置、电子设备、可读存储介质
CN111200741A (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: 20866332

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

Country of ref document: EP

Kind code of ref document: A1