Implementation method of floating-point number encryption algorithm

By projecting floating-point data into the XY coordinate system and using random key encryption, the security problem of floating-point data transmission in the prior art is solved, reliable data transmission and decryption are realized, and the communication process is simplified.

CN120342585APending Publication Date: 2025-07-18CHINA SATELLITE MARITIME MEASUREMENT & CONTROL DEPT
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510193853.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The prior art is difficult to effectively encrypt and transmit floating-point data in the form of XXXX.XXXX bits, and the deciphering is relatively difficult. A non-generic encryption algorithm is needed to ensure the reliable transmission of data.

Method used

The floating-point data is projected into the XY coordinate system, and the XY vertical and horizontal coordinates are divided equally to form external and internal equal parts. A random key is used to replace the real value of the data, and the encryption is transmitted through handshake and control protocols. The key can be randomly replaced to increase the difficulty of deciphering.

Benefits of technology

It realizes reliable encryption and decryption of floating-point data, improves communication security and reliability, and simplifies the data transmission process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342585A_ABST
    Figure CN120342585A_ABST
Patent Text Reader

Abstract

The invention relates to a floating-point number encryption algorithm, which is characterized in that a transverse axis and a longitudinal axis of an XY coordinate system are equally divided into 10 parts to form outer equal division points, each outer equal division point is equally divided into 10 parts to form inner equal division points, for abcd.efgh, the outer equal division points represent ab and ef values, the inner equal division points represent cd and gh values, 10 bits are extracted from [0-9] and [a-f] to form outer equal division point keys in pairs, and forming an inner equal division point key by tenth, respectively extracting a group of outer equal division point key numbers and inner equal division point key numbers according to needs, and sending the outer equal division point key numbers and the inner equal division point key numbers according to a handshake protocol. The real values of the XY coordinate system are formed in pairs according to the four digits before and after the decimal point of the floating point type data, then the real values are projected into the coordinate system, and the real values are expressed in the form of the secret key, so that data encryption is realized, the secret key can be replaced by sending a handshake protocol according to needs, and the communication reliability is greatly improved. In application, compiling and debugging are convenient, random key encryption of XXXX.XXXX type floating-point numbers can be achieved, and the method has extremely high application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for implementing a floating-point encryption algorithm, and particularly to a floating-point encryption algorithm of XXXX.XXXX type. It belongs to the technical field of software engineering. Background Art

[0002] Data encryption, also known as cryptography, is a technology with a long history. Generally, it refers to the process of converting plaintext into ciphertext through an encryption algorithm and an encryption key, and decryption is the process of processing ciphertext into plaintext through a decryption algorithm and a decryption key. Data encryption is still the most reliable method for a computer system to protect information at present. By using cryptographic technology to encrypt information, information concealment is realized, thus achieving the function of protecting information security. The algorithms of data encryption are mainly divided into symmetric encryption algorithms, asymmetric encryption algorithms, and hybrid encryption algorithms. For general encryption algorithms, the difficulty of breaking them is relatively low. To facilitate the encrypted transmission of floating-point data in the form of XXXX.XXXX digits, there is an urgent need for a non-general encryption algorithm to support and ensure the reliable transmission of this floating-point data.

[0003] The present invention designs a floating-point encryption algorithm of XXXX.XXXX type, providing a practical and simple method to solve this problem. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method for implementing a floating-point encryption algorithm of XXXX.XXXX type for the above-mentioned existing technology. For floating-point data of abcd.efgh type, the separated values of ab, cd, ef, and gh are respectively used as a set of coordinate values and projected onto the XY coordinate system. The horizontal and vertical axes of the XY coordinate system are equally divided into ten parts, which is called external equal division. Among them, ab and ef are represented by external equal division, and each external equal division is further equally divided into ten parts, which is called internal equal division. Among them, cd and gh are represented by internal equal division points. The internal equal division and the external equal division are combined with the numbers 0-9 and the characters a-f to form a set of random keys. Finally, the floating-point data of abcd.efgh type is transformed into the key form and sent out, which has the characteristics of clear principle, simple structure, and easy implementation.

[0005] The technical solution adopted by the present invention to solve the above problems is: a method for implementing a numerical data encryption algorithm, mainly projecting floating-point data onto the XY coordinate system. After equally dividing the XY horizontal and vertical coordinates, the key is assigned to each internal and external equal division point, that is, the key replaces the real value of the data, thereby realizing data encryption, where: The external equal division point key actually represents the tens digit of the floating-point data separation value data. For example, for the floating-point data 1234.5678, the separation values are 12, 34, 56, 78. The external equal division points represent the values between 1 and 2, 5 and 6. Of course, this value is reflected through the key. The key design extracts ten numbers from [0-9] and [a-f]. The external equal division points on the X and Y axes respectively form keys, and are combined in pairs to form a group of keys. A total of 256 groups are extracted. According to the program design, a group of keys (key numbers) containing 2 elements can be randomly selected for encryption. Through the designed communication protocol, a 1-byte external equal division key number group frame is sent to the receiver.

