Data encryption transmission method and device, electronic equipment and storage medium
By using time lock encryption and multiple encryption technologies in the data encryption method, the problem that the prior art cannot ensure data security in delayed disclosure scenarios is solved, and the delayed disclosure of data and high security in the transmission process are achieved.
Patent Information
- Application Number
- CN202411688132.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-21
AI Technical Summary
Existing data encryption methods cannot ensure data security and delayed disclosure in delayed disclosure scenarios.
By using the first and second encrypted prime numbers to perform modulus operations and Euler operations, the encrypted modulus and Euler modulus are obtained, and the original data is time-locked to encrypt it based on these parameters to ensure that the data cannot be decoupled immediately when leaked. Then, the time lock encrypted data is further encrypted using symmetric encryption random numbers, asymmetric encryption public keys, encrypted modulo numbers, encrypted cardinality and iterative parameters to generate target transmission data.
The delayed disclosure of data and security during transmission are achieved, ensuring that even in the event of data breach, the target time lock encrypted data cannot be immediately unwrapped.
Smart Images

Figure CN119520115A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data encryption technology, applicable to the field of financial technology, and in particular to a data encryption transmission method and device, electronic equipment and storage medium. Background Art
[0002] Data transmission refers to the transmission of data from one data node to another. In order to ensure the security of data during transmission, data is usually encrypted. Current data encryption methods include symmetric encryption algorithms or asymmetric encryption algorithms. In the actual application scenarios of data transmission, these data encryption algorithms can be decrypted based on secret keys to obtain relevant transmission data. However, in some scenarios where delayed disclosure of transmission data is required, current data transmission methods cannot be implemented. Therefore, how to ensure delayed disclosure of data and the security of data transmission has become an urgent problem to be solved. Summary of the invention
[0003] The main purpose of the embodiments of the present application is to propose a data encryption transmission method and device, an electronic device and a storage medium, aiming to ensure delayed disclosure of data and the security of data transmission.
[0004] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes a data encryption transmission method, the method comprising:
[0005] Obtaining original data, a first encrypted prime number, a second encrypted prime number, and an iteration parameter;
[0006] Performing a modulus operation on the first encryption prime number and the second encryption prime number to obtain an encryption modulus;
[0007] Performing an Euler operation according to the first encrypted prime number and the second encrypted prime number to obtain an Euler modulus;
[0008] Performing time-lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and a preset encryption base to obtain target time-lock encrypted data;
[0009] Encrypting the target time lock encrypted data according to a preset symmetric encryption random number, a preset asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain target transmission data;
[0010] The target transmission data is transmitted to a data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data.
[0011] In some embodiments, the performing time-lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter, and a preset encryption base to obtain target time-lock encrypted data includes:
[0012] Perform iterative aggregation calculation based on the iteration parameter, the Euler modulus, the encryption modulus and the encryption base to obtain an encrypted ciphertext;
[0013] Performing format conversion based on the original data to obtain original transmission digital data;
[0014] The encrypted ciphertext and the original transmission number are summed to obtain the target time lock encrypted data.
[0015] In some embodiments, encrypting the target time lock encrypted data according to a preset symmetric encryption random number, a preset asymmetric encryption public key, the encryption modulus, the encryption base, and the iteration parameter to obtain the target transmission data includes:
[0016] Perform data encapsulation based on the encryption modulus, the encryption base, the target time lock encrypted data and the iteration parameter to obtain target encapsulated data;
[0017] The target encapsulated data and the symmetric encrypted random number are digitally signed based on the asymmetric encryption public key to obtain the target transmission data.
[0018] In some embodiments, the step of performing digital signature processing on the target encapsulated data and the symmetric encryption random number based on the asymmetric encryption public key to obtain the target transmission data includes:
[0019] Generate a key based on the symmetric encryption random number to obtain a symmetric encryption key;
[0020] Symmetrically encrypt the target encapsulated data based on the symmetric encryption key to obtain target symmetric encrypted data;
[0021] The symmetric encryption random number and the target symmetric encryption data are digitally signed based on the asymmetric encryption public key to obtain the target transmission data.
[0022] In some embodiments, the step of performing digital signature processing on the symmetric encryption random number and the target symmetric encryption data based on the asymmetric encryption public key to obtain the target transmission data includes:
[0023] Performing hash processing on the symmetric encryption random number to obtain a symmetric random number hash value;
[0024] Asymmetrically encrypt the symmetric encryption random number according to the asymmetric encryption public key to obtain a symmetric random number ciphertext;
[0025] Data encapsulation is performed based on the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data to obtain the target transmission data.
[0026] In some embodiments, the target transmission data includes the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data, and transmitting the target transmission data to a data receiving end so that the data receiving end decrypts the target transmission data to obtain the original data includes:
[0027] Transmitting the target transmission data to the data receiving end;
[0028] At the data receiving end, asymmetrically decrypting the symmetric random number ciphertext based on a preset asymmetric encryption private key to obtain the symmetric encrypted random number;
[0029] At the data receiving end, performing hash processing on the symmetrically encrypted random number to obtain a hash verification value;
[0030] At the data receiving end, if the hash verification value is the same as the symmetric random number hash value, a key is generated based on the symmetric encryption random number to obtain the symmetric encryption key;
[0031] At the data receiving end, symmetrically decrypting the target symmetrically encrypted data based on the symmetrical encryption key to obtain the target encapsulated data;
[0032] At the data receiving end, content decryption is performed based on the target encapsulated data to obtain the original data.
[0033] In some embodiments, the target encapsulated data includes the encryption modulus, the encryption base, the iteration parameter, and the target time lock encryption data; and at the data receiving end, performing content decryption based on the target encapsulated data to obtain the original data includes:
[0034] At the data receiving end, performing aggregate calculation based on the encryption modulus, the encryption base and the iteration parameter to obtain the encrypted ciphertext;
[0035] At the data receiving end, calculating the difference between the target time lock encrypted data and the encrypted ciphertext to obtain the original transmission number;
[0036] At the data receiving end, format conversion is performed based on the original transmission digital data to obtain the original data.
[0037] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a data encryption transmission device, the device comprising:
[0038] A data acquisition module, used to acquire original data, a first encrypted prime number, a second encrypted prime number and an iteration parameter;
[0039] A modulus operation module, configured to perform a modulus operation according to the first encryption prime number and the second encryption prime number to obtain an encryption modulus;
[0040] An Euler operation module, used for performing an Euler operation according to the first encrypted prime number and the second encrypted prime number to obtain an Euler modulus;
[0041] A time lock encryption module, used to perform time lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and a preset encryption base to obtain target time lock encrypted data;
[0042] A data encryption module, used to encrypt the target time lock encrypted data according to a preset symmetric encryption random number, a preset asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain target transmission data;
[0043] The data transmission module is used to transmit the target transmission data to a data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data.
[0044] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0045] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0046] The present application proposes a data encryption transmission method and device, an electronic device and a storage medium, which respectively perform modulus operations and Euler operations on a first encryption prime number and a second encryption prime number to obtain an encryption modulus and an Euler modulus, and perform time-lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and the preset encryption technology, so that the target time-lock encrypted data cannot be immediately decrypted in the event of data leakage, thereby ensuring the delayed disclosure of the data; further, the target time-lock encrypted data is encrypted according to the symmetric encryption random number, the asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain the target transmission data, further ensuring the security of the data, and finally transmitting the target transmission data to a data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data, thereby ensuring the delayed disclosure of the data and ensuring the security of the data during transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 is a flow chart of a data encryption transmission method provided in an embodiment of the present application;
[0048] Figure 2 yes Figure 1 Flow chart of step S104 in FIG.
[0049] Figure 3 yes Figure 1 Flow chart of step S105 in FIG.
[0050] Figure 4 yes Figure 3 Flow chart of step S302 in FIG.
[0051] Figure 5 yes Figure 4 Flow chart of step S403 in FIG.
[0052] Figure 6 yes Figure 1 Flow chart of step S106 in FIG.
[0053] Figure 7 yes Figure 6 Flow chart of step S605 in FIG.
[0054] Figure 8 It is a structural diagram of a data encryption transmission device provided in an embodiment of the present application;
[0055] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0057] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0059] First, some nouns involved in this application are analyzed:
[0060] Symmetric encryption: Symmetric encryption is an encryption method in the field of information security that uses the same key for data encryption and decryption operations. Symmetric encryption is a branch of cryptography and belongs to the category of computer security and information security. Symmetric encryption algorithms are usually fast and suitable for encrypting large amounts of data. The key to this technology is that the same key is used for encryption and decryption, so key protection and transmission security are particularly important. The applications of symmetric encryption technology include data transmission encryption, file storage encryption, identity authentication, etc. Common symmetric encryption algorithms include DES, AES, and Blowfish. By using symmetric encryption, the security of information during storage and transmission can be effectively protected to prevent unauthorized access and data leakage.
[0061] Asymmetric encryption: Asymmetric encryption is a method of encrypting and decrypting data using a pair of keys, one for encryption and the other for decryption. This encryption technology is a branch of cryptography and an important part of information security technology. The main feature of asymmetric encryption is that different keys are used for encryption and decryption, usually referred to as public keys and private keys. The public key is public and can be safely distributed to any requester, while the private key is kept secret and only known to the key holder. Asymmetric encryption technology is widely used in digital signatures, data encryption, secure communications and other fields. It can ensure the confidentiality and integrity of transmitted data and prevent data from being intercepted and tampered with during transmission. In addition, asymmetric encryption is also the basic technology for identity authentication and data integrity verification. Common implementation algorithms include RSA, ECC (elliptic curve cryptography), etc.
[0062] Time-lock puzzle: A time-lock puzzle is a cryptographic mechanism designed to ensure that information cannot be decrypted before a certain time. This technique delays the disclosure of information by making data decryption dependent on solving a computational puzzle that requires a predetermined amount of time to solve. Time-lock puzzles belong to the field of cryptography and information security, and are an effective means of protecting data privacy and controlling the timing of information access. Time-lock puzzles are often used in various security applications that require time control, such as ballot confidentiality in electronic voting systems and conditional locking of cryptocurrency transactions. The key to this technique is to design computational tasks that can neither be completed in advance nor significantly accelerated by additional resources. In addition, time-lock puzzles also involve the choice of specific implementation algorithms, such as the puzzle-solving process based on iterative hash functions, and how to ensure that information is absolutely secure before a set time without the decryption key.
[0063] Data transmission refers to the transmission of data from one data node to another. In order to ensure the security of data during transmission, data is usually encrypted. Current data encryption methods include symmetric encryption algorithms or asymmetric encryption algorithms. In the actual application scenarios of data transmission, these data encryption algorithms can be decrypted based on secret keys to obtain relevant transmission data. However, in some scenarios where delayed disclosure of transmission data is required, current data transmission methods cannot be implemented. Therefore, how to ensure delayed disclosure of data and the security of data transmission has become an urgent problem to be solved.
[0064] Based on this, the embodiments of the present application provide a data encryption transmission method and device, an electronic device and a storage medium, aiming to ensure delayed disclosure of data and the security of data transmission.
[0065] The embodiments of the present application provide a data encryption transmission method and device, an electronic device, and a storage medium, which are specifically described through the following embodiments. First, the data encryption transmission method in the embodiments of the present application is described.
[0066] The data encryption transmission method provided in the embodiment of the present application relates to the field of data encryption technology and is applicable to the field of financial technology. The data encryption transmission method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the data encryption transmission method, etc., but is not limited to the above forms.
[0067] The present application can be used in numerous general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or realize specific abstract data types. The present application can also be put into practice in distributed computing environments, in which remote processing devices connected through a communication network perform tasks. In distributed computing environments, program modules can be located in local and remote computer storage media including storage devices.
[0068] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0069] Figure 1 is an optional flow chart of the data encryption transmission method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.
[0070] Step S101, obtaining original data, a first encrypted prime number, a second encrypted prime number and an iteration parameter;
[0071] Step S102, performing a modulus operation according to the first encryption prime number and the second encryption prime number to obtain an encryption modulus;
[0072] Step S103, performing an Euler operation according to the first encrypted prime number and the second encrypted prime number to obtain an Euler modulus;
[0073] Step S104, performing time-lock encryption on the original data based on the encryption modulus, Euler modulus, iteration parameter and preset encryption base to obtain target time-lock encrypted data;
[0074] Step S105, encrypting the target time lock encryption data according to the preset symmetric encryption random number, the preset asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain the target transmission data;
[0075] Step S106, transmitting the target transmission data to the data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original transmission data.
[0076] In steps S101 to S106 shown in the embodiment of the present application, modulus operations and Euler operations are performed on the first encryption prime number and the second encryption prime number respectively to obtain an encryption modulus and an Euler modulus, and the original data is time-locked and encrypted based on the encryption modulus, the Euler modulus, the iteration parameters and the preset encryption technology, so that the target time-locked encrypted data cannot be immediately decrypted in the event of data leakage, thereby ensuring the delayed disclosure of the data; further, the target time-locked encrypted data is encrypted according to the symmetric encryption random number, the asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameters to obtain the target transmission data, thereby further ensuring the security of the data, and finally the target transmission data is transmitted to the data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data, thereby ensuring the delayed disclosure of the data and ensuring the security of the data during transmission.
[0077] In step S101 of some embodiments, the original data is data that needs to be transmitted, for example, it can be json data in an http request and a data packet in an rpc request, and this application does not make specific restrictions. The first encryption prime number and the second encryption prime number refer to numbers that are greater than 1 and cannot be divided by any other natural number except 1 and itself. The first encryption prime number is composed of the first sub-encryption prime number, and the specific composition relationship is as shown in formula (1):
[0078] p=p′+1 (1),
[0079] Wherein, p is the first encrypted prime number, and p′ is the first sub-encrypted prime number.
[0080] The second encryption prime number is composed of the second encryption sub-prime number, and the specific composition relationship is shown in formula (2):
[0081] q=q′+1 (2),
[0082] Wherein, q is the second encrypted prime number, and q′ is the second encrypted subprime number.
[0083] The iteration parameter is a natural number that is used to form a time-lock puzzle. The time-lock puzzle is a cryptographic technique that aims to ensure that specific information can only be decrypted and accessed after a predetermined time. The core idea of the time-lock puzzle is to use computational difficulties and non-parallelizable operations to make the decryption process take a predetermined time, and the number of iterations determines the time required for the decryption process. For example, for the calculation formula For example, since this calculation requires T square operations, each step depends on the result of the previous step and cannot be parallelized, T is the iteration parameter.
[0084] In step S102 of some embodiments, a modulus operation is performed according to the first encryption prime number and the second encryption prime number to obtain an encryption modulus, and the modulus operation is shown in formula (3):
[0085] N=p·q (3),
[0086] Where N is the encryption modulus.
[0087] In step S103 of some embodiments, an Euler operation is performed according to the first encrypted prime number and the second encrypted prime number to obtain an Euler modulus, and the Euler modulus is shown in formula (4);
[0088] φ(N)=(p-1)(q-1) (4),
[0089] Where φ(N) is the Euler modulus.
[0090] See also Figure 2In some embodiments, step S104 may include but is not limited to steps S201 to S203:
[0091] Step S201, performing iterative aggregation calculation based on the iteration parameter, Euler modulus, encryption modulus and encryption cardinality to obtain encrypted ciphertext;
[0092] Step S202, performing format conversion based on the original data to obtain original transmission digital data;
[0093] Step S203, performing a sum calculation on the encrypted ciphertext and the original transmission number to obtain the target time lock encrypted data.
[0094] Steps S201 to S203 shown in the embodiment of the present application perform iterative aggregation calculations through iterative parameters, Euler modulus, encryption modulus and encryption cardinality to obtain encrypted ciphertext, and then add the encrypted ciphertext and the original data after format conversion to obtain target time-locked encrypted data, so that the target time-locked encrypted data has the property of delayed disclosure, thereby improving data security.
[0095] In step S201 of some embodiments, an iterative aggregation calculation is performed based on the iteration parameter, the Euler modulus, the encryption modulus and the encryption base to obtain the encrypted ciphertext. The iterative aggregation operation is shown in formula (5):
[0096]
[0097] Where c1 is the encrypted ciphertext, a is the encryption base, and T is the iteration parameter. It should be noted that the encryption base and the Euler modulus are coprime. According to Euler's theorem, we can get formula (6):
[0098]
[0099] Among them, due to The number of iterations is large, according to Euler's theorem Simplified to This allows a time lock puzzle to be quickly constructed on the sending end.
[0100] In step S202 of some embodiments, format conversion is performed based on the original data to obtain original transmission numbers. For example, Chinese characters are converted into UTF-8 encoding, thereby converting the original data into original transmission numbers. For example, the original data is converted into Unicode encoding, thereby converting the original data into original transmission numbers.
[0101] In step S203 of some embodiments, the encrypted ciphertext and the original transmission number are summed to obtain the target time lock encrypted data, and the summation is shown in formula (7):
[0102] c=c1+m (7),
[0103] Among them, c is the target time lock encrypted data, and m is the original transmission number.
[0104] See also Figure 3 In some embodiments, step S105 may include but is not limited to steps S301 to S302:
[0105] Step S301, encapsulating data based on the encryption modulus, encryption base, target time lock encryption data and iteration parameters to obtain target encapsulated data;
[0106] Step S302: digitally sign the target encapsulated data and the symmetric encryption random number based on the asymmetric encryption public key to obtain the target transmission data.
[0107] In steps S301 to S302 shown in the embodiment of the present application, data is encapsulated based on the encryption modulus, encryption base, target time lock encryption data and iteration parameters to obtain target encapsulated data, and then the target encapsulated data and the symmetric encryption random number are digitally signed based on the asymmetric encryption public key to obtain target transmission data, thereby encrypting data from the perspective of symmetric encryption and the perspective of asymmetric encryption, thereby achieving further data security protection.
[0108] In step S301 of some embodiments, data encapsulation is performed based on the encryption modulus, encryption base, target time lock encryption data and iteration parameters to obtain target encapsulated data, and the data encapsulation method is json string encapsulation, for example {"encryption modulus":"21","encryption base":"11","target time lock data";"[23,21,5,2,3]","iteration parameter":"2"}.
[0109] See also Figure 4 In some embodiments, step S302 may include but is not limited to steps S401 to S403:
[0110] Step S401, generating a key based on a symmetric encryption random number to obtain a symmetric encryption key;
[0111] Step S402, symmetrically encrypting the target encapsulated data based on the symmetric encryption key to obtain target symmetrically encrypted data;
[0112] Step S403, performing digital signature processing on the symmetric encryption random number and the target symmetric encryption data based on the asymmetric encryption public key to obtain the target transmission data.
[0113] In steps S401 to S403 shown in the embodiment of the present application, key generation is performed based on the symmetric encryption random number to obtain the symmetric encryption key, and then the target encapsulated data is symmetrically encrypted based on the symmetric encryption key to obtain the target symmetric encrypted data. Finally, the symmetric encryption random number and the target symmetric encrypted data are digitally signed based on the asymmetric encryption public key to obtain the target transmission data, thereby encrypting the data from the perspective of symmetric encryption and improving the security of the data.
[0114] In step S401 of some embodiments, the symmetric encryption key is the same secret key used to encrypt and decrypt information. In the symmetric encryption algorithm, both the encryption and decryption processes rely on the same key. In one embodiment, the symmetric encryption key is generated based on PBKDF2 (Password-Based Key Derivation Function 2). It should be noted that the symmetric encryption key generated each time based on the symmetric encryption random number, that is, a symmetric encryption random number corresponds to a specific symmetric encryption key, will not change.
[0115] In step S402 of some embodiments, the target encapsulated data is symmetrically encrypted based on a symmetric encryption key to obtain target symmetric encrypted data. In one embodiment, the target encapsulated data is symmetrically encrypted with a symmetric encryption key based on an AES algorithm to obtain target symmetric encrypted data.
[0116] See also Figure 5 In some embodiments, step S403 includes but is not limited to steps S501 to S503:
[0117] Step S501, performing hash processing on the symmetric encryption random number to obtain a symmetric random number hash value;
[0118] Step S502, asymmetrically encrypting the symmetric encryption random number according to the asymmetric encryption public key to obtain a symmetric random number ciphertext;
[0119] Step S503, encapsulating data based on the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data to obtain the target transmission data.
[0120] In steps S501 to S503 shown in the embodiment of the present application, the symmetric encryption random number is hashed to obtain a symmetric random number hash value, forming a digital signature, thereby ensuring that the data is not tampered with during the transmission process, and then the symmetric encryption random number is asymmetrically encrypted according to the asymmetric encryption public key to obtain a symmetric random number ciphertext, and finally data encapsulation is performed based on the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data to obtain the target transmission data, thereby further encrypting the data from the perspective of asymmetric encryption and further improving the security of the data.
[0121] In step S501 of some embodiments, the symmetric random number hash value refers to a fixed-length hash value obtained by processing the random number used for symmetric encryption through a hash function. The hash processing method can be SHA-256 (Secure Hash Algorithm 256-bit) or SHA-3, and this application does not make specific restrictions.
[0122] In step S502 of some embodiments, the symmetric random number ciphertext refers to the ciphertext generated by asymmetric encryption of the symmetric encryption random number using an asymmetric encryption public key through an asymmetric encryption algorithm. The symmetric random number ciphertext ensures that only the private key corresponding to the asymmetric encryption public key can decrypt and obtain the symmetric encryption random number. The asymmetric encryption method can be RSA (Rivest–Shamir–Adleman) or ECC or other asymmetric encryption algorithms, and this application does not make specific restrictions.
[0123] It should be noted that the time complexity of symmetric encryption algorithms is generally smaller than that of asymmetric encryption algorithms. Therefore, a symmetric encryption algorithm is used to encrypt the target encapsulated data, and then the symmetric encryption random number is encrypted based on the asymmetric encryption algorithm, thereby improving the speed of encryption and decryption while ensuring data security.
[0124] In step S503 of some embodiments, data encapsulation is performed based on the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data to obtain the target transmission data. The encapsulation format is not specifically limited in this application and can be json encapsulation or data packet encapsulation.
[0125] See also Figure 6 In some embodiments, the target transmission data includes a symmetric random number ciphertext, a symmetric random number hash value, and target symmetric encrypted data. Step S106 may include, but is not limited to, steps S601 to S606:
[0126] Step S601, transmitting target transmission data to a data receiving end;
[0127] Step S602: At the data receiving end, the symmetric random number ciphertext is asymmetrically decrypted based on a preset asymmetric encryption private key to obtain a symmetric encrypted random number;
[0128] Step S603, at the data receiving end, hashing the symmetrically encrypted random number to obtain a hash verification value;
[0129] Step S604, at the data receiving end, if the hash verification value is the same as the symmetric random number hash value, a key is generated based on the symmetric encryption random number to obtain a symmetric encryption key;
[0130] Step S605, at the data receiving end, symmetrically decrypting the target symmetrically encrypted data based on the symmetrical encryption key to obtain target encapsulated data;
[0131] Step S606: at the data receiving end, content decryption is performed based on the target encapsulated data to obtain the original data.
[0132] Steps S601 to S606 shown in the embodiment of the present application are performed by transmitting the target transmission data to the data receiving end. The data receiving end parses the target transmission data to obtain a symmetric random number ciphertext, a symmetric random number hash value and a target symmetric encrypted data, and then asymmetrically decrypts the symmetric random number ciphertext based on a preset asymmetric encryption private key to obtain a symmetric encrypted random number, and then hashes the symmetric encrypted random number to obtain a hash verification value, and when the hash verification value is the same as the symmetric random number hash value, a key is generated based on the symmetric encryption random number to obtain a symmetric encryption key, and then the target symmetric encrypted data is symmetrically decrypted based on the symmetric encryption key to obtain the target encapsulated data, and finally the content is decrypted based on the target encapsulated data to obtain the original data, thereby ensuring that the data receiving end receives secure data that is not tampered with or leaked by means of asymmetric decryption and symmetric decoding.
[0133] In step S601 of some embodiments, after receiving the target transmission data, the data receiving end parses the target transmission data to obtain the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data in the target transmission data.
[0134] In step S602 of some embodiments, the asymmetric encryption private key of the data receiving end corresponds to the asymmetric encryption public key of the data sending end. The data encrypted by the asymmetric encryption public key of the data sending end can only be decrypted by the asymmetric encryption private key corresponding to the data receiving end, thereby ensuring the security of the data. It should be noted that the data sending end only performs asymmetric encryption on the symmetric encryption random number, thereby increasing the speed of data encryption. The data receiving end performs asymmetric decryption on the symmetric random number ciphertext based on the preset asymmetric encryption private key to obtain a symmetric encryption random number. It should be noted that the algorithms of the asymmetric encryption method and the asymmetric decryption method adopted by the data receiving end and the data sending end are corresponding. For example, the data receiving end adopts the RSA algorithm for asymmetric decryption, and the data sending end adopts the RSA algorithm for asymmetric encryption.
[0135] In step S603 of some embodiments, the verification hash value refers to a number obtained by hashing the symmetric encryption random number by the data receiving end using the same hash algorithm as the data sending end. This application does not impose any specific restrictions on the hashing method.
[0136] In step S604 of some embodiments, when the hash verification value is the same as the symmetric random number hash value, that is, the data has not been tampered with during the transmission process, thereby ensuring the data consistency between the data receiving end and the data sending end, and then the key is generated based on the symmetric encryption random number to obtain the symmetric encryption key. It should be noted that the algorithm for generating the symmetric encryption key used by the data sending end and the data receiving end is the same.
[0137] In step S605 of some embodiments, the target symmetrically encrypted data is symmetrically decrypted based on the symmetric encryption key to obtain the target encapsulated data. It should be noted that the symmetric encryption algorithm adopted by the data sending end and the data receiving end is the same.
[0138] See also Figure 7 In some embodiments, the target encapsulated data includes an encryption modulus, an encryption base, an iteration parameter, and target time lock encryption data. Step S606 may include but is not limited to steps S701 to S703:
[0139] Step S701, at the data receiving end, performing aggregate calculation based on the encryption modulus, encryption base and iteration parameter to obtain encrypted ciphertext;
[0140] Step S702, at the data receiving end, the difference between the target time lock encrypted data and the encrypted ciphertext is calculated to obtain the original transmission number;
[0141] Step S703: at the data receiving end, format conversion is performed based on the original transmission digital data to obtain the original data.
[0142] Steps S701 to S703 shown in the embodiment of the present application perform aggregate calculations based on the encryption modulus, encryption base, and iteration parameters to obtain encrypted ciphertext, thereby ensuring that the data receiving end needs to spend a certain amount of time calculating when obtaining the encrypted ciphertext, thereby ensuring the characteristic of delayed data disclosure, and then calculate the difference between the target time-locked encrypted data and the encrypted ciphertext to obtain the original transmission number, and finally perform format conversion based on the original transmission number to obtain the original data, thereby enabling the data receiving end to obtain data from the data sending end securely and with delay.
[0143] In step S701 of some embodiments, an aggregate calculation is performed based on the encryption modulus, the encryption base, and the iteration parameter to obtain an encrypted ciphertext. The encryption calculation method is shown in formula (8):
[0144]
[0145] Among them, the encrypted ciphertext, encryption modulus, encryption base and iteration parameters of the data receiving end and the data sending end are the same. Since the data receiving end does not obtain the first encryption prime number and the second encryption prime number of the data sending end, the data receiving end cannot be simplified by Euler's formula. Therefore, the data receiving end needs to perform multiple calculations, thereby ensuring the delay of data disclosure.
[0146] In step S702 of some embodiments, the difference between the target time lock encrypted data and the encrypted ciphertext is calculated to obtain the original transmission number, as shown in formula (9):
[0147] m=C-C1 (9),
[0148] In step S703 of some embodiments, the format is converted based on the original transmission numbers to obtain the original data. For example, the data sending end converts Chinese characters into UTF-8 encoding, and the data receiving end converts the original transmission numbers in UTF-8 encoding into Chinese characters, thereby obtaining the original data from the data sending end.
[0149] In one embodiment of the present application, the data sending end first obtains the original data, the first encryption prime number, the second encryption prime number and the iteration prime number, and then generates the encryption modulus and the Euler modulus based on the first encryption prime number and the second encryption prime number. Then, the original data is time-locked and encrypted based on the encryption base, iteration parameter, Euler modulus and encryption modulus to obtain the target time-locked encrypted data. Then, a symmetric encryption key is generated based on the symmetric encryption random number, and then the target time-locked encrypted data is symmetrically encrypted based on the symmetric encryption key to obtain the target symmetric encrypted data. Then, the symmetric encryption random number is asymmetrically encrypted based on the asymmetric encryption public key to obtain a symmetric random number ciphertext. At the same time, the symmetric encryption random number is hashed to obtain a symmetric random number hash value. Finally, the symmetric random number hash value, the symmetric random number ciphertext, the encryption base, iteration parameter, encryption modulus and the target encrypted data are sent to the data receiving end.
[0150] The data receiving end verifies that the data is not tampered with during transmission based on the symmetric random number hash value, symmetric random number ciphertext, and asymmetric encryption private key, and then calculates the encrypted ciphertext based on the encryption base, iteration parameter, and encryption modulus. In the calculation of the encrypted ciphertext, due to the huge amount of calculation, it takes a certain amount of time to complete the calculation, thereby achieving delayed disclosure of data. Then, the target encrypted data is parsed based on the encrypted ciphertext to obtain the original data.
[0151] See also Figure 8 The embodiment of the present application also provides a data encryption transmission device, which can implement the above data encryption transmission method, and the device includes:
[0152] The data acquisition module 801 is used to acquire original data, a first encrypted prime number, a second encrypted prime number and an iteration parameter;
[0153] Modulus operation module 802, used for performing modulus operation according to the first encryption prime number and the second encryption prime number to obtain an encryption modulus;
[0154] Euler operation module 803, used for performing Euler operation according to the first encrypted prime number and the second encrypted prime number to obtain the Euler modulus;
[0155] The time lock encryption module 804 is used to perform time lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and the preset encryption base to obtain the target time lock encrypted data;
[0156] The data encryption module 805 is used to encrypt the target time lock encryption data according to the preset symmetric encryption random number, the preset asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain the target transmission data;
[0157] The data transmission module 806 is used to transmit the target transmission data to the data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data.
[0158] The specific implementation of the data encryption transmission device is basically the same as the specific implementation of the above-mentioned data encryption transmission method, and will not be repeated here.
[0159] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above data encryption transmission method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0160] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0161] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0162] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the data encryption transmission method of the embodiment of this application;
[0163] Input / output interface 903, used to implement information input and output;
[0164] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0165] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0166] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0167] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned data encryption transmission method is implemented.
[0168] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0169] The data encryption transmission method, data encryption transmission device, electronic device and storage medium provided in the embodiments of the present application respectively perform modulus operation and Euler operation on a first encryption prime number and a second encryption prime number to obtain an encryption modulus and an Euler modulus, and perform time-lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and the preset encryption technology, so that the target time-lock encrypted data cannot be immediately decrypted in the event of data leakage, thereby ensuring the delayed disclosure of the data; further, the target time-lock encrypted data is encrypted according to the symmetric encryption random number, the asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain the target transmission data, thereby further ensuring the security of the data, and finally transmitting the target transmission data to the data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data, thereby ensuring the delayed disclosure of the data and ensuring the security of the data during transmission.
[0170] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0171] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0172] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0173] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0174] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0175] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0176] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0177] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0178] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0179] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0180] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A data encryption transmission method, characterized in that: The method comprises: Obtaining original data, a first encrypted prime number, a second encrypted prime number, and an iteration parameter; Performing a modulus operation on the first encryption prime number and the second encryption prime number to obtain an encryption modulus; Performing an Euler operation according to the first encrypted prime number and the second encrypted prime number to obtain an Euler modulus; Performing time-lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and a preset encryption base to obtain target time-lock encrypted data; Encrypting the target time lock encrypted data according to a preset symmetric encryption random number, a preset asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain target transmission data; The target transmission data is transmitted to a data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data.
2. The method according to claim 1, characterized in that The step of performing time-lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and a preset encryption base to obtain target time-lock encrypted data includes: Perform iterative aggregation calculation based on the iteration parameter, the Euler modulus, the encryption modulus and the encryption base to obtain an encrypted ciphertext; Performing format conversion based on the original data to obtain original transmission digital data; The encrypted ciphertext and the original transmission number are summed to obtain the target time lock encrypted data.
3. The method according to claim 1, characterized in that The step of encrypting the target time lock encrypted data according to a preset symmetric encryption random number, a preset asymmetric encryption public key, the encryption modulus, the encryption base, and the iteration parameter to obtain target transmission data includes: Perform data encapsulation based on the encryption modulus, the encryption base, the target time lock encrypted data and the iteration parameter to obtain target encapsulated data; The target encapsulated data and the symmetric encrypted random number are digitally signed based on the asymmetric encryption public key to obtain the target transmission data.
4. The method according to claim 3, characterized in that The step of performing digital signature processing on the target encapsulated data and the symmetric encryption random number based on the asymmetric encryption public key to obtain target transmission data includes: Generate a key based on the symmetric encryption random number to obtain a symmetric encryption key; Symmetrically encrypt the target encapsulated data based on the symmetric encryption key to obtain target symmetric encrypted data; The symmetric encryption random number and the target symmetric encryption data are digitally signed based on the asymmetric encryption public key to obtain the target transmission data.
5. The method according to claim 4, characterized in that The step of performing digital signature processing on the symmetric encryption random number and the target symmetric encryption data based on the asymmetric encryption public key to obtain the target transmission data includes: Performing hash processing on the symmetric encryption random number to obtain a symmetric random number hash value; Asymmetrically encrypt the symmetric encryption random number according to the asymmetric encryption public key to obtain a symmetric random number ciphertext; Data encapsulation is performed based on the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data to obtain the target transmission data.
6. The method according to any one of claims 1 to 5, characterized in that: The target transmission data includes the symmetric random number ciphertext, the symmetric random number hash value and the target symmetric encrypted data, and the transmitting the target transmission data to a data receiving end so that the data receiving end decrypts the target transmission data to obtain the original data includes: Transmitting the target transmission data to the data receiving end; At the data receiving end, asymmetrically decrypting the symmetric random number ciphertext based on a preset asymmetric encryption private key to obtain the symmetric encrypted random number; At the data receiving end, performing hash processing on the symmetrically encrypted random number to obtain a hash verification value; At the data receiving end, if the hash verification value is the same as the symmetric random number hash value, a key is generated based on the symmetric encryption random number to obtain the symmetric encryption key; At the data receiving end, symmetrically decrypting the target symmetrically encrypted data based on the symmetrical encryption key to obtain the target encapsulated data; At the data receiving end, content decryption is performed based on the target encapsulated data to obtain the original data.
7. The method according to claim 6, characterized in that The target encapsulated data includes the encryption modulus, the encryption base, the iteration parameter and the target time lock encrypted data; and at the data receiving end, performing content decryption based on the target encapsulated data to obtain the original data includes: At the data receiving end, performing aggregate calculation based on the encryption modulus, the encryption base and the iteration parameter to obtain the encrypted ciphertext; At the data receiving end, calculating the difference between the target time lock encrypted data and the encrypted ciphertext to obtain the original transmission number; At the data receiving end, format conversion is performed based on the original transmission digital data to obtain the original data.
8. A data encryption transmission device, characterized in that: The device comprises: A data acquisition module, used to acquire original data, a first encrypted prime number, a second encrypted prime number and an iteration parameter; A modulus operation module, configured to perform a modulus operation according to the first encryption prime number and the second encryption prime number to obtain an encryption modulus; An Euler operation module, used for performing an Euler operation according to the first encrypted prime number and the second encrypted prime number to obtain an Euler modulus; A time lock encryption module, used to perform time lock encryption on the original data based on the encryption modulus, the Euler modulus, the iteration parameter and a preset encryption base to obtain target time lock encrypted data; A data encryption module, used to encrypt the target time lock encrypted data according to a preset symmetric encryption random number, a preset asymmetric encryption public key, the encryption modulus, the encryption base and the iteration parameter to obtain target transmission data; The data transmission module is used to transmit the target transmission data to a data receiving end, so that the data receiving end decrypts the target transmission data to obtain the original data.
9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the data encryption transmission method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data encryption transmission method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data transmission method and device, storage medium and electronic equipment
CN114430345A
Data encryption transmission method and data decryption method
CN115022023A
Encryption and decryption method and device
CN115459984A
Data transmission method, data transmission device, electronic equipment and readable storage medium
CN118802134A
Data transmission method and device and electronic equipment
CN118802143A