A communication method and system based on asymmetric encryption

CN116707957BActive Publication Date: 2026-08-18HUIZHIAN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310789113.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2026-08-18
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

[0003]然而,现有的这种非对称加密方式,服务器中的密钥是保持不变的,一旦该密钥被破译,就会存在较大的数据传输风险

Benefits of technology

[0031]本发明提供的技术方案,在接收到可以客户端发来的目标数据后,可以根据其中的第一公钥,动态地生成本次数据传输过程中的第二公钥和第二密钥。后续,在接收到第二客户端发来的待传输数据后,可以利用第二公钥对该待传输数据进行加密,并将第二密钥反馈给第一客户端。这样,第一客户端可以根据第二密钥对加密后的待传输数据进行解密。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116707957B_ABST
    Figure CN116707957B_ABST
Patent Text Reader

Abstract

The application provides a communication method and system based on asymmetric encryption, and the method comprises the following steps: receiving target data sent by a first client, wherein the target data comprises a first public key stored in the first client; dynamically generating a second public key and a second secret key based on the first public key, and feeding back the second public key and the second secret key to the first client; after receiving to-be-transmitted data sent by a second client, encrypting the to-be-transmitted data by using the second public key, and sending the encrypted data to the first client, so that the first client decrypts the encrypted data according to the second secret key. The technical scheme provided by the application can improve the security of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to a communication method and system based on asymmetric encryption. Background Technology

[0002] Current asymmetric encryption methods typically store public and private keys on the server. When the server receives encrypted information from the client, it can use the matching key to decrypt the encrypted data.

[0003] However, in this existing asymmetric encryption method, the key on the server remains unchanged. Once the key is cracked, there is a significant risk to data transmission. Summary of the Invention

[0004] This invention provides a communication method and system based on asymmetric encryption, which can improve the security of data transmission.

[0005] In view of this, the present invention provides a communication method based on asymmetric encryption, the method comprising:

[0006] Receive target data sent by a first client, wherein the target data includes a first public key stored in the first client;

[0007] A second public key and a second private key are dynamically generated based on the first public key, and the second public key and the second private key are fed back to the first client.

[0008] After receiving the data to be transmitted from the second client, the data is encrypted using the second public key, and the encrypted data is sent to the first client so that the first client can decrypt the encrypted data using the second key.

[0009] In one implementation, after receiving the target data sent by the first client, the method further includes:

[0010] The target data is encrypted using a third public key, and the encrypted data is sent to a second client; wherein the third public key and the third key matching the third public key are dynamically generated based on a fourth public key stored in the second client;

[0011] The second client uses the third key to decrypt the received encrypted data.

[0012] In one implementation, dynamically generating a second public key and a second private key based on the first public key includes:

[0013] Calculate the hash value corresponding to the first public key, and convert the hash value into decimal data;

[0014] Using the decimal data as the center, select two adjacent first prime numbers and second prime numbers;

[0015] Calculate the public key suffix and the private key suffix based on the first prime number and the second prime number, respectively;

[0016] Add the same prefix to the public key suffix and the key suffix, and use the data with the added prefix as the second public key and the second key.

[0017] In one implementation, calculating the public key suffix and the private key suffix based on the first prime number and the second prime number respectively includes:

[0018] Calculate the product of the first prime number and the second prime number;

[0019] Euler values ​​are generated by processing the first prime number and the second prime number according to the Euler totient function.

[0020] Determine a random integer less than the Euler value, and calculate the modular inverse of the random integer with respect to the Euler value;

[0021] Use the random integer as the public key suffix and the modulo inverse element as the key suffix.

[0022] In one implementation, adding the same prefix to the public key suffix and the private key suffix includes:

[0023] The product of the first prime number and the second prime number is used as the common prefix for the public key suffix and the private key suffix.

[0024] In another aspect, the present invention provides a communication system based on asymmetric encryption, the system comprising:

[0025] A data receiving unit is used to receive target data sent by a first client, wherein the target data includes a first public key stored in the first client;

[0026] A dynamic processing unit is configured to dynamically generate a second public key and a second private key based on the first public key, and then feed the second public key and the second private key back to the first client.

[0027] The data transmission unit is configured to, upon receiving data to be transmitted from the second client, encrypt the data to be transmitted using the second public key, and send the encrypted data to the first client, so that the first client can decrypt the encrypted data using the second key.

[0028] In one embodiment, the system further includes:

[0029] An encryption unit is used to encrypt the target data using a third public key and send the encrypted data to a second client, so that the second client can decrypt the received encrypted data using the third key; wherein the third public key and the third key matching the third public key are dynamically generated based on a fourth public key stored in the second client.

[0030] In one embodiment, the dynamic processing unit is specifically used to: calculate the hash value corresponding to the first public key and convert the hash value into decimal data; select two adjacent first prime numbers and second prime numbers centered on the decimal data; calculate the public key suffix and the key suffix respectively based on the first prime number and the second prime number; add the same prefix to the public key suffix and the key suffix, and use the data with the added prefix as the second public key and the second key.

[0031] The technical solution provided by this invention, upon receiving target data from a client, can dynamically generate a second public key and a second private key for the current data transmission process based on the first public key contained therein. Subsequently, upon receiving data to be transmitted from a second client, the second public key can be used to encrypt the data, and the second private key can be sent back to the first client. Thus, the first client can decrypt the encrypted data to be transmitted using the second private key.

[0032] As can be seen, the technical solution provided by this invention can dynamically generate keys when data transmission is required, thereby greatly ensuring the security of data transmission.

[0033] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings.

[0034] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0035] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0036] Figure 1 This is a schematic diagram illustrating the steps of a communication method based on asymmetric encryption in an embodiment of the present invention;

[0037] Figure 2This is a schematic diagram of the functional modules of a communication system based on asymmetric encryption in an embodiment of the present invention. Detailed Implementation

[0038] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0039] Please see Figure 1 One embodiment of this application provides a communication method based on asymmetric encryption, the method comprising:

[0040] S1: Receive target data sent by the first client, wherein the target data includes a first public key stored in the first client;

[0041] S2: Dynamically generate a second public key and a second private key based on the first public key, and feed the second public key and the second private key back to the first client;

[0042] S3: After receiving the data to be transmitted from the second client, the data to be transmitted is encrypted using the second public key, and the encrypted data is sent to the first client so that the first client can decrypt the encrypted data using the second key.

[0043] In one implementation, dynamically generating a second public key and a second private key based on the first public key includes:

[0044] Calculate the hash value corresponding to the first public key, and convert the hash value into decimal data;

[0045] Using the decimal data as the center, select two adjacent first prime numbers and second prime numbers;

[0046] Calculate the public key suffix and the private key suffix based on the first prime number and the second prime number, respectively;

[0047] Add the same prefix to the public key suffix and the key suffix, and use the data with the added prefix as the second public key and the second key.

[0048] Here, the first prime number can be represented as p, and the second prime number can be represented as q. When calculating the public key suffix and the private key suffix, the product of the first and second prime numbers, p*q, can be calculated. Then, the first and second prime numbers are processed according to the Euler's totient function to generate an Euler value. Next, a random integer less than the Euler value can be determined, and the modular inverse of the random integer with respect to the Euler value can be calculated. Finally, the random integer can be used as the public key suffix, and the modular inverse can be used as the private key suffix.

[0049] When adding a common prefix to the public key suffix and the key suffix, the product of the first prime number and the second prime number can be used as the common prefix for the public key suffix and the key suffix.

[0050] Thus, following the process described above, a matching second public key and second private key can be dynamically generated based on the first public key. Similarly, a matching third public key and third private key can be dynamically generated based on the fourth public key sent by the second client.

[0051] In one implementation, after the server receives the target data sent by the first client, the method further includes:

[0052] The target data is encrypted using a third public key, and the encrypted data is sent to a second client; wherein the third public key and the third key matching the third public key are dynamically generated based on a fourth public key stored in the second client;

[0053] The second client uses the third key to decrypt the received encrypted data.

[0054] Please see Figure 2 In another aspect, the present invention also provides a communication system based on asymmetric encryption, the system comprising:

[0055] A data receiving unit is used to receive target data sent by a first client, wherein the target data includes a first public key stored in the first client;

[0056] A dynamic processing unit is configured to dynamically generate a second public key and a second private key based on the first public key, and then feed the second public key and the second private key back to the first client.

[0057] The data transmission unit is configured to, upon receiving data to be transmitted from the second client, encrypt the data to be transmitted using the second public key, and send the encrypted data to the first client, so that the first client can decrypt the encrypted data using the second key.

[0058] In one embodiment, the system further includes:

[0059] An encryption unit is used to encrypt the target data using a third public key and send the encrypted data to a second client, so that the second client can decrypt the received encrypted data using the third key; wherein the third public key and the third key matching the third public key are dynamically generated based on a fourth public key stored in the second client.