[0006] The internal equal division point key actually represents the units digit of the floating-point data separation value data. For example, for the floating-point data 1234.5678, the separation values are 12, 34, 56, 78. The internal equal division points represent the values between 3 and 4, 7 and 8. This value is also reflected through the key. Since there are 10 internal equal division points, ten numbers from [0-9] and [a-f] are also extracted. Different sets of ten numbers are extracted to form 1 group, and a total of 256 groups are extracted. Each set of ten digits in this group respectively corresponds to the internal equal division points of each external equal division point, thus forming a group of keys (key numbers) containing 10 elements to achieve encryption. Through the designed communication protocol, a 1-byte internal equal division key number group frame is sent to the receiver.

[0007] The communication protocol is the underlying logic followed by both the sender and the receiver. In the present invention, two protocol methods, namely handshake and control, are adopted. The handshake protocol adopts the form of the sender continuously sending 3 handshake data frames at intervals. Its frame format is: frame header (2 bytes) + handshake instruction (1 byte) + external equal division key number (1 byte) + internal equal division key number (1 byte) + number of transmissions (1 byte) + frame tail (1 byte). When the receiver receives any one frame, it determines that the communication is established. The reply data frame format is: frame header (2 bytes) + handshake instruction (1 byte) + number of times sent to (1 byte) + frame tail (1 byte). If the handshake instruction is not received, the sender will send the handshake data frame again after 1 minute. The control protocol is to send the encrypted floating-point data according to a fixed frame format. Its frame format is: frame header (2 bytes) + externally equal division encrypted data before the decimal point (1 byte) + internally equal division encrypted data before the decimal point (1 byte) + externally equal division encrypted data after the decimal point (1 byte) + internally equal division encrypted data after the decimal point (1 byte) + frame tail (1 byte). After the receiver receives the data frame, on the one hand, it decrypts the data according to the internal and external equal division key numbers in the handshake protocol, and on the other hand, it replies with an instruction. Its instruction frame format is: frame header (2 bytes) + received count (1 byte) + frame tail (1 byte). The received count loops every 256 times. If the control feedback instruction is not received, the sender will send the control feedback data frame again after 1 minute.

[0008] Preferably, in the XXXX.XXXX type floating-point number encryption algorithm described above, the projective coordinate method is adopted. Through the equally divided points in the form of a key on the coordinate, after the floating-point data is projected onto the coordinate, its true value is reflected in the form of a key, and the key can be randomly changed, greatly increasing the difficulty of data deciphering.

[0009] Preferably, in the communication protocol described above, the three-way handshake protocol is adopted, which can ensure the accuracy of key replacement and the reliability of data encryption and decryption.

[0010] Compared with the prior art, the present invention has the following beneficial effects: A XXXX.XXXX type floating-point number encryption algorithm of the present invention adopts the method of projecting the data before and after the decimal point onto a specific XY coordinate system. The horizontal / vertical axis of the XY coordinate system is divided into inner and outer equally divided points, and these equally divided points correspond one by one to the common key of the sending and receiving parties, realizing the conversion from real data to a key. Through the replacement of the key in the handshake protocol, the receiving party can easily restore the real data according to the coordinate mapping, thus completing a specific task. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a schematic diagram of a XXXX.XXXX type floating-point number encryption algorithm of the present invention.

[0012] Figure 2 It is an example diagram of the floating-point number 7896.5432 encryption algorithm in the embodiment of the present invention.

[0013] Figure 3 It is an example encryption algorithm diagram of the floating-point number 5432 of the 7896.5432 type in the embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0014] Refer to Figure 1 , a XXXX.XXXX type floating-point number encryption algorithm of the present invention mainly separates the floating-point data and projects them onto the XY coordinate system respectively. After the XY horizontal and vertical coordinates are equally divided, the key is assigned to each inner and outer equally divided point, that is, the key replaces the true value of the data, thereby realizing data encryption, where: The separation is to divide the XXXX.XXXX type floating-point number into 2 groups of XY coordinate values, such as abcd.efgh, and divide it into coordinates (ab, cd) and (ef, gh), and project them onto the XY coordinate system respectively.

