Secure communication method and system based on RSA encryption algorithm

By introducing the attribute information of the data receiver to the RSA encryption algorithm to expand the public key and participate in the private key generation process, the complexity of the key generation process is increased, the low security problem caused by insufficient prime number randomness in the RSA algorithm is solved, and communication security is improved.

CN120474731APending Publication Date: 2025-08-12JIANGXI HUALIAN METAVERSE DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510369615.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-27
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

In the existing RSA encryption algorithm, the random number generator is not powerful enough or has defects, resulting in large prime numbers not being random enough, and there is a risk of using public keys to crack private keys, reducing communication security.

Method used

By obtaining the attribute information of the data recipient, using the first attribute information to expand the initial public key, the second attribute information participates in the initial private key generation, obtaining the target public key and private key, and encrypting the data transmission through the target public key, the receiver uses the target private key to decrypt, increasing the complexity of the key generation process.

Benefits of technology

Even if there are flaws in the prime number generation process, attackers need to understand the complex fusion factors of attribute information and traditional RSA keys in order to crack the key and improve the security of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120474731A_ABST
    Figure CN120474731A_ABST
Patent Text Reader

Abstract

The invention discloses a secure communication method and system based on an RSA encryption algorithm, and the method comprises the steps: obtaining an initial public key and a private key generated by a data receiver based on the RSA encryption algorithm when a data sender needs to carry out the secure communication with the data receiver; acquiring attribute information of a data receiver during secure communication, and determining first attribute information and second attribute information according to the attribute information; expanding the structure of the initial public key by using the first attribute information, wherein the second attribute information participates in the generation of an initial private key to obtain a target public key and a private key; the target public key is sent to the data sender, data needing to be transmitted is encrypted through the target public key and then sent to the data receiver, and the data receiver decrypts the encrypted data through the target private key to achieve secure communication between the data sender and the data receiver. According to the invention, the problem of low security during data communication in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of secure communications, and in particular to a secure communication method and system based on an RSA encryption algorithm. Background Art

[0002] The RSA algorithm is an asymmetric encryption algorithm. Asymmetric encryption uses different keys for encryption and decryption. In the RSA algorithm, there are two keys: a public key and a private key. The public key is publicly available and accessible to anyone, while the private key is kept secret. The public key is used to encrypt data, and the private key is used to decrypt data. The sender encrypts the message using the receiver's public key, and the receiver decrypts it using their private key. Even if the message is intercepted during transmission, the content cannot be decrypted without the private key, thus ensuring communication security.

[0003] However, the security of the RSA algorithm relies on the selection of large prime numbers. If the random number generator is not powerful enough or has defects, the generated prime numbers may not be random enough, posing the risk of using the public key to crack the private key. This in turn reduces the security of the key and ultimately leads to low communication security. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a secure communication method and system based on the RSA encryption algorithm, aiming to solve the problem of low security of drone inspection data storage in the prior art.

[0005] The present invention is achieved in that:

[0006] A secure communication method based on an RSA encryption algorithm, the method comprising:

[0007] When the data sender needs to communicate securely with the data receiver, it obtains the initial public key and private key generated by the data receiver based on the RSA encryption algorithm;

[0008] Acquire attribute information of the data recipient during secure communication, and determine first attribute information and second attribute information according to the attribute information;

[0009] The structure of the initial public key is expanded by using the first attribute information, and the second attribute information is used to participate in the generation of the initial private key to obtain the target public key and private key;

[0010] The target public key is sent to the data sender, the data to be transmitted is encrypted by the target public key and then sent to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver.

[0011] Furthermore, in the above-mentioned secure communication method based on the RSA encryption algorithm, the steps of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information according to the attribute information include:

[0012] Obtaining a timestamp of the data recipient during secure communication and an identity code of the data recipient, and performing hash operations on the timestamp and the identity code to obtain a first hash value and a second hash value;

[0013] The digital sequences composed of the digital elements in the first hash value and the second hash value are respectively extracted as the first attribute information and the second attribute information.

