Data encryption method, data decryption method and UDP (User Datagram Protocol) data transmission system

Through the dual encryption and random key generation methods, the high cost and complex integration problems of existing UDP transmission of audio and video data are solved, and high-security UDP data transmission is realized, reducing the cost of third-party encryption systems.

CN119276547APending Publication Date: 2025-01-07HUIZHOU WELLAV TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411316234.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Existing UDP encryption and decryption solutions for transmitting audio and video data usually rely on third-party DRM or CA systems, resulting in high cost and complex integration processes. Providing DRM/CA servers separately is expensive, increasing labor and time costs.

Method used

Using a data encryption method, the UDP data packet is double encrypted by generating the first key and the second key, randomly generate the key and combine the encrypted file with the random number to form the target UDP data packet, and perform it on the receiving end. Decryption, achieving one-secret encryption at a time and exponential encryption security.

Benefits of technology

It reduces the cost caused by third-party encryption systems, improves the encryption security of UDP data, is suitable for various UDP audio and video data transmission, and simplifies the encryption and decryption process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276547A_ABST
    Figure CN119276547A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of audio and video data processing, in particular to a data encryption method, a data decryption method and a UDP (User Datagram Protocol) data transmission system. Combining the encrypted first encrypted file, the encrypted second encrypted file and the random number into a target UDP data packet; data transmission is carried out through the target UDP data packet; according to the invention, the first key and the second key are randomly generated for each current UDP data packet, so that one-time pad is realized; and the encryption security of the UDP data can be improved in an exponential level through a two-time encryption mode. Meanwhile, only the first random string of the first secret key can be encrypted and transmitted, and even if the first random string is cracked violently in the middle, the complete first secret key cannot be obtained through decryption; and the encryption security of the UDP data is further improved. Through the encryption and decryption scheme provided by the invention, the price, labor and time costs caused by a third-party encryption system are greatly reduced, and the encryption and decryption scheme is suitable for various UDP audio and video data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of audio and video data processing, and in particular to a data encryption method, a data decryption method and a UDP data transmission system. Background Art

[0002] UDP is the User Datagram Protocol, a connectionless transport layer protocol in the OSI reference model, which provides simple, unreliable information transmission services for transactions. UDP is used to support network applications that need to transmit data between computers; many client / server network applications, including network video conferencing systems, need to use the UDP protocol.

[0003] There is no ready-made encryption method for traditional UDP transmission of audio and video data. The existing encryption and decryption solutions generally use third-party DRM or CA systems, which require docking and integration with third parties on the server and client, resulting in high prices, labor and time costs for third-party DRM or CA systems. At the same time, it is expensive to provide a DRM / CA server alone, which makes the encryption and decryption solution for UDP transmission of audio and video data costly. Summary of the invention

[0004] In view of the above problems, the present invention provides a data encryption method, a data decryption method and a UDP data transmission system, which are used to solve the problem that the encryption and decryption solutions in the prior art generally use a third-party DRM or CA system, which requires docking and integration with the third party on the server and client, resulting in high prices, labor and time costs for the third-party DRM or CA system. At the same time, it is expensive to provide a DRM / CA server alone, which makes the encryption and decryption solution for UDP transmission of audio and video data costly.

[0005] According to one aspect of an example of the present invention, there is provided a data encryption method, which is applied to a UDP data transmission system, and the method comprises: Pack audio and video data into the current UDP data packet; Encrypting the current UDP data packet using a first key and generating a first encrypted file; Encrypting the first key by using a second key and generating a second encrypted file, wherein the second key is generated according to a random number; The first encrypted file, the second encrypted file and a random number are combined to generate a target UDP data packet, and the target UDP data packet is output to a UDP data transmission system.

[0006] In some optional manners, the first key includes a first random string and a first fixed string; encrypting the current UDP data packet by using the first key and generating a first encrypted file specifically includes: Before encrypting the current UDP data packet, a first random string is generated by a random algorithm, wherein the random algorithm includes any one of a UUID generator generation algorithm, an md5 encryption real-time generation algorithm, and a random system api generation algorithm; Combining a first random string and a first fixed string to generate a first key, wherein the first fixed string is stored in the UDP data transmission system; Encrypt the current UDP data packet using an encryption algorithm using a first key to generate a first encrypted file; The encryption algorithm includes any one of AES algorithm, AES128 algorithm, AES256 algorithm, DES algorithm, 3DES algorithm, DESX algorithm, XOR encryption algorithm, and the like.