[0015] The external equal division point key actually represents the tens digit of the floating-point data separation value data. In the XY coordinate system, the XY axes are equally divided into ten intervals, and each interval is copied as a key to form the correspondence between the key and the true value. For example, for the floating-point data 1234.5678, the separation values are 12, 34, 56, 78. The external equal division points represent the values between 1 and 2, 5 and 6. The 1 and 5 represent the X-axis coordinate values, and the 2 and 6 represent the Y-axis coordinate values. Of course, this value is reflected by the key in the XY coordinate system. The key design randomly selects ten numbers from [0-9] and [a-f]. These ten numbers form the external equal division point keys for the X and Y axes, and are combined in pairs to form a group of keys. One element represents the external equal division point key for the X axis, and one represents the external equal division point key for the Y axis. A total of 256 groups are extracted. According to the program design, a group of keys (key number) containing 2 elements can be randomly selected for encryption. Projecting the values 12 and 34, 56 and 78 onto the XY coordinate system respectively, the corresponding external equal division point key numbers for the XY axes can be obtained. Through the designed communication protocol, a 1-byte external equal division key number is framed to form a handshake protocol and sent to the receiver; a 1-byte external equal division point key number is framed to form a control protocol and sent to the receiver.

[0016] The internal equal division point key actually represents the units digit of the floating-point data separation value data. The integer points in the coordinate system are represented by the internal equal division point key. For example, for the floating-point data 1234.5678, the separation values are 12, 34, 56, 78. The internal equal division points represent the values between 3 and 4, 7 and 8. The 3 and 7 represent the X-axis coordinate values, and the 4 and 8 represent the Y-axis coordinate values. This value is also reflected by the key. Since there are 10 internal equal division points, ten numbers from [0-9] and [a-f] are also selected. Twenty different numbers are extracted to form 1 group. Each ten numbers respectively represent the internal equal division point key numbers for the X and Y axes. A total of 256 groups are extracted. Each group of ten numbers in this group respectively corresponds to the internal equal division points of each external equal division point, thus forming a group of keys (key number) containing 20 elements to achieve encryption. Projecting the values 12 and 14, 16 and 18 onto the XY coordinate system respectively, the corresponding internal equal division point key numbers for the external equal division points of the XY axes can be obtained. Through the designed communication protocol, a 1-byte internal equal division key number is framed and sent to the receiver; a 1-byte internal equal division point key number is framed to form a control protocol and sent to the receiver.

[0017] The communication protocol is the underlying logic followed by both the sender and the receiver. In the present invention, two protocol methods, namely handshake and control, are adopted. The handshake protocol uses the form of the sender continuously sending 3 frames of handshake data frames at intervals. Its frame format is: frame header (2 bytes) + handshake command (1 byte) + external equal division key number (1 byte) + internal equal division key number (1 byte) + sending times (1 byte) + frame tail (1 byte). When the receiver receives any one frame, it determines that the communication is established. The reply data frame format is: frame header (2 bytes) + handshake command (1 byte) + times sent to (1 byte) + frame tail (1 byte). If the handshake command is not received, the sender will send the handshake data frame again after 1 minute. The control protocol sends the encrypted floating-point data according to a fixed frame format. Its frame format is: frame header (2 bytes) + external equal division encrypted data before the decimal point (1 byte) + internal equal division encrypted data before the decimal point (1 byte) + external equal division encrypted data after the decimal point (1 byte) + internal equal division encrypted data after the decimal point (1 byte) + frame tail (1 byte). After receiving the data frame, the receiver, on the one hand, decrypts the data according to the external and internal equal division key numbers in the handshake protocol, and on the other hand, replies with an instruction. Its instruction frame format is: frame header (2 bytes) + receive count (1 byte) + frame tail (1 byte), where the receive count cycles with 256 times. If the control feedback instruction is not received, the sender will send the control feedback data frame again after 1 minute.