[0014] Furthermore, in the above-mentioned secure communication method based on the RSA encryption algorithm, the step of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information based on the attribute information further includes:

[0015] Determining a third hash value based on the first hash value and the second hash value, mapping the first hash value, the second hash value, and the third hash value to a preset coordinate system, and determining a geometric figure formed by the first hash value, the second hash value, and the third hash value in the preset coordinate system;

[0016] The geometric figure is divided into a first part of the geometric figure and a second part of the geometric figure according to a preset rule, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively obtained, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively used as the first attribute information and the second attribute information.

[0017] Furthermore, in the above-mentioned secure communication method based on the RSA encryption algorithm, the step of dividing the geometric figure according to a preset rule to obtain the first part of the geometric figure and the second part of the geometric figure includes:

[0018] Determine the smallest target hash value among the first hash value, the second hash value, and the third hash value, and use the target hash value as a starting point and a straight line drawn from the midpoint of a line connecting the other two hash values to split the geometric figure into a first part of the geometric figure and a second part of the geometric figure.

[0019] Furthermore, in the above-mentioned secure communication method based on the RSA encryption algorithm, the step of respectively obtaining the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure includes:

[0020] Get the product of the side lengths of the first and second parts of the geometry respectively; or

[0021] The sums of the interior angles of the first partial geometric figure and the second partial geometric figure are obtained respectively as attribute feature values of the first partial geometric figure and the second partial geometric figure.

[0022] Furthermore, in the above-mentioned secure communication method based on the RSA encryption algorithm, the steps of respectively using the first attribute information to expand the structure of the initial public key and using the second attribute information to participate in the generation of the initial private key to obtain the target public key and private key include:

[0023] The numerical value information corresponding to the second attribute information is obtained, and the logarithm of the numerical value information is taken as a parameter to participate in the calculation of the corresponding numerical value in the target private key.

[0024] Furthermore, in the above secure communication method based on the RSA encryption algorithm, the expression of the target public key is:

[0025] (e, n, z);

[0026] The expression of the target private key is:

[0027] (d, n);

[0028] Where n=p*q, p and q are two different large prime numbers selected randomly, z is the first attribute information, e is an integer, And e and Mutually prime, y is the numerical information corresponding to the second attribute information.

[0029] Another object of the present invention is to provide a secure communication system based on the RSA encryption algorithm, the system comprising:

[0030] An acquisition module is used to obtain the initial public key and private key generated by the data receiver based on the RSA encryption algorithm when the data sender needs to communicate securely with the data receiver;

[0031] a determination module, configured to obtain attribute information of a data recipient during secure communication, and determine first attribute information and second attribute information according to the attribute information;

[0032] A generation module, configured to respectively expand the structure of an initial public key using the first attribute information and participate in the generation of an initial private key using the second attribute information to obtain a target public key and a target private key;

[0033] The communication module is used to send the target public key to the data sender, encrypt the data to be transmitted with the target public key and send it to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver.

[0034] Another object of the present invention is to provide a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of any one of the methods described above.

[0035] Another object of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-described methods when executing the program.

[0036] The present invention involves obtaining the initial public key and private key generated by the data receiver based on the RSA encryption algorithm when a data sender needs to securely communicate with a data receiver. The invention also obtains attribute information from the data receiver during secure communication and determines first and second attribute information based on the attribute information. The first attribute information is used to expand the structure of the initial public key and the second attribute information is used to generate the initial private key to obtain target public and private keys. The target public key is sent to the data sender, the target public key is used to encrypt the data to be transmitted, and the encrypted data is sent to the data receiver. The data receiver uses the target private key to decrypt the encrypted data, thereby achieving secure communication between the data sender and the data receiver. This eliminates the need for the generation of public and private keys to solely rely on the generation of prime numbers. The introduction of attribute information increases the variables and complexity of the key generation process. Even if there are certain flaws in the prime number generation process, an attacker would need to understand multiple complex factors, such as how the attribute information integrates with the traditional RSA key, to crack the key, thereby improving communication security. This addresses the low security of data communication in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 Flowchart of a secure communication method based on the RSA encryption algorithm in the first embodiment of the present invention;