[0060] In one embodiment, the dynamic processing unit is specifically used to: calculate the hash value corresponding to the first public key and convert the hash value into decimal data; select two adjacent first prime numbers and second prime numbers centered on the decimal data; calculate the public key suffix and the key suffix respectively based on the first prime number and the second prime number; add the same prefix to the public key suffix and the key suffix, and use the data with the added prefix as the second public key and the second key.

[0061] The technical solution provided by this invention, upon receiving target data from a client, can dynamically generate a second public key and a second private key for the current data transmission process based on the first public key contained therein. Subsequently, upon receiving data to be transmitted from a second client, the second public key can be used to encrypt the data, and the second private key can be sent back to the first client. Thus, the first client can decrypt the encrypted data to be transmitted using the second private key.

[0062] As can be seen, the technical solution provided by this invention can dynamically generate keys when data transmission is required, thereby greatly ensuring the security of data transmission.

[0063] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A communication method based on asymmetric encryption, characterized in that, The method includes: Receive target data sent by a first client, wherein the target data includes a first public key stored in the first client; A second public key and a second private key are dynamically generated based on the first public key, and the second public key and the second private key are fed back to the first client. After receiving the data to be transmitted from the second client, the data to be transmitted is encrypted using the second public key, and the encrypted data is sent to the first client so that the first client can decrypt the encrypted data using the second key. The dynamic generation of the second public key and the second private key based on the first public key includes: Calculate the hash value corresponding to the first public key, and convert the hash value into decimal data; Using the decimal data as the center, select two adjacent first prime numbers and second prime numbers; Calculate the public key suffix and the private key suffix based on the first prime number and the second prime number, respectively; Add the same prefix to the public key suffix and the key suffix, and use the data with the added prefix as the second public key and the second key; The calculation of the public key suffix and the private key suffix based on the first prime number and the second prime number includes: Calculate the product of the first prime number and the second prime number; Euler values ​​are generated by processing the first prime number and the second prime number according to the Euler totient function. Determine a random integer less than the Euler value, and calculate the modular inverse of the random integer with respect to the Euler value; Use the random integer as the public key suffix and the modular inverse element as the key suffix; Adding the same prefix to the public key suffix and the private key suffix includes: The product of the first prime number and the second prime number is used as the common prefix for the public key suffix and the private key suffix.

2. The method according to claim 1, characterized in that, After receiving the target data sent by the first client, the method further includes: The target data is encrypted using a third public key, and the encrypted data is sent to a second client; wherein the third public key and the third key matching the third public key are dynamically generated based on a fourth public key stored in the second client; The second client uses the third key to decrypt the received encrypted data.

3. A communication system based on asymmetric encryption, characterized in that, The system includes: A data receiving unit is used to receive target data sent by a first client, wherein the target data includes a first public key stored in the first client; A dynamic processing unit is configured to dynamically generate a second public key and a second private key based on the first public key, and then feed the second public key and the second private key back to the first client. The data transmission unit is configured to, after receiving data to be transmitted from the second client, encrypt the data to be transmitted using the second public key, and send the encrypted data to the first client, so that the first client can decrypt the encrypted data according to the second key; The dynamic generation of the second public key and the second private key based on the first public key includes: Calculate the hash value corresponding to the first public key, and convert the hash value into decimal data; Using the decimal data as the center, select two adjacent first prime numbers and second prime numbers; Calculate the public key suffix and the private key suffix based on the first prime number and the second prime number, respectively; Add the same prefix to the public key suffix and the key suffix, and use the data with the added prefix as the second public key and the second key; The calculation of the public key suffix and the private key suffix based on the first prime number and the second prime number includes: Calculate the product of the first prime number and the second prime number; Euler values ​​are generated by processing the first prime number and the second prime number according to the Euler totient function. Determine a random integer less than the Euler value, and calculate the modular inverse of the random integer with respect to the Euler value; Use the random integer as the public key suffix and the modular inverse element as the key suffix; Adding the same prefix to the public key suffix and the private key suffix includes: The product of the first prime number and the second prime number is used as the common prefix for the public key suffix and the private key suffix.

4. The system according to claim 3, characterized in that, The system also includes: An encryption unit is used to encrypt the target data using a third public key and send the encrypted data to a second client, so that the second client can decrypt the received encrypted data using the third key; wherein the third public key and the third key matching the third public key are dynamically generated based on a fourth public key stored in the second client.

Citation Information

Patent Citations

  • Data transmission method and device, secure communication system and storage medium

    CN115766066A

  • Data transmission method, system and device, computer equipment and storage medium

    CN116318897A