[0007] In some optional manners, the second key is generated according to the second random string, specifically including: Before encrypting the current UDP data packet, input the random number into the createRamKey function to generate a second random string; The second random string is combined with a second fixed string to generate a second key, wherein the second fixed string is stored in the UDP data transmission system.

[0008] In some optional manners, encrypting the first key by using the second key and generating a second encrypted file specifically includes: The first random string of the first key is encrypted by the second key through an encryption algorithm to generate a second encrypted file.

[0009] In some optional embodiments, the first random string, the first fixed string, the second random string, and the second fixed string are 8-byte data; and the second encrypted file is 16-byte data.

[0010] In some optional ways, combining the first encrypted file, the second encrypted file and the random number to generate a target UDP data packet specifically includes: The first encrypted file, the second encrypted file and the second random string are concatenated in order to form a target UDP data packet, wherein the target UDP data packet is added with bytes of the second encrypted file and the random number.

[0011] According to another aspect of an embodiment of the present invention, a data decryption method is provided, which is applied to a UDP data transmission system, and the method includes: Receive a target UDP data packet, and decrypt the target UDP data packet to generate a first encrypted file, a second encrypted file, and a random number; Generate a second key according to the random number, decrypt the second encrypted file using the second key, and generate a first key; The first encrypted file is decrypted according to the first key using an encryption algorithm to generate a current UDP data packet, wherein the encryption algorithm includes any one of an AES algorithm, an AES128 algorithm, an AES256 algorithm, a DES algorithm, a 3DES algorithm, a DESX algorithm, an XOR encryption algorithm, and the like.

[0012] In some optional ways, receiving a target UDP data packet, and decrypting the target UDP data packet to generate a first encrypted file, a second encrypted file, and a random number specifically includes: Extract the 8 bytes at the end of the target UDP data packet as a random number; The 9th to 24th bytes from the last byte of the target UDP data packet are advanced as the second encrypted file; The target UDP data packet is extracted and the 24 bytes at the end are removed to obtain the first encrypted file.

[0013] In some optional manners, generating a second key according to the random number, decrypting the second encrypted file by using the second key, and generating a first key specifically includes: The random function is processed by the createRamKey function to generate a second random string, and the second random string is combined with a second fixed string stored in the UDP data transmission system to generate a second key; The second encrypted file is decrypted by an encryption algorithm using a second key to generate a first random string, and the first random string is combined with a first fixed string stored in a UDP data transmission system to generate a first key.

[0014] According to another aspect of an embodiment of the present invention, a UDP data transmission system is provided, comprising a sending terminal and a receiving terminal, wherein the sending terminal and the receiving terminal both have a first fixed string and a second fixed string; the sending terminal is in communication connection with the receiving terminal; wherein, The sending terminal is provided with a program for executing the above-mentioned data encryption method; The receiving terminal is provided with a program for executing the above-mentioned data decryption method.

[0015] The present invention provides a data encryption method, a data decryption method and a UDP data transmission system, and its beneficial effects are: the present invention uses different first keys to encrypt the current UDP data packet, and then uses the second key to encrypt the first key, and synthesizes the encrypted first encrypted file, the second encrypted file and the random array into a target UDP data packet, and then transmits data through the target UDP data packet; the present invention randomly generates a first key and a second key for each current UDP data packet to achieve one-time one-key; the encryption security of UDP data can be exponentially improved by two encryption methods. At the same time, only the first random string of the first key can be encrypted and transmitted, and even if it is violently cracked in the middle, it cannot be decrypted to obtain the complete first key; so that the encryption security of UDP data is further improved. The encryption and decryption scheme of the present invention greatly reduces the price, labor and time costs caused by the third-party encryption system, and is suitable for various UDP audio and video data transmission.

[0016] The above description is only an overview of the technical solution of the example of the present invention. In order to more clearly understand the technical means of the embodiment of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the example of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present invention. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings: Figure 1 A schematic diagram showing a flow chart of a data encryption method according to Embodiment 1 of the present invention is shown; Figure 2 A schematic diagram showing a flow chart of a data decryption method according to Embodiment 2 of the present invention is shown; Figure 3 A schematic diagram showing the structure of a UDP data transmission system according to Embodiment 3 of the present invention is shown; Figure 4 A schematic diagram of the structure of a target UDP data packet provided by the present invention is shown. DETAILED DESCRIPTION

[0018] Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited to the embodiments set forth herein.