[0038] Figure 2 This is a structural block diagram of a secure communication system based on the RSA encryption algorithm in the third embodiment of the present invention.

[0039] The following specific embodiments will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0040] To facilitate understanding of the present invention, the present invention will be described more fully below with reference to the accompanying drawings. The drawings illustrate several embodiments of the present invention. However, the present invention may be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and comprehensive understanding of the present invention.

[0041] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is referred to as being "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.

[0042] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the relevant listed types.

[0043] The following will describe in detail how to improve the security of data communication with reference to specific embodiments and accompanying drawings.

[0044] Example 1

[0045] See also Figure 1 , which shows a secure communication method based on the RSA encryption algorithm in the first embodiment of the present invention, and the method includes steps S10 to S13.

[0046] Step S10: When the data sender needs to communicate securely with the data receiver, the data sender obtains the initial public key and private key generated by the data receiver based on the RSA encryption algorithm.

[0047] When one party (the data sender) wants to securely transmit information to another party (the data receiver), encryption technology is often used to prevent the information from being stolen or tampered with during transmission. The RSA encryption algorithm is a widely used asymmetric encryption algorithm. In an asymmetric encryption system, there is a pair of keys: a public key and a private key.

[0048] The data recipient first generates a pair of keys based on the RSA encryption algorithm: an initial public key and an initial private key. The public key is publicly available and can be accessed by anyone. It is used to encrypt data. The private key, on the other hand, is strictly confidential and known only to the data recipient. It is used to decrypt data encrypted with the corresponding public key.

[0049] Step S11: Acquire attribute information of the data recipient during secure communication, and determine first attribute information and second attribute information according to the attribute information.

[0050] Specifically, attribute information is primarily used to increase the variables and complexity of the key generation process. This attribute information can include the timestamp of the data recipient when initiating communication or the data recipient's identity. The purpose of dividing the attribute information into first and second attribute information is to utilize the first and second attribute information to improve the public and private keys, respectively.

[0051] Step S12: The structure of the initial public key is expanded using the first attribute information, and the second attribute information is used to participate in the generation of the initial private key to obtain the target public key and private key.

[0052] The first attribute information expands the structure of the initial public key. Specifically, the initial public key is expanded by embedding corresponding parameters in the initial public key. The initial public key is usually composed of specific mathematical parameters (in the RSA algorithm, the public key is generally composed of a modulus n obtained by multiplying two large prime numbers and an exponent e that is relatively prime to the value of the Euler function). During the expansion process, the corresponding parameter information is added to the structure of the public key. For example, the expression of the expanded target public key is:

[0053] (e, n, z);

[0054] Where n=p*q, p and q are two different large prime numbers selected randomly, z is the first attribute information, e is an integer, And e and Mutually prime,

[0055] When generating the target private key, the numerical information corresponding to the second attribute information is obtained, and the logarithm of the numerical information is taken as a parameter to participate in the calculation of the corresponding numerical value in the target private key. The expression of the target private key is:

[0056] (d, n);

[0057] Specifically, when calculating the private key d, the numerical information corresponding to the second attribute information is used as an additional parameter in the calculation, so that the calculation of d no longer relies solely on the traditional and the public key exponent e, e.g., y is the numerical information corresponding to the second attribute information. In this way, even if an attacker obtains the new representation of the public key, it is difficult to deduce the representation of the private key, thereby improving security.

[0058] Step S13, the target public key is sent to the data sender, the data to be transmitted is encrypted by the target public key and then sent to the data receiver, and the data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver.

[0059] After determining the matching target public and private keys, the receiver then sends the generated target public key to the data sender. This process can be achieved through various security methods, such as using digital certificates to ensure the authenticity of the public key during transmission and prevent tampering by intermediaries.

