A contactless signing encryption method for foreign-related documents based on digital signature
Through a contactless signing encryption method based on digital signatures, the time stamp difference and timeliness of foreign-related documents are used to construct an encryption chain, which solves the problem of insufficient time sensitivity in the signing of foreign-related documents in the existing technology and improves the identification sensitivity and security of data. , ensuring the authenticity and security of documents.
Patent Information
- Application Number
- CN202410831551.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-06-26
AI Technical Summary
Existing electronic signature solutions ignore time sensitivity in the signing of foreign-related documents, resulting in insufficient sensitivity to identify malicious data tampering, illegal substitutions and replay attacks, and cannot effectively ensure the true validity and security of cross-border documents.
Using a contactless signing encryption method based on digital signatures, the document matrix is constructed and rearranged by calculating the timestamp difference and timeliness of foreign-related documents. The encryption algorithm uses the time difference to generate a public key for double encryption to form an encryption chain and enhance the security of the signing process. Time sensitivity and security.
It improves the recognition sensitivity and cracking difficulty of foreign-related document data, ensures the chronological consistency of the signing process, enhances the protection against malicious attacks, and ensures the authenticity and security of the documents.
Smart Images

Figure CN118432816B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text data encryption, and in particular to a contactless signing encryption method for foreign-related documents based on digital signatures. Background Art
[0002] In the era of trade digitalization, the volume of foreign-related transactions has increased dramatically. The circulation of traditional paper documents is cumbersome, inefficient, and easy to be lost or tampered with. It can no longer meet the needs of efficient and secure document processing and signing. At present, although the electronic transformation of paper documents has improved efficiency, it faces the challenges of data security and lack of trust. Especially after the rise of contactless transaction models, how to ensure the authenticity and validity of cross-border documents and prevent information leakage and fraud has become a hot issue in trade activities.
[0003] Existing electronic signature solutions mostly focus on single-link encryption or simple digital signature applications, which encrypt all data at one time. However, due to the rapid development of computer technology, this encryption method ignores the time sensitivity of the foreign-related document signing process in the digital signature application, resulting in insufficient sensitivity in the identification of malicious attacks such as malicious tampering, illegal replacement and replay of foreign-related document data. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a contactless signing encryption method for foreign-related documents based on digital signatures to solve the existing problems.
[0005] The present invention discloses a contactless encryption method for signing foreign-related documents based on digital signatures, which adopts the following technical solutions:
[0006] An embodiment of the present application provides a contactless signing encryption method for foreign-related documents based on digital signatures, the method comprising the following steps:
[0007] S1, collect various foreign-related documents with digital signatures, obtain the validity of foreign-related documents and the timestamps of various foreign-related documents; arrange the codes of all data contained in each type of foreign-related documents to form a document matrix for each type of foreign-related documents;
[0008] S2, according to the time stamp differences between different foreign-related documents and the validity of foreign-related documents, calculate the time difference corresponding to each type of foreign-related documents; according to the time difference corresponding to each type of foreign-related documents and the number of columns of the document matrix, rearrange the document matrix of each type of foreign-related documents;
[0009] S3, arranging various foreign-related documents in the order of time stamps to obtain serial numbers of various foreign-related documents; encrypting various foreign-related documents in sequence according to the serial numbers of various foreign-related documents according to the rearranged document matrix to obtain initial encrypted ciphertext;
[0010] S4, obtaining the public key in the encryption algorithm according to the time difference corresponding to each type of foreign-related document, and performing secondary encryption on each type of foreign-related document in sequence according to the serial number of each type of foreign-related document to obtain the final ciphertext of each type of foreign-related document.
[0011] Furthermore, the types of foreign-related documents include: exporter's basic trade documents, inspection and quarantine certificates, transport bills of lading, and bank review and payment documents.
[0012] Furthermore, the codes of all data contained in each type of foreign-related documents are arranged to form a document matrix for each type of foreign-related documents, including:
[0013] The codes of each data contained in each type of foreign-related document are obtained; each row of the document matrix of each type of foreign-related document is the code of each data.
[0014] Furthermore, the method for calculating the time difference corresponding to various foreign-related documents includes:
[0015] The time difference between the inspection and quarantine certificate and the exporter's basic trade document is recorded as the time difference corresponding to the exporter's basic trade document;
[0016] The time stamp difference between the transport bill of lading and the exporter's basic trade document is recorded as the time difference corresponding to the inspection and quarantine certificate;
[0017] The calculation result of subtracting the timestamp of the inspection and quarantine certificate from the timestamp of the bank's review and payment document is recorded as the time difference corresponding to the transport bill of lading document;
[0018] Obtain the standard time of the time zone where the exporter and importer are located respectively; record the absolute value of the difference between the standard time of the time zone where the exporter and importer are located as the time zone difference; record the absolute value of the difference between the validity period of the foreign-related document and the time zone difference as the time difference corresponding to the bank's review and payment of the document.
[0019] Furthermore, the method for rearranging the document matrix of various foreign-related documents includes:
[0020] Each column vector of the document matrix of each type of foreign-related document is circularly shifted to the left in turn to obtain a rearranged document matrix.
[0021] Furthermore, the step length of the left circular shift is the remainder obtained by dividing the time difference corresponding to each type of foreign-related document by the number of columns of the document matrix of each type of foreign-related document.
[0022] Furthermore, according to the rearranged document matrix, the various foreign-related documents are encrypted in sequence according to the serial numbers of the various foreign-related documents to obtain the initial encrypted ciphertext, including:
[0023] The rearranged document matrix of various foreign-related documents is used as plain text, and various foreign-related documents are encrypted in sequence according to the serial numbers of various foreign-related documents to obtain the initial encrypted ciphertext of various foreign-related documents.
[0024] Furthermore, the public key in the encryption algorithm is obtained according to the time difference corresponding to each type of foreign-related document, and each type of foreign-related document is encrypted twice in sequence according to the serial number of each type of foreign-related document to obtain the final ciphertext of each type of foreign-related document, including:
[0025] Select two different prime numbers, and record the smallest and largest number of the two prime numbers as the lower limit and upper limit of the time difference respectively;
[0026] By comparing the lower and upper limits of the time difference with the time differences corresponding to various foreign-related documents, the public keys corresponding to various foreign-related documents are obtained;
[0027] All kinds of foreign-related documents are encrypted twice according to the public keys corresponding to them to obtain the final ciphertext of each kind of foreign-related documents.
[0028] Furthermore, the method for obtaining the public keys corresponding to various foreign-related documents includes:
[0029] For the time difference corresponding to various foreign-related documents, if the time difference is greater than or equal to the upper limit of the time difference, the prime number with the smallest absolute difference with the time difference among all prime numbers is obtained as the public key;
[0030] If the time difference is between the lower limit and the upper limit, the sum of the time difference and the upper limit is calculated, and the prime number with the smallest absolute difference from the sum among all prime numbers is used as the public key;
[0031] If the time difference is less than or equal to the lower limit of the time difference, the cumulative sum of the time difference, the lower limit of the time difference and the upper limit of the time difference is calculated, and the prime number with the smallest absolute value of the difference with the cumulative sum among all prime numbers is used as the public key.
[0032] Furthermore, after obtaining the final ciphertext of various foreign-related documents, the method further includes:
[0033] The final ciphertext of each type of foreign-related document is sent to the importer in turn, and the public key corresponding to the final ciphertext of each type of foreign-related document is sent to the importer; the importer decrypts the final ciphertext of each type of foreign-related document in reverse order of the serial number of each type of foreign-related document to obtain the plaintext data corresponding to each type of foreign-related document.
[0034] This application has at least the following beneficial effects:
[0035] This application encrypts various foreign-related documents layer by layer by analyzing the time connection of the signing order of various documents in the digital signature application during the preparation and signing of foreign-related documents. First, using the signing order of various documents in the preparation and signing of foreign-related documents, according to the timestamps between various documents, the shift coefficients of each document are calculated in turn for rearrangement. The rearranged documents scramble the document matrix of various foreign-related documents according to the timestamps of various foreign-related documents to improve time sensitivity; further, according to the time difference of various foreign-related documents, public keys and private keys are constructed to encrypt various foreign-related documents. By encrypting in this way, an encryption chain is constructed according to the time sequence of the signing process of foreign-related documents, which strengthens the connection of the encryption chains of various foreign-related documents. In the cracking process, it is necessary to decrypt step by step, and each node must be correctly restored to obtain the complete foreign-related document data, which increases the difficulty of cracking and improves the recognition sensitivity of the encrypted foreign-related document data to malicious attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0037] Figure 1 A flowchart of the steps of a method for contactless signing and encryption of foreign-related documents based on digital signature provided in this application;
[0038] Figure 2 A detailed flowchart for rearranging the document matrix. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. In the absence of conflict, the embodiments of the present application and the technical features in the embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0040] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0041] The following is a detailed description of a specific scheme of a contactless signing and encryption method for foreign-related documents based on digital signatures provided by the present application in conjunction with the accompanying drawings.
[0042] An embodiment of the present application provides a method for contactless signing and encryption of foreign-related documents based on digital signatures. Specifically, the following method for contactless signing and encryption of foreign-related documents based on digital signatures is provided. Figure 1 , the method comprises the following steps:
[0043] Step S1, collect various foreign-related documents with digital signatures, obtain the validity of foreign-related documents and the timestamps of various foreign-related documents; arrange the codes of all data contained in each type of foreign-related documents to form a document matrix for each type of foreign-related documents.
[0044] Collect all kinds of foreign-related documents with digital signatures; the types of foreign-related documents include: exporter basic trade documents, inspection and quarantine certificates, transport bills of lading documents, and bank review and payment documents. The Unicode code values of all data contained in each type of foreign-related document form a document matrix, where each row of the document matrix is the Unicode code value of each data; since the dimension of each row of the matrix should be the same, the row with the largest dimension is used as the basis, and the insufficient dimension is filled with 0 in front.
[0045] Get the timestamp of each type of foreign-related document. The timestamp of the exporter's basic trade document is the timestamp when the exporter and importer reach a deal and sign the contract. The timestamp of other types of documents is the timestamp when the digital signature is confirmed by the relevant agency.
[0046] Step S2, calculate the time difference corresponding to each type of foreign-related documents according to the time stamp difference between different foreign-related documents and the validity of the foreign-related documents; rearrange the document matrix of each type of foreign-related documents according to the time difference corresponding to each type of foreign-related documents and the number of columns of the document matrix.
[0047] According to the order of preparation and signing of foreign-related documents, the general process is that the exporter first prepares the basic trade documents required by the contract, such as commercial invoices, packing lists, weight lists, etc. These data reflect the commercial terms of the transaction and the details of the goods; afterwards, according to the nature of the goods and the requirements of the importer, the exporter needs to apply to the inspection and quarantine agency for necessary inspections and obtain the corresponding certificates, such as inspection and quarantine certificates, health certificates, etc.; after the goods are ready, the exporter arranges transportation, at which time the shipping company or airline will issue a bill of lading or airway bill as proof of the transportation of the goods, but the date of the bill of lading cannot be earlier than the date of the inspection and quarantine certificate; finally, the exporter needs to prepare a full set of documents according to the terms of the letter of credit and submit them to the issuing bank or designated bank for review. The bank will check whether the documents comply with the provisions of the letter of credit and decide whether to make a payment commitment or actual payment. These processes are carried out in sequence, and each process will be digitally signed by the corresponding agency and given an unchangeable timestamp at the same time.
[0048] According to the time stamp differences between different foreign-related documents and the validity of foreign-related documents, the time difference corresponding to various foreign-related documents is calculated, including:
[0049] The time difference between the inspection and quarantine certificate and the exporter's basic trade document is recorded as the time difference corresponding to the exporter's basic trade document;
[0050] The time stamp difference between the transport bill of lading and the exporter's basic trade document is recorded as the time difference corresponding to the inspection and quarantine certificate;
[0051] The time difference between the bank's review and payment documents and the inspection and quarantine certificate is recorded as the time difference corresponding to the transport bill of lading document;
[0052] Foreign-related documents are related to import and export trade, so exporters and importers may be in different time zones, and foreign-related documents are often subject to time limits, which are the transaction time limits agreed in advance by exporters and importers. Bank review and payment documents are the last type of documents in the preparation and signing sequence of foreign-related documents, and cannot be rearranged and encrypted using timestamps. Therefore, information known to both importers and exporters is used for processing: the standard time of the time zones where the exporter and importer are located is obtained respectively; the absolute value of the difference between the standard time of the time zones where the exporter and importer are located is recorded as the time zone difference; the absolute value of the difference between the time limit of the foreign-related document and the time zone difference is recorded as the time difference corresponding to the bank review and payment documents.
[0053] Furthermore, the displacement step lengths corresponding to various foreign-related documents are calculated according to the time differences corresponding to various foreign-related documents and the number of columns of the document matrix, including:
[0054] The remainder obtained by dividing the time difference corresponding to each type of foreign-related document by the number of columns of the document matrix of each type of foreign-related document is recorded as the displacement step length corresponding to each type of foreign-related document;
[0055] Furthermore, each column of the document matrix of each type of foreign-related document is moved according to the corresponding displacement step length to obtain a rearranged document matrix, including:
[0056] Each column vector of the document matrix of each type of foreign-related document is sequentially shifted to the left by a fixed step length to obtain a rearranged document matrix; the step length is the displacement step length corresponding to each type of foreign-related document. By left cyclic shift, the document matrix of each type of foreign-related document can be shuffled and rearranged.
[0057] The specific process flow chart of rearranging the document matrix is as follows: Figure 2 shown.
[0058] Step S3, arrange various foreign-related documents in the order of timestamps to obtain serial numbers of various foreign-related documents; according to the rearranged document matrix, encrypt various foreign-related documents in sequence according to their serial numbers to obtain initial encrypted ciphertext.
[0059] The rearranged document matrix of various foreign-related documents is used as plain text, and various foreign-related documents are encrypted in sequence according to their serial numbers to obtain the initial encrypted ciphertext of various foreign-related documents. RSA encryption is a well-known technology, and the specific process is not repeated here.
[0060] S4, obtaining the public key in the encryption algorithm according to the time difference corresponding to each type of foreign-related document, and performing secondary encryption on each type of foreign-related document in sequence according to the serial number of each type of foreign-related document to obtain the final ciphertext of each type of foreign-related document.
[0061] Furthermore, the public key is constructed according to the time difference corresponding to various foreign-related documents to perform secondary encryption on the initial encrypted ciphertext. According to the steps of the RSA encryption algorithm, firstly, two different prime numbers are randomly selected, and the smallest and largest numbers of the two prime numbers are recorded as the lower limit and upper limit of the time difference respectively;
[0062] Then the public key is obtained according to the time difference corresponding to various foreign-related documents: for the time difference corresponding to various foreign-related documents, if the time difference is greater than or equal to the upper limit of the time difference, then the prime number with the smallest absolute value of difference with the time difference among all prime numbers is obtained as the public key; if the time difference is between the lower limit and the upper limit of the time difference, then the sum of the time difference and the upper limit of the time difference is calculated, and the prime number with the smallest absolute value of difference with the sum among all prime numbers is used as the public key; if the time difference is less than or equal to the lower limit of the time difference, then the cumulative sum of the time difference, the lower limit of the time difference and the upper limit of the time difference is calculated, and the prime number with the smallest absolute value of difference with the cumulative sum among all prime numbers is used as the public key.
[0063] According to the construction principle of the public key in the RSA encryption algorithm, all prime numbers greater than the lower limit and upper limit of the time difference can be used as public keys. When the timestamp of the document is used to construct the public key in the above method, the timestamp is dynamically generated based on the current time and is not fixed, thereby increasing the dynamics and flexibility of the key system, making the key change over time and more effective in combating static key analysis attacks.
[0064] After obtaining the public key, the private key is calculated according to the RSA encryption algorithm, and then the calculated private key is used to perform secondary encryption on various foreign-related documents to obtain the final ciphertext of various foreign-related documents.
[0065] The final ciphertexts of various foreign-related documents are sent to the importer in turn, and the public keys corresponding to the final ciphertexts of various foreign-related documents are sent to the importer; the importer decrypts the final ciphertexts of various foreign-related documents in reverse order of the serial numbers of various foreign-related documents, and obtains the plaintext data corresponding to various foreign-related documents. Specifically, the importer first needs to use the corresponding public key to decrypt the bank review and payment documents, and calculate the corresponding shift coefficient according to the time zone of the two parties to the transaction and the agreed foreign-related document validity period, and then restore the rearranged bank review and payment document matrix; then use the corresponding public key to decrypt the transport bill of lading, and so on, to restore each document matrix. Before the first document matrix is rearranged and restored, it is necessary to use the exporter's public key to perform decryption verification before executing the rearrangement and restoration operation of the first document matrix.
[0066] In this encryption scheme, an encryption chain is constructed using the timestamp of each step according to the order of preparation and signing of foreign-related documents. Only by strictly following the order can each type of document be decrypted and restored in sequence. In this process, if a ciphertext is illegally replaced or replayed, the timestamp of the replaced or replayed ciphertext will be wrong. When it is subsequently rearranged and restored, the correct plaintext cannot be restored, and the subsequent decryption and rearrangement and restoration operations cannot be performed. This encryption method increases the difficulty of cracking complete foreign-related documents to a certain extent, and improves the security of the scheme.
[0067] Through the above description of the implementation method in combination with the accompanying drawings, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0068] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A contactless signing encryption method for foreign-related documents based on digital signature, characterized in that: The method comprises the following steps: S1, collect various foreign-related documents with digital signatures, obtain the validity of foreign-related documents and the timestamps of various foreign-related documents; arrange the codes of all data contained in each type of foreign-related documents to form a document matrix for each type of foreign-related documents; S2, according to the time stamp difference between different foreign-related documents and the validity of foreign-related documents, calculate the time difference corresponding to each type of foreign-related documents; according to the time difference corresponding to each type of foreign-related documents and the number of columns of the document matrix, rearrange the document matrix of each type of foreign-related documents; the method for rearranging the document matrix of each type of foreign-related documents includes: cyclically shifting each column vector of the document matrix of each type of foreign-related documents to the left in turn to obtain a rearranged document matrix; the step length of the left cyclic shift is the remainder obtained by dividing the time difference corresponding to each type of foreign-related documents by the number of columns of the document matrix of each type of foreign-related documents; S3, arranging various foreign-related documents in the order of time stamps to obtain serial numbers of various foreign-related documents; encrypting various foreign-related documents in sequence according to the serial numbers of various foreign-related documents according to the rearranged document matrix to obtain initial encrypted ciphertext; S4, obtaining the public key in the encryption algorithm according to the time difference corresponding to each type of foreign-related document, and performing secondary encryption on each type of foreign-related document in sequence according to the serial number of each type of foreign-related document to obtain the final ciphertext of each type of foreign-related document; The method for obtaining the final ciphertext of various foreign-related documents includes: Select two different prime numbers, and record the smallest and largest number of the two prime numbers as the lower limit and upper limit of the time difference respectively; By comparing the lower and upper limits of the time difference with the time differences corresponding to various foreign-related documents, the public keys corresponding to various foreign-related documents are obtained; Perform secondary encryption on various foreign-related documents according to the public keys corresponding to them to obtain the final ciphertext of various foreign-related documents; The method for obtaining the public keys corresponding to various foreign-related documents includes: For the time difference corresponding to various foreign-related documents, if the time difference is greater than or equal to the upper limit of the time difference, the prime number with the smallest absolute difference with the time difference among all prime numbers is obtained as the public key; If the time difference is between the lower limit and the upper limit, the sum of the time difference and the upper limit is calculated, and the prime number with the smallest absolute difference from the sum among all prime numbers is used as the public key; If the time difference is less than or equal to the lower limit of the time difference, the cumulative sum of the time difference, the lower limit of the time difference and the upper limit of the time difference is calculated, and the prime number with the smallest absolute value of the difference with the cumulative sum among all prime numbers is used as the public key.
2. A contactless signing encryption method for foreign-related documents based on digital signature as claimed in claim 1, characterized in that: The types of foreign-related documents include: exporter's basic trade documents, inspection and quarantine certificates, transport bills of lading, and bank review and payment documents.
3. A contactless signing and encryption method for foreign-related documents based on digital signature as claimed in claim 1, characterized in that: The coding of all data contained in each type of foreign-related documents is arranged to form a document matrix of each type of foreign-related documents, including: The codes of each data contained in each type of foreign-related document are obtained; each row of the document matrix of each type of foreign-related document is the code of each data.
4. A contactless signing and encryption method for foreign-related documents based on digital signature as claimed in claim 2, characterized in that: The method for calculating the time difference corresponding to various foreign-related documents includes: The time difference between the inspection and quarantine certificate and the exporter's basic trade document is recorded as the time difference corresponding to the exporter's basic trade document; The time stamp difference between the transport bill of lading and the exporter's basic trade document is recorded as the time difference corresponding to the inspection and quarantine certificate; The calculation result of subtracting the timestamp of the inspection and quarantine certificate from the timestamp of the bank's review and payment document is recorded as the time difference corresponding to the transport bill of lading document; Obtain the standard time of the time zone where the exporter and importer are located respectively; record the absolute value of the difference between the standard time of the time zone where the exporter and importer are located as the time zone difference; record the absolute value of the difference between the validity period of the foreign-related document and the time zone difference as the time difference corresponding to the bank's review and payment of the document.
5. A contactless signing and encryption method for foreign-related documents based on digital signature as claimed in claim 1, characterized in that: According to the rearranged document matrix, various foreign-related documents are encrypted in sequence according to their serial numbers to obtain initial encrypted ciphertext, including: The rearranged document matrix of various foreign-related documents is used as plain text, and various foreign-related documents are encrypted in sequence according to the serial numbers of various foreign-related documents to obtain the initial encrypted ciphertext of various foreign-related documents.
6. A contactless signing and encryption method for foreign-related documents based on digital signature as claimed in claim 1, characterized in that: After obtaining the final ciphertext of various foreign-related documents, the method further includes: The final ciphertext of each type of foreign-related document is sent to the importer in turn, and the public key corresponding to the final ciphertext of each type of foreign-related document is sent to the importer; the importer decrypts the final ciphertext of each type of foreign-related document in reverse order of the serial number of each type of foreign-related document to obtain the plaintext data corresponding to each type of foreign-related document.
Citation Information
Patent Citations
Dynamic RSA encryption method for Ultralight radio frequency (RF) card through time stamp, and dynamic RSA identification method for Ultralight RF card through time stamp
CN108540288A
Inter-station zero calibration method of multi-station time difference positioning system
CN116990839A
Asset type consistency evidence generation method and system, transaction method and system, and transaction verification method and system
WO2021228239A1