[0019] Embodiment 1: Figure 1An embodiment of a data encryption method of the present invention is shown, which is applied to a UDP data transmission system. The method is applied to a UDP sending terminal. The UDP data of the UDP data transmission system is encrypted and transmitted by the data encryption method. Specifically, the method includes: 110, packaging the audio and video data into the current UDP data packet; in step 110, after the audio and video data is generated or collected, the audio and video data is processed and converted into the current UDP data packet for storage and transmission. UDP data is data transmitted via the UDP protocol.

[0020] 120, encrypting the current UDP data packet by using a first key and generating a first encrypted file; in step 120, the first key includes a first random string and a first fixed string; encrypting the current UDP data packet by using the first key and generating a first encrypted file specifically includes: before encrypting the current UDP data packet, generating a first random string by using a random function; combining the first random string and the first fixed string to generate a first key, wherein the first fixed string is stored in the UDP data packet transmission system; encrypting the current UDP data packet by using the first key through AES128 to generate a first encrypted file.

[0021] 130, encrypting the first key by a second key and generating a second encrypted file, wherein the second key is generated according to a random number; in step 130, the second key is generated according to a second random string, specifically including: before encrypting the current UDP data packet, inputting the random number into a createRamKey function to generate a second random string; combining the second random string with a second fixed string to generate a second key, wherein the second fixed string is stored in the UDP data transmission system. The encrypting the first key by a second key and generating a second encrypted file specifically includes: encrypting the first random string of the first key by AES128 by the second key to generate a second encrypted file.

[0022] 140, combining the first encrypted file, the second encrypted file and the random number to generate a target UDP data packet, and outputting the target UDP data packet to the UDP data transmission system. In step 140, combining the first encrypted file, the second encrypted file and the random number to generate a target UDP data packet specifically includes: sequentially concatenating the first encrypted file, the second encrypted file and the second random string to form a target UDP data packet, wherein the target UDP data packet adds bytes of the second encrypted file and the random number.

[0023] The present invention uses different first keys to encrypt the current UDP data packet, and then uses the second key to encrypt the first key, and synthesizes the encrypted first encrypted file, the second encrypted file and the random array into a target UDP data packet; then transmits data through the target UDP data packet; the present invention randomly generates a first key and a second key for each current UDP data packet to achieve one-time one-key; the encryption security of UDP data can be exponentially improved by two encryption methods. At the same time, only the first random string of the first key can be encrypted and transmitted, and even if it is violently cracked in the middle, it cannot be decrypted to obtain the complete first key; so that the encryption security of UDP data is further improved. The encryption and decryption scheme of the present invention greatly reduces the price, labor and time costs caused by the third-party encryption system, and is suitable for various UDP audio and video data transmission.

[0024] In some optional ways, the audio and video data are packaged into the current UDP data packet; in this embodiment, to package the audio and video data into the current UDP data packet, the following steps can be used to implement: Initialize the UDP socket: First, a UDP socket needs to be created for data transmission. This can be done by calling DatagramSocket or using the socket() function. For example, in Java, the DatagramSocket class can be used to create a UDP socket; while in C / C++, the socket() function needs to be used and the protocol family AF_INET, the socket type SOCK_DGRAM and the protocol 0 need to be specified to create a UDP socket. Read the audio and video file: Next, the audio and video file needs to be read from the local. This can be done by using file I / O operations, such as using the File and Files.readAllBytes() methods in Java to read the file content; in C / C++, the file operation functions in the standard library can be used to read the file content. Encapsulate the data into a data packet: Encapsulate the read audio and video data into the current UDP data packet. This involves putting the data into a byte array and creating a DatagramPacket object or directly using the send and receive functions. For example, in Java, you can use a byte[] array to store data and use the DatagramPacket class to encapsulate it into a data packet; in C / C++, you can directly use the send and receive functions and pass the data as a parameter. Sending a data packet: Send the encapsulated data packet to the specified IP address and port via the UDP protocol. This can be done by calling the socket's send method, such as using the socket.send(packet) method in Java; in C / C++, you need to specify the target IP address and port and use the send function to send the data packet.

[0025] Through the above steps, the audio and video data can be packaged into UDP data packets and transmitted. This method is suitable for scenarios such as audio and video chat applications and video streaming transmission. The connectionless nature of UDP makes it suitable for application scenarios that require high-speed data transmission and do not care much about whether the data is fully arrived.