[0060] Once the data sender obtains the target public key, they can use it to encrypt the data they wish to transmit. The encryption process is similar to locking information in a safe that can only be opened with a specific private key. The encrypted data is then transmitted to the recipient via a network or other transmission channel. During this process, even if the data is intercepted by a third party, they will be unable to decipher the data's contents without the corresponding private key.

[0061] After receiving the encrypted data, the data receiver uses the target private key to decrypt it. The data receiver successfully obtains the information transmitted by the data sender, achieving secure communication. Furthermore, the introduction of attribute information increases the variables and complexity of the key generation process. Even if there are certain flaws in the prime number generation process, an attacker would need to understand multiple complex factors, such as how the attribute information is integrated with the traditional RSA key, to crack the key, further enhancing the security of communication.

[0062] In summary, the secure communication method based on the RSA encryption algorithm in the above-mentioned embodiments of the present invention involves obtaining the initial public key and private key generated by the data receiver based on the RSA encryption algorithm when a data sender needs to communicate securely with a data receiver; obtaining attribute information of the data receiver during secure communication, and determining first attribute information and second attribute information based on the attribute information; using the first attribute information to expand the structure of the initial public key and the second attribute information to participate in the generation of the initial private key to obtain target public and private keys; sending the target public key to the data sender, encrypting the data to be transmitted using the target public key, and then sending it to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver. This ensures that the generation of public and private keys does not rely solely on the generation of prime numbers. By introducing attribute information, the variables and complexity of the key generation process are increased. Even if there are certain defects in the prime number generation process, an attacker would need to understand multiple complex factors, such as how the attribute information is integrated with the traditional RSA key, to crack the key, thereby improving the security of communication. This method solves the problem of low data communication security in the prior art.

[0063] Example 2

[0064] This embodiment also proposes a secure communication method based on the RSA encryption algorithm. The difference between the secure communication method based on the RSA encryption algorithm proposed in this embodiment and the secure communication method based on the RSA encryption algorithm proposed in the first embodiment is that:

[0065] The steps of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information according to the attribute information include:

[0066] Obtaining a timestamp of the data recipient during secure communication and an identity code of the data recipient, and performing hash operations on the timestamp and the identity code to obtain a first hash value and a second hash value;

[0067] The digital sequences composed of the digital elements in the first hash value and the second hash value are respectively extracted as the first attribute information and the second attribute information.

[0068] Among them, attribute information includes timestamps and identity identification codes. After collecting the timestamps and identity identification codes, hash operations are performed on these two pieces of information respectively. Hash operation is an algorithm that converts data of arbitrary length into a fixed-length hash value. Its characteristics are that the same input always results in the same hash value, and the hash values obtained by different inputs are almost never repeated. In addition, the hash value is unidirectional, that is, it is difficult to reversely deduce the original data from the hash value. The first hash value is obtained by performing a hash operation on the timestamp, and the second hash value is obtained by performing a hash operation on the identity identification code. Taking hash algorithms such as MD5 and SHA-256 as examples, these algorithms perform complex bit operations on the input data and output a fixed-length hash value, thereby realizing feature extraction of the original data.

[0069] Next, after obtaining the first and second hash values, the digital elements are extracted from each of these hash values. Hash values typically consist of numbers and letters. Using specific filtering rules, only the numerical components are extracted, and these numbers are arranged in order to form a numerical sequence. The numerical sequence extracted from the first hash value is the first attribute information, and the numerical sequence extracted from the second hash value is the second attribute information. This attribute information is used in subsequent key generation operations, providing an additional layer of communication security.

[0070] In addition, in some optional embodiments of the present invention, in order to further improve the security of the key, the step of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information based on the attribute information further includes:

[0071] Determining a third hash value based on the first hash value and the second hash value, mapping the first hash value, the second hash value, and the third hash value to a preset coordinate system, and determining a geometric figure formed by the first hash value, the second hash value, and the third hash value in the preset coordinate system;