[0018] Examples are Figure 2 and Figure 3, for example, the numerical data is 7896.5432. The key number of the outer equal division point is selected as the 3rd in 256 groups, which is [(2,3,4,5,6,7,8,9,0,1), (2,3,4,5,6,7,8,9,0,1)]. The key number of the inner equal division point is selected as the 1st in 256 groups. The first 10 represent the key numbers of the X-axis, and the last 10 represent the key numbers of the Y-axis, which are [(0,1,2,3,4,5,6,7,8,9),(1,2,3,4,5,6,7,8,9,0),(2,3,4,5,6,7,8,9,0,1),(3,4,5,6,7,8,9,0,1,2),(4,5,6,7,8,9,0,1,2,3),(5,6,7,8,9,0,1,2,3,4),(6,7,8,9,0,1,2,3,4,5),(7,8,9,0,1,2,3,4,5,6),(8,9,0,1,2,3,4,5,6,7),(9,0,1,2,3,4,5,6,7,8);(0,1,2,3,4,5,6,7,8,9),(1,2,3,4,5,6,7,8,9,0),(2,3,4,5,6,7,8,9,0,1),(3,4,5,6,7,8,9,0,1,2),(4,5,6,7,8,9,0,1,2,3),(5,6,7,8,9,0,1,2,3,4),(6,7,8,9,0,1,2,3,4,5),(7,8,9,0,1,2,3,4,5,6),(8,9,0,1,2,3,4,5,6,7),(9,0,1,2,3,4,5,6,7,8)]. After projection, 7896 becomes 90 64 in 2 bytes, and 5432 becomes 76 06 in 2 bytes. After the handshake and control protocols at the receiving end, the handshake protocol is ED 9003 01 01 FD, and the control protocol is ED 90 90 64 76 06 FD. Taking 90 and 64 as examples to illustrate the decryption process: For 90, look up the key number of the outer equal division point [(2,3,4,5,6,7,8,9,0,1), (2,3,4,5,6,7,8,9,0,1)]. The serial number of the numerical value 9 in element 1 is 7, and the serial number of the numerical value 0 in element 2 is 8, then it is restored to 78; For 64, look up the key number of the inner equal division point, find the element with the serial number 7 of the X inner equal division point key number and the element with the serial number 8 of the Y inner equal division point key number. Among them, the serial number of 6 in the element with the X serial number 7 is 9, and the serial number of 4 in the element with the Y serial number 8 is 6, then it is restored to 96. It can be seen that through the key number and the encrypted data, it is very convenient to restore 7896 and 5432 in the coordinate system.

[0019] In addition to the above embodiments, the present invention also includes other embodiments. Any technical solutions formed by equivalent transformation or equivalent substitution shall fall within the protection scope of the claims of the present invention.

Claims

1. A method for implementing a floating-point encryption algorithm, characterized in that: The method is to project floating-point data into the XY coordinate system. After equally dividing the XY horizontal and vertical coordinates, the secret key is assigned to each inner and outer equal division point, that is, the secret key replaces the true value of the data, so as to realize data encryption.

2. The implementation method of a floating-point number encryption algorithm according to claim 1, characterized in that: Mainly for floating-point data of the form abcd.efgh, the separated values of ab, cd, ef, and gh are used as a set of coordinate values and projected into the XY coordinate system. The horizontal and vertical axes of the XY coordinate system are equally divided into ten parts, which is called outer equal division. Among them, ab and ef are represented by outer equal division, and each outer equal division is further equally divided into ten parts, which is called inner equal division. Among them, cd and gh are represented by inner equal division points. The inner equal division and the outer equal division are combined into a set of random secret keys through the numbers 0-9 and the characters a-f. Finally, the floating-point data of the form abcd.efgh is transformed into the form of a secret key and sent out through a specific communication protocol.

3. The implementation method of a floating-point number encryption algorithm according to claim 2, characterized in that: The secret key of the outer equal division point represents the tens digit of the separated value data of the floating-point data, and the secret key of the inner equal division point represents the units digit of the separated value data of the floating-point data.

4. The implementation method of a floating-point encryption algorithm according to claim 2, characterized in that: The communication protocol is the underlying logic followed by both the sender and the receiver. It adopts two protocol methods: handshake and control. The handshake protocol adopts the form of the sender continuously sending 3 handshake data frames at intervals. The control protocol is to send the encrypted floating-point data in a fixed frame format.

5. The implementation method of a floating-point number encryption algorithm according to claim 4, characterized in that: The form of the handshake data frame is: 2-byte frame header + 1-byte handshake command + 1-byte outer equal division secret key number + 1-byte inner equal division secret key number + 1-byte sending times + 1-byte frame tail. When the receiver receives any frame, it is judged that the communication is established. The format of the reply data frame is: 2-byte frame header + 1-byte handshake command + 1-byte sending times + 1-byte frame tail. If the handshake command is not received, the sender will send the handshake data frame again after 1 minute.

6. The implementation method of a floating-point number encryption algorithm according to claim 4, characterized in that: The fixed frame format of the control protocol is: 2-byte frame header + 1-byte encrypted data of the outer equal division before the decimal point + 1-byte encrypted data of the inner equal division before the decimal point + 1-byte encrypted data of the outer equal division after the decimal point + 1-byte encrypted data of the inner equal division after the decimal point + 1-byte frame tail. After the receiver receives the data frame, on the one hand, it decrypts the data according to the outer and inner equal division secret key numbers in the handshake protocol, and on the other hand, it replies with an instruction. The format of its instruction frame is: 2-byte frame header + 1-byte receive count + 1-byte frame tail. The receive count cycles with 256 times. If the control feedback instruction is not received, the sender will send the control feedback data frame again after 1 minute.