[0026] In some optional ways, the first key includes a first random string and a first fixed string; encrypting the current UDP data packet by using the first key and generating a first encrypted file specifically includes: Before encrypting the current UDP data packet, a first random string is generated by a random algorithm, wherein the random algorithm includes but is not limited to any one of a UUID generator generation algorithm, an md5 encryption real-time generation algorithm, and a random system api generation algorithm; the first random string and the first fixed string are combined to generate a first key, wherein the first fixed string is stored in the UDP data transmission system; the current UDP data packet is encrypted by an encryption algorithm using the first key to generate a first encrypted file; wherein the encryption algorithm includes but is not limited to any one of an AES algorithm, an AES128 algorithm, an AES256 algorithm, a DES algorithm, a 3DES algorithm, a DESX algorithm, an XOR encryption algorithm, and the like.

[0027] In this embodiment, the first key may be a KeyVideo key. KeyVideo consists of two parts, the first 8 bytes are the first random string randString1; the second 8 bytes are the first fixed string conString1 hard-coded in the program of the sending terminal and / or the receiving terminal; that is, keyVideo = randString1 + conString1. Before encryption, each current UDP data packet first randomly generates a randString1 string, and concatenates it with conString1 to form keyVideo, and then uses the key keyVideo to perform AES128 encryption on the video data in the current UDP data packet to obtain the first encrypted file encVideoData.

[0028] In some optional ways, the second key is generated according to the second random string, specifically including: before encrypting the current UDP data packet, inputting the random number into the createRamKey function to generate the second random string; combining the second random string with the second fixed string to generate the second key, wherein the second fixed string is stored in the UDP data transmission system. The first random string of the first key is encrypted by the second key through an encryption algorithm to generate a second encrypted file; wherein the encryption algorithm includes but is not limited to any one of the AES algorithm, AES128 algorithm, AES256 algorithm, DES algorithm, 3DES algorithm, DESX algorithm, XOR encryption algorithm, and the like.

[0029] In this embodiment, after encrypting a current UDP data packet each time, the first random string randString1 is encrypted by AES128 using the second key keyKey to obtain the encrypted second encrypted file encRandString1. Specifically, the first 8 bytes of keyKey are the dynamically generated second random string ramKey, and an algorithm function createRamKey(randString2) generates a new 8-byte second random string ramKey according to the random number randString2; the last 8 bytes are the second fixed string conString2, which is hard-coded in the program of the sending terminal and / or the receiving terminal; that is, keyKey = ramKey +conString2. Before encrypting each first random string randString1, a random number randString2 is randomly generated, and then createRamKey(randString2) is called to generate the second random string ramKey, and finally ramKey+conString2 are concatenated into keyKey, and then randString1 is encrypted.

[0030] In this embodiment, the first random string, the first fixed string, the second random string, and the second fixed string are 8-byte data; the second encrypted file is 16-byte data. After AES128 encryption, the first random string is converted from 8 bits to 16 bits, and the empty bits are filled with 0.

[0031] For some alternatives, see Figure 4, combining the first encrypted file, the second encrypted file and the random number to generate a target UDP data packet, specifically including: splicing the first encrypted file, the second encrypted file and the second random string in order to form a target UDP data packet, wherein the target UDP data packet adds bytes for the second encrypted file and the random number. Splice the encrypted encVideoData + encRandString1 + randString2 into a target UDP data packet, and then send it out. The entire UDP data packet increases by 24 bytes. For each UDP packet of 1316 bytes of video data, the increase in data size is negligible, which is convenient for transmission and storage.

[0032] Each current UDP data packet is encrypted once and for all, and each encryption uses a new first random string randString1 and a new random number randString2; keyVideo key transfer only transmits the first half of the dynamically changing key, and is AES128 encrypted. Even if it is brute-force cracked in the middle, it cannot be decrypted because the key is incomplete. Each randString1 encryption is also done once and for all, and a new ramKey is used for each encryption; keyKey key transfer also only transmits the first half of the random number randString2, and does not transmit ramKey, so keyKey transmission is relatively safe. Even if it is brute-force cracked in the middle, only the first half of the key can be obtained, and randString1 cannot be decrypted. Therefore, it is almost impossible to crack during the transmission process, unless the sending or receiving end program is binary decompiled, the createRamKey function algorithm is clarified, and conString1 and conString2 are decompiled. After the code is obfuscated and compiled and optimized, the difficulty is very high.