[0072] The geometric figure is divided into a first part of the geometric figure and a second part of the geometric figure according to a preset rule, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively obtained, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively used as the first attribute information and the second attribute information

[0073] Among them, subsequent operations are performed based on the first hash value and the second hash value obtained previously. First, according to a specific hash operation rule, the first hash value and the second hash value are used as input to calculate the third hash value. The first hash value, the second hash value and the third hash value are mapped to specific points in the preset coordinate system according to the established mapping rules. In this way, the points corresponding to the three hash values in the coordinate system are enclosed to form a geometric figure. Then, the formed geometric figure is segmented according to the pre-set segmentation rules. These rules can be formulated based on factors such as the area and side length ratio of the figure. After segmentation, the first part of the geometric figure and the second part of the geometric figure are obtained. For these two parts of the geometric figure, their attribute feature values are extracted respectively. These feature values can be the area, perimeter, sum of internal angles, or the length of a specific side, etc. Finally, the attribute feature value of the first part of the geometric figure is used as the first attribute information, and the attribute feature value of the second part of the geometric figure is used as the second attribute information.

[0074] Specifically, obtain the product of the side lengths of the first part of the geometric figure and the second part of the geometric figure respectively; or

[0075] The sum of the interior angles of the first and second parts of the geometric figure are obtained respectively as the attribute feature values of the first and second parts of the geometric figure. In addition, when segmenting the geometric figure, the size of the three hash values can be compared, and the smallest hash value is used as the starting point. A straight line is drawn to the midpoint of the line connecting the points corresponding to the other two hash values or a randomly selected point to split the geometric figure into two parts, assuming that the first hash value < the second hash value < the third hash value. The point corresponding to the first hash value can be used as the starting point, and a straight line is drawn to the midpoint of the line connecting the points corresponding to the second and third hash values to split the geometric figure into two parts, or the segmentation ratio can be determined based on the difference between the three hash values. For example, the difference between adjacent hash values is calculated, and the ratio of the difference is used to determine the position of the segmentation point on a certain edge of the figure, and then the segmentation point is connected to a vertex of the figure for segmentation. Specifically, the hash value can be regarded as a number based on hexadecimal (or other bases), and then it can be converted into a decimal number for comparison to determine the size of the hash value.

[0076] As you can understand, extracting different information from the segmented geometric figure to generate the private key increases the complexity of the private key generation process. The public and private keys extract features from different parts of the geometric figure, making their connection more complex and obscure. This makes it difficult for an attacker to determine how the private key was generated through simple reasoning, even if they obtain the public key and its newly added representation. This further enhances key security.

[0077] In summary, the secure communication method based on the RSA encryption algorithm in the above-mentioned embodiments of the present invention involves obtaining the initial public key and private key generated by the data receiver based on the RSA encryption algorithm when a data sender needs to communicate securely with a data receiver; obtaining attribute information of the data receiver during secure communication, and determining first attribute information and second attribute information based on the attribute information; using the first attribute information to expand the structure of the initial public key and the second attribute information to participate in the generation of the initial private key to obtain target public and private keys; sending the target public key to the data sender, encrypting the data to be transmitted using the target public key, and then sending it to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver. This ensures that the generation of public and private keys does not rely solely on the generation of prime numbers. By introducing attribute information, the variables and complexity of the key generation process are increased. Even if there are certain defects in the prime number generation process, an attacker would need to understand multiple complex factors, such as how the attribute information is integrated with the traditional RSA key, to crack the key, thereby improving the security of communication. This method solves the problem of low data communication security in the prior art.

[0078] Example 3

[0079] See also Figure 2 , shown is a secure communication system based on the RSA encryption algorithm proposed in the third embodiment of the present invention, the system comprising:

[0080] The acquisition module 100 is used to obtain the initial public key and private key generated by the data receiver based on the RSA encryption algorithm when the data sender needs to communicate securely with the data receiver;