[0033] Embodiment 2: Figure 2 An embodiment of a data decryption method of the present invention is shown, which is applied to a UDP data transmission system. The method is applied to a UDP receiving terminal. The UDP data of the UDP data transmission system is decrypted and received by the data decryption method. Specifically, the method includes: 210, receiving a target UDP data packet, and decrypting the target UDP data packet to generate a first encrypted file, a second encrypted file and a random number; in step 210, receiving a target UDP data packet, and decrypting the target UDP data packet to generate a first encrypted file, a second encrypted file and a random number, specifically comprising: extracting the last 8 bytes of the target UDP data packet as a random number; advancing the 9th to 24th bytes from the last of the target UDP data packet as the second encrypted file; extracting the target UDP data packet excluding the last 24 bytes as the first encrypted file.

[0034] 220, generate a second key according to the random number, decrypt the second encrypted file by the second key, and generate a first key; in step 220, generate a second key according to the random number, decrypt the second encrypted file by the second key, and generate a first key, specifically including: processing the random function by the createRamKey function to generate a second random string, and combining the second random string with the second fixed string stored in the UDP data transmission system to generate a second key; perform AES128 decryption on the second encrypted file by the second key to generate a first random string, and combine the first random string with the first fixed string stored in the UDP data transmission system to generate a first key.

[0035] 230. Decrypt the first encrypted file using an encryption algorithm according to the first key to generate a current UDP data packet; wherein the encryption algorithm includes but is not limited to any one of an AES algorithm, an AES128 algorithm, an AES256 algorithm, a DES algorithm, a 3DES algorithm, a DESX algorithm, an XOR encryption algorithm, and the like.

[0036] In this embodiment, after receiving the target UDP data packet, the last 8 bytes of random number randString2 are taken, and the createRamKey(randString2) function is called to generate the first random string ramKey, and ramKey + conString2 are concatenated into the second key keyKey. The second key keyKey is used to perform AES128 decryption on the 9th to 24th bytes of data at the end of the target UDP data packet to obtain the first random string randString1, and then randString1 + conString1 are concatenated into the first key keyVideo. The first key keyVideo is used to perform AES128 decryption on the remaining first encrypted file of the target UDP data packet to obtain clear stream audio and video data.

[0037] The data decryption method of the present invention is used to prevent audio and video data from being stolen during transmission. The method is simple and easy to implement, has high encryption strength, can well protect the copyright of audio and video, and has good application value.

[0038] Embodiment 3: Figure 3 An embodiment of a UDP data transmission system of the present invention is shown, comprising a sending terminal 310 and a receiving terminal 320, wherein both the sending terminal 310 and the receiving terminal 320 have a first fixed string and a second fixed string; the sending terminal is in communication connection with the receiving terminal; wherein, The sending terminal 310 is provided with a program for executing the data encryption method described in Example 1; specifically, by executing 110 of Example 1, the audio and video data are packaged into a current UDP data packet; 120, the current UDP data packet is encrypted by a first key, and a first encrypted file is generated; 130, the first key is encrypted by a second key, and a second encrypted file is generated, wherein the second key is generated according to a random number; 140, the first encrypted file, the second encrypted file and the random number are combined to generate a target UDP data packet, and the target UDP data packet is output to the UDP data transmission system. Encryption of the current UDP data is realized.

[0039] The receiving terminal 320 is provided with a program for executing the data decryption method described in Example 2. Specifically, by executing 210 in Example 2, a target UDP data packet is received, and the target UDP data packet is decrypted to generate a first encrypted file, a second encrypted file and a random number; 220, a second key is generated according to the random number, and the second encrypted file is decrypted by the second key to generate a first key; 230, the first encrypted file is decrypted by AES128 according to the first key to generate current UDP data. It is used to realize the decryption of the target UDP data packet.

[0040] In addition, the sending terminal and the receiving terminal can be integrated into a communication device, and the communication device can have the sending and receiving functions at the same time. The first fixed string and the second fixed string can be specifically provided in the communication device. The present invention uses different first key pairs for UDP data packets, and then uses the second key to encrypt the first key, and synthesizes the encrypted first encrypted file, the second encrypted file and the random array into a target UDP data packet; then the data is transmitted through the target UDP data packet; the present invention randomly generates a first key and a second key for each current UDP data packet to achieve one-time one-key; the encryption security of UDP data can be exponentially improved by encrypting twice. At the same time, only the first random string of the first key can be encrypted and transmitted, and even if it is violently cracked in the middle, it cannot be decrypted to obtain the complete first key; so that the encryption security of UDP data is further improved. The encryption and decryption scheme of the present invention greatly reduces the price, labor and time costs caused by the third-party encryption system, and is suitable for various UDP audio and video data transmission.

[0041] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system or other device. In addition, the embodiments of the present invention are not directed to any particular programming language.

[0042] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. Similarly, in order to simplify the present invention and help understand one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. Wherein, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, wherein each claim itself is a separate embodiment of the present invention.

[0043] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and further may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive.

[0044] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

Claims

1. A data encryption method, characterized in that: Applied to a UDP data transmission system, the method comprises: Pack audio and video data into the current UDP data packet; Encrypting the current UDP data packet using a first key and generating a first encrypted file; Encrypting the first key by using a second key and generating a second encrypted file, wherein the second key is generated according to a random number; The first encrypted file, the second encrypted file and a random number are combined to generate a target UDP data packet, and the target UDP data packet is output to a UDP data transmission system.

2. The data encryption method according to claim 1, characterized in that: The first key includes a first random string and a first fixed string; the current UDP data packet is encrypted by the first key and a first encrypted file is generated, specifically including: Before encrypting the current UDP data packet, a first random string is generated by a random algorithm, wherein the random algorithm includes any one of a UUID generator generation algorithm, an md5 encryption real-time generation algorithm, and a random system api generation algorithm; Combining a first random string and a first fixed string to generate a first key, wherein the first fixed string is stored in the UDP data transmission system; Encrypt the current UDP data packet using an encryption algorithm using a first key to generate a first encrypted file; The encryption algorithm includes any one of AES algorithm, AES128 algorithm, AES256 algorithm, DES algorithm, 3DES algorithm, DESX algorithm, XOR encryption algorithm, and the like.

3. The data encryption method according to claim 2, characterized in that: The second key is generated according to the second random string, specifically including: Before encrypting the current UDP data packet, input the random number into the createRamKey function to generate a second random string; The second random string is combined with a second fixed string to generate a second key, wherein the second fixed string is stored in the UDP data transmission system.

4. The data encryption method according to claim 3, characterized in that: The step of encrypting the first key by using the second key and generating a second encrypted file specifically includes: The first random string of the first key is encrypted by the second key through an encryption algorithm to generate a second encrypted file.

5. The data encryption method according to claim 4, characterized in that: The first random string, the first fixed string, the second random string, and the second fixed string are 8-byte data; the second encrypted file is 16-byte data.

6. The data encryption method according to claim 5, characterized in that: The first encrypted file, the second encrypted file and the random number are combined to generate a target UDP data packet, specifically including: The first encrypted file, the second encrypted file and the second random string are concatenated in order to form a target UDP data packet, wherein the target UDP data packet is added with bytes of the second encrypted file and the random number.

7. A data decryption method, characterized in that: Applied to a UDP data transmission system, the method comprises: Receive a target UDP data packet, and decrypt the target UDP data packet to generate a first encrypted file, a second encrypted file, and a random number; Generate a second key according to the random number, decrypt the second encrypted file using the second key, and generate a first key; The first encrypted file is decrypted according to the first key using an encryption algorithm to generate a current UDP data packet, wherein the encryption algorithm includes any one of an AES algorithm, an AES128 algorithm, an AES256 algorithm, a DES algorithm, a 3DES algorithm, a DESX algorithm, an XOR encryption algorithm, and the like.

8. The data decryption method according to claim 7, characterized in that: Receiving a target UDP data packet, and decrypting the target UDP data packet to generate a first encrypted file, a second encrypted file, and a random number, specifically includes: Extract the 8 bytes at the end of the target UDP data packet as a random number; The 9th to 24th bytes from the last byte of the target UDP data packet are advanced as the second encrypted file; The target UDP data packet is extracted and the 24 bytes at the end are removed to obtain the first encrypted file.

9. The data decryption method according to claim 8, characterized in that: Generating a second key according to the random number, decrypting the second encrypted file by using the second key, and generating a first key specifically includes: The random function is processed by the createRamKey function to generate a second random string, and the second random string is combined with a second fixed string stored in the UDP data transmission system to generate a second key; The second encrypted file is decrypted by an encryption algorithm using a second key to generate a first random string, and the first random string is combined with a first fixed string stored in a UDP data transmission system to generate a first key.

10. A UDP data transmission system, characterized in that: It includes a sending terminal and a receiving terminal, and both the sending terminal and the receiving terminal have a first fixed string and a second fixed string; the sending terminal is in communication connection with the receiving terminal; wherein, The sending terminal is provided with a program for executing the data encryption method according to any one of claims 1 to 6; The receiving terminal is provided with a program for executing the data decryption method according to any one of claims 7 to 9.