[0081] The determination module 200 is used to obtain attribute information of the data recipient during secure communication, and determine first attribute information and second attribute information based on the attribute information;

[0082] A generation module 300 is configured to expand the structure of an initial public key using the first attribute information and to participate in the generation of an initial private key using the second attribute information to obtain a target public key and a target private key;

[0083] The communication module 400 is used to send the target public key to the data sender, encrypt the data to be transmitted using the target public key, and then send it to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver.

[0084] Furthermore, in the secure communication system based on the RSA encryption algorithm, the steps of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information based on the attribute information include:

[0085] Obtaining a timestamp of the data recipient during secure communication and an identity code of the data recipient, and performing hash operations on the timestamp and the identity code to obtain a first hash value and a second hash value;

[0086] The digital sequences composed of the digital elements in the first hash value and the second hash value are respectively extracted as the first attribute information and the second attribute information.

[0087] Furthermore, in the secure communication system based on the RSA encryption algorithm, the step of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information based on the attribute information further includes:

[0088] Determining a third hash value based on the first hash value and the second hash value, mapping the first hash value, the second hash value, and the third hash value to a preset coordinate system, and determining a geometric figure formed by the first hash value, the second hash value, and the third hash value in the preset coordinate system;

[0089] The geometric figure is divided into a first part of the geometric figure and a second part of the geometric figure according to a preset rule, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively obtained, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively used as the first attribute information and the second attribute information.

[0090] Furthermore, in the above-mentioned secure communication system based on the RSA encryption algorithm, the step of dividing the geometric figure according to a preset rule to obtain the first part of the geometric figure and the second part of the geometric figure includes:

[0091] Determine the smallest target hash value among the first hash value, the second hash value, and the third hash value, and use the target hash value as a starting point and a straight line drawn from the midpoint of a line connecting the other two hash values to split the geometric figure into a first part of the geometric figure and a second part of the geometric figure.

[0092] Furthermore, in the above-mentioned secure communication system based on the RSA encryption algorithm, the step of respectively obtaining the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure includes:

[0093] Get the product of the side lengths of the first and second parts of the geometry respectively; or

[0094] The sums of the interior angles of the first partial geometric figure and the second partial geometric figure are obtained respectively as attribute feature values of the first partial geometric figure and the second partial geometric figure.

[0095] Furthermore, in the above-mentioned secure communication system based on the RSA encryption algorithm, the steps of respectively using the first attribute information to expand the structure of the initial public key and the second attribute information to participate in the generation of the initial private key to obtain the target public key and private key include:

[0096] The numerical value information corresponding to the second attribute information is obtained, and the logarithm of the numerical value information is taken as a parameter to participate in the calculation of the corresponding numerical value in the target private key.

[0097] Furthermore, in the above secure communication system based on the RSA encryption algorithm, the expression of the target public key is:

[0098] (e, n, z);

[0099] The expression of the target private key is:

[0100] (d, n);

[0101] Where n=p*q, p and q are two different large prime numbers selected randomly, z is the first attribute information, e is an integer, And e and Mutually prime, y is the numerical information corresponding to the second attribute information.

[0102] The functions or operation steps implemented when the above modules are executed are substantially the same as those in the above method embodiments and will not be described in detail here.

[0103] Example 4

[0104] Another aspect of the present invention further provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the above-mentioned embodiments 1 to 2.

[0105] Example 5

[0106] On the other hand, the present invention also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and runnable on the processor, and when the processor executes the program, the steps of the method described in any one of the above embodiments one to two are implemented.

[0107] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0108] Those skilled in the art will appreciate that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing the logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (e.g., a computer-based system, a system including a processor, or other system that can fetch and execute instructions from an instruction execution system, apparatus, or device). For purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0109] More specific examples (a non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic devices), a portable computer disk cartridge (magnetic devices), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.

[0110] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiments, multiple steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement the hardware: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0111] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that a specific feature, structure, material, or characteristic described in conjunction with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0112] The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims

1. A secure communication method based on RSA encryption algorithm, characterized in that: The method comprises: When the data sender needs to communicate securely with the data receiver, it obtains the initial public key and private key generated by the data receiver based on the RSA encryption algorithm; Acquire attribute information of the data recipient during secure communication, and determine first attribute information and second attribute information according to the attribute information; The structure of the initial public key is expanded by using the first attribute information, and the second attribute information is used to participate in the generation of the initial private key to obtain the target public key and private key; The target public key is sent to the data sender, the data to be transmitted is encrypted by the target public key and then sent to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver.

2. The secure communication method based on the RSA encryption algorithm according to claim 1, characterized in that: The steps of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information according to the attribute information include: Obtaining a timestamp of the data recipient during secure communication and an identity code of the data recipient, and performing hash operations on the timestamp and the identity code to obtain a first hash value and a second hash value; The digital sequences composed of the digital elements in the first hash value and the second hash value are respectively extracted as the first attribute information and the second attribute information.

3. The secure communication method based on the RSA encryption algorithm according to claim 2, characterized in that: The step of obtaining attribute information of the data recipient during secure communication and determining the first attribute information and the second attribute information according to the attribute information further includes: Determining a third hash value based on the first hash value and the second hash value, mapping the first hash value, the second hash value, and the third hash value to a preset coordinate system, and determining a geometric figure formed by the first hash value, the second hash value, and the third hash value in the preset coordinate system; The geometric figure is divided into a first part of the geometric figure and a second part of the geometric figure according to a preset rule, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively obtained, and the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure are respectively used as the first attribute information and the second attribute information.

4. The secure communication method based on the RSA encryption algorithm according to claim 3, characterized in that: The step of dividing the geometric figure according to a preset rule to obtain a first part of the geometric figure and a second part of the geometric figure includes: Determine the smallest target hash value among the first hash value, the second hash value, and the third hash value, and use the target hash value as a starting point and a straight line drawn from the midpoint of a line connecting the other two hash values to split the geometric figure into a first part of the geometric figure and a second part of the geometric figure.

5. The secure communication method based on the RSA encryption algorithm according to claim 3, characterized in that: The steps of respectively obtaining the attribute characteristic values of the first part of the geometric figure and the second part of the geometric figure include: Get the product of the side lengths of the first and second parts of the geometry respectively; or The sums of the interior angles of the first partial geometric figure and the second partial geometric figure are obtained respectively as attribute feature values of the first partial geometric figure and the second partial geometric figure.

6. The secure communication method based on the RSA encryption algorithm according to claim 1, characterized in that: The steps of respectively using the first attribute information to expand the structure of the initial public key and the second attribute information to participate in the generation of the initial private key to obtain the target public key and private key include: The numerical value information corresponding to the second attribute information is obtained, and the logarithm of the numerical value information is taken as a parameter to participate in the calculation of the corresponding numerical value in the target private key.

7. The secure communication method based on the RSA encryption algorithm according to claim 1, characterized in that: The expression of the target public key is: (e, n, z); The expression of the target private key is: (d, n); Where n=p*q, p and q are two different large prime numbers selected randomly, z is the first attribute information, e is an integer, And e and Mutually prime, y is the numerical information corresponding to the second attribute information.

8. A secure communication system based on RSA encryption algorithm, characterized in that: The system comprises: An acquisition module is used to obtain the initial public key and private key generated by the data receiver based on the RSA encryption algorithm when the data sender needs to communicate securely with the data receiver; a determination module, configured to obtain attribute information of a data recipient during secure communication, and determine first attribute information and second attribute information according to the attribute information; A generation module, configured to respectively expand the structure of an initial public key using the first attribute information and participate in the generation of an initial private key using the second attribute information to obtain a target public key and a target private key; The communication module is used to send the target public key to the data sender, encrypt the data to be transmitted using the target public key, and then send it to the data receiver. The data receiver uses the target private key to decrypt the encrypted data to achieve secure communication between the data sender and the data receiver.

9. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.