Information steganography and extraction method and system based on food location in the snake game
By hiding information using food locations in Snake Games, combined with the design of embedded zones and buffers, the defects of existing steganography technology in terms of safety, capacity and robustness are solved, and more efficient and hidden information is achieved. transfer.
Patent Information
- Application Number
- CN202410326679.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-03-21
AI Technical Summary
Existing steganography technologies have flaws in terms of security, capacity and robustness, are difficult to resist advanced detection algorithms and tools, and may lead to information loss or errors, and key management also has challenges.
Using information steganography method based on the food location in the Snake game, by reading secret information and converting it into ASCII code, food is generated in the Snake game grid to hide information, and using a pre-trained game model to simulate players Operation, combining embedding zones and buffers to improve the concealment and capacity of steganography.
It improves the concealment and robustness of information transmission, avoids the failure of information transmission caused by different levels of human game, increases the capacity of secret information, and simplifies the information transmission process.
Smart Images

Figure CN118228214B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information security, and more specifically, to an information steganography and extraction method and system based on food positions in a snake game. Background Art
[0002] With the continuous advancement of technology and the popularization of the Internet, network security has gradually become the focus of public attention. In order to protect the privacy of sensitive data, steganography, as an information hiding technology, has been widely used in the field of encrypted communications. Traditional steganography usually hides information by making minor modifications to digital media files such as images, audio or video files. This practice relies on embedding secret information in the carrier without being easily detected directly.
[0003] However, existing steganography techniques face multiple challenges and drawbacks. First, with the development of image analysis and machine learning techniques, minor modifications in traditional steganography methods can be identified by advanced detection algorithms, which greatly reduces the security of hidden information. Second, existing methods often require direct modification of the original carrier file, which may trigger copyright or integrity issues in certain situations. In addition, traditional steganography has limited capacity when processing large amounts of data, especially in image and audio files, where too much information can cause significant damage to the carrier file and arouse suspicion.
[0004] In the modern network environment, methods of information hiding using digital media files are also at risk of being gradually detected and identified. Due to the continuous advancement and widespread availability of standard steganalysis and statistical detection methods, traditional steganographic methods are vulnerable to professional steganalysis tools. These tools can effectively identify patterns and anomalies in information hiding, thereby endangering the confidentiality of the hidden information.
[0005] In addition, the embedded information may be lost or wrong due to damage to the carrier file or transmission errors during the implementation of traditional steganography. At the same time, the management and distribution of keys may also become a problem, because improper key management can easily lead to information leakage.
[0006] In summary, the current social demand for privacy information protection and the limitations of existing technologies in terms of security, capacity, and robustness have given rise to the need for new steganographic methods. An ideal information hiding technology should be able to overcome these shortcomings and achieve more secure, hidden, and high-capacity secret information transmission. Summary of the invention
[0007] The present invention provides an information steganography and extraction method and system based on the food position in the snake game in order to reduce the possibility of information transmission exposure and increase the capacity of secret information that can be transmitted.
[0008] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0009] In the first aspect, the information steganography method based on the food position in the snake game includes the following steps:
[0010] S1. Read the secret information to be transmitted and store it in a data structure, convert the secret information character by character into the corresponding ASCII code, and arrange the ASCII codes into a queue;
[0011] S2, establish a grid background of the snake game, and read the ASCII codes in the queue in step S1 one by one, select positions in the game grid, and generate food at these positions to represent the corresponding ASCII codes in the secret information;
[0012] S3. After the food is placed, the pre-trained snake game model is used to simulate the behavior of the player operating the snake to hunt, and the snake game is played to eat the food;
[0013] S4. Repeat steps S2-S3 until all secret information is hidden by placing and eating food.
[0014] Furthermore, the snake game grid background includes an embedding area and a buffer area, wherein the embedding area is used to embed the secret information, and the buffer area is used to relieve the body blockage of the snake.
[0015] Furthermore, the grid background of the Snake game adopts a 24*24 grid layout, with a total of 576 positions for character presentation;
[0016] Among them, 480 positions are set as embedding areas for placing food corresponding to ASCII codes, and the snake consumes the food to present the content of the transmitted information character by character;
[0017] 96 positions are reserved as buffer areas to alleviate information congestion caused by the size of the snake.
[0018] Furthermore, the end position of the secret information is marked by a specific ASCII code, and the game terminates after the information transmission is completed, or switches to normal play mode to conceal the actual end point of the information transmission.
[0019] The second aspect is the information steganography system based on the location of food in the Snake game, including:
[0020] The information reading and processing module is used to read the secret information to be transmitted and store it in a data structure, convert the secret information character by character into the corresponding ASCII code, and arrange the ASCII codes into a queue;
[0021] A game grid generation module is used to establish a grid background for the snake game, and read the ASCII codes in the queue one by one, select positions in the game grid, and generate food at these positions to represent the corresponding ASCII codes in the secret information;
[0022] The snake simulation module is used to use the pre-trained snake game model to simulate the player's behavior of operating the snake to hunt, play the snake game and eat food;
[0023] The steganography control module is used to coordinate the game grid generation module and the snake simulation module to enable the secret information hiding process to proceed uninterruptedly until all the secret information is hidden through the placement and predation of food.
[0024] In a third aspect, based on the information extraction method of food position in the Snake game, hidden information is extracted from an image encoded by food distribution in the Snake game, specifically comprising the following steps:
[0025] R1, receiving a group of pictures of a Snake game interface, wherein the group of pictures hides secret information through the location of food;
[0026] R2, according to the size of the snake, the pictures in the received picture group are arranged in sequence numbers, and a picture group with a specific sequence number arrangement is sorted out;
[0027] R3, repeat the process of obtaining the ASCII value and serial number of a single image through the conversion rules and the specific serial number food position, until the ASCII values and corresponding serial numbers contained in all images are obtained;
[0028] R4. After obtaining the ASCII values and corresponding serial numbers contained in all images, sort the ASCII values from small to large according to the serial numbers to obtain complete information.
[0029] Furthermore, the grid background of the snake game includes an embedding area and a buffer zone, wherein the embedding area is used to embed the secret information, and the buffer zone is used to alleviate the body blockage of the snake; for the game picture containing food in the buffer zone in the incoming picture, it is automatically skipped and no sequence number is assigned, and the next game picture is processed.
[0030] Fourthly, the information extraction system based on the food location in the snake game includes:
[0031] A receiving module, used for receiving a group of pictures in the game interface of Snake, wherein the group of pictures hides secret information through the location of food;
[0032] A serialization processing module is used to arrange the pictures in the received picture group by serial number according to the size of the snake, and to sort out a picture group with a specific serial number arrangement;
[0033] The information decoding module is used to repeatedly obtain the ASCII value and serial number of a single image through the conversion rules and the specific serial number food position, until the ASCII values and corresponding serial numbers contained in all images are obtained;
[0034] The information reconstruction module is used to obtain the ASCII values and corresponding serial numbers contained in all pictures, and then sort the ASCII values from small to large according to the serial numbers to obtain complete information.
[0035] Furthermore, the information extraction system also includes a data management module for managing all data involved in the information extraction system.
[0036] A fifth aspect is an electronic device, comprising:
[0037] at least one processor; and
[0038] a memory communicatively coupled to the at least one processor;
[0039] The memory stores one or more computer programs executed by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the aforementioned information steganography method or the aforementioned information extraction method.
[0040] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0041] 1. Different from the traditional steganography method, the present invention embeds the corresponding information in different positions, so the attacker will not judge the secret information based on the abnormality of the underlying content of the transmitted data. This method greatly improves the concealment of the secret information transmission;
[0042] 2. The present invention uses an artificial intelligence model to complete the game, and only uses secret information to control the location of food, which avoids the consequence that secret information cannot be transmitted due to different levels of human gaming, and improves the robustness of information transmission;
[0043] 3. The simple and easy-to-understand game rules and information conversion rules of the present invention make it easier for both parties of information transmission to cooperate and transfer information, which has the advantage of convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 It is a schematic diagram of the steps of the information steganography method of the present invention;
[0046] Figure 2 It is a schematic diagram of the steps of the information extraction method of the present invention;
[0047] Figure 3 A schematic diagram of an embedded area and a buffer zone in a grid background of a snake game in the present invention;
[0048] Figure 4 It is a schematic diagram of the principle of reading and processing secret information in the present invention;
[0049] Figure 5 It is a specific flow chart of the information hiding process of the present invention;
[0050] Figure 6 It is a specific flowchart of the information extraction process of the present invention. DETAILED DESCRIPTION
[0051] In order to better understand the purpose, structure and function of the present invention, the technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific preferred embodiments.
[0052] In the description of the present invention, it should be understood that the terms "left side", "right side", "upper part", "lower part", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. "First", "second", etc. do not indicate the importance of the parts, and therefore cannot be understood as a limitation on the present invention. The specific dimensions used in the embodiments are only for illustrating the technical solution and do not limit the scope of protection of the present invention. It is understandable to those skilled in the art that some well-known structures and their descriptions in the drawings may be omitted.
[0053] Unless otherwise clearly specified and limited, the terms "install", "set", "connect", "fix" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0054] Embodiment 1:
[0055] like Figure 1As shown, the present invention provides a technical solution: an information steganographic method based on the food position in the snake game, comprising the following steps:
[0056] S1. Read the secret information to be transmitted and store it in a data structure, convert the secret information character by character into the corresponding ASCII code, and arrange the ASCII codes into a queue;
[0057] S2, establish a grid background of the snake game, and read the ASCII codes in the queue in step S1 one by one, select positions in the game grid, and generate food at these positions to represent the corresponding ASCII codes in the secret information;
[0058] S3. After the food is placed, the pre-trained snake game model is used to simulate the behavior of the player operating the snake to hunt, and the snake game is played to eat the food;
[0059] S4. Repeat steps S2-S3 until all secret information is hidden by placing and eating food.
[0060] The technical solution of this embodiment implements a steganographic method based on the position construction of the Snake game, is committed to ensuring the security of transmitted information, and improving the capacity of secret information transmitted by a single confidential object.
[0061] Unlike traditional steganography that modifies the image data content, this embodiment does not modify any data of the transmitted image, but transmits the corresponding information through the position in the game image. The use of ASCII to transmit information not only enhances the richness of the secret information, but also reduces the number of transmitted images compared to binary code transmission, thereby enhancing concealment.
[0062] Embodiment 2:
[0063] Based on Example 1, Figure 3 The snake game grid background includes an embedding area and a buffer zone, wherein the embedding area is used to embed the secret information, and the buffer zone is used to relieve the body blockage of the snake.
[0064] Furthermore, the grid background of the Snake game adopts a 24*24 grid layout, with a total of 576 positions for character presentation;
[0065] Among them, 480 positions are set as embedding areas for placing food corresponding to ASCII codes, and the snake consumes the food to present the content of the transmitted information character by character;
[0066] 96 positions are reserved as buffer areas to alleviate information congestion caused by the size of the snake.
[0067] Furthermore, the end position of the secret information is marked by a specific ASCII code, and the game terminates after the information transmission is completed, or switches to normal play mode to conceal the actual end point of the information transmission.
[0068] Specifically, a 24*24 snake game grid background is used, so that 576 characters can be transmitted. A total of 96 characters from ASCII 32 to 127 are selected to construct secret information. The 127th bit (DEL) in the ASCII character is set as the end bit, so that each character can be constructed 5 times. 480 positions are selected to place characters, a total of 480 bits, and the remaining 96 empty positions can be placed in the game grid background to avoid the situation where all target letters are obscured due to the large size of the snake. The 96 empty positions are called buffer areas, which can alleviate the blockage of the snake's body size. The specific grid background containing ASCII information is constructed as follows: Figure 3 As shown, at the same time, in order to prevent human game players from ending the game before the information is embedded due to inconsideration, we introduce an artificial intelligence game model to simulate the game, which only requires controlling the position of the food according to the secret information.
[0069] Embodiment 3:
[0070] The present invention provides a technical solution: an information steganographic system based on the location of food in the Snake game, comprising:
[0071] The information reading and processing module is used to read the secret information to be transmitted and store it in a data structure, convert the secret information character by character into the corresponding ASCII code, and arrange the ASCII codes into a queue;
[0072] A game grid generation module is used to establish a grid background for the snake game, and read the ASCII codes in the queue one by one, select positions in the game grid, and generate food at these positions to represent the corresponding ASCII codes in the secret information;
[0073] The snake simulation module is used to use the pre-trained snake game model to simulate the player's behavior of operating the snake to hunt, play the snake game and eat food;
[0074] The steganography control module is used to coordinate the game grid generation module and the snake simulation module to enable the secret information hiding process to proceed uninterruptedly until all the secret information is hidden through the placement and predation of food.
[0075] With the increasing degree of social entertainment, online electronic games have gradually entered the lives of most people. As a traditional game, the Snake game has always occupied a place in online electronic games. Using the Snake game to transmit information not only reduces the possibility of exposure of information transmission, but the larger space of the game also increases the capacity for transmitting secret information.
[0076] Embodiment 4:
[0077] like Figure 2 As shown, the present invention provides a technical solution: based on the information extraction method of food position in the snake game, hidden information is extracted from the image encoded by the food distribution of the snake game, which specifically includes the following steps:
[0078] R1, receiving a group of pictures of a Snake game interface, wherein the group of pictures hides secret information through the location of food;
[0079] R2, according to the size of the snake, the pictures in the received picture group are arranged in sequence numbers, and a picture group with a specific sequence number arrangement is sorted out;
[0080] R3, repeat the process of obtaining the ASCII value and serial number of a single image through the conversion rules and the specific serial number food position, until the ASCII values and corresponding serial numbers contained in all images are obtained;
[0081] R4. After obtaining the ASCII values and corresponding serial numbers contained in all images, sort the ASCII values from small to large according to the serial numbers to obtain complete information.
[0082] Furthermore, the grid background of the snake game includes an embedding area and a buffer zone, wherein the embedding area is used to embed the secret information, and the buffer zone is used to alleviate the body blockage of the snake; for the game picture containing food in the buffer zone in the incoming picture, it is automatically skipped and no sequence number is assigned, and the next game picture is processed.
[0083] Specifically, by reading the incoming Snake game image and the location where food appears in each event segment, the information receiver can compare the corresponding ASCII information grid to obtain the transmitted information. If food appears in the cache area, it will be ignored. From the beginning to the end of the game, the information brought by each location where food appears is read and combined to obtain the entire secret message.
[0084] Embodiment 5:
[0085] The present invention provides a technical solution: an information extraction system based on the food position in the snake game, comprising:
[0086] A receiving module, used for receiving a group of pictures in the game interface of Snake, wherein the group of pictures hides secret information through the location of food;
[0087] A serialization processing module is used to arrange the pictures in the received picture group by serial number according to the size of the snake, and to sort out a picture group with a specific serial number arrangement;
[0088] The information decoding module is used to repeatedly obtain the ASCII value and serial number of a single image through the conversion rules and the specific serial number food position, until the ASCII values and corresponding serial numbers contained in all images are obtained;
[0089] The information reconstruction module is used to obtain the ASCII values and corresponding serial numbers contained in all pictures, and then sort the ASCII values from small to large according to the serial numbers to obtain complete information.
[0090] Furthermore, the information extraction system also includes a data management module for managing all data involved in the information extraction system.
[0091] Embodiment 6:
[0092] The present invention provides a technical solution: an electronic device, comprising:
[0093] at least one processor; and
[0094] a memory communicatively coupled to the at least one processor;
[0095] The memory stores one or more computer programs executed by the at least one processor, and the one or more computer programs are executed by the at least one processor so that the at least one processor can execute the aforementioned information steganography method or the aforementioned information extraction method.
[0096] Working principle:
[0097] The present invention uses the Snake game and the reinforcement learning Snake model to transmit secret information. First, a model for playing the Snake game needs to be pre-trained by reinforcement learning. On this basis, the information to be transmitted is hidden and extracted. It is specifically divided into two parts: information hiding and information extraction. The use of the two parts will be specifically introduced below:
[0098] 1. Information hiding part:
[0099] 1. Read and process secret information: read the information that the user needs to encrypt, store it in a text, decompose it into individual ASCII format, and put it into the queue for word reading. Figure 4 shown.
[0100] 2. Placement of game food: Read the first ASCII code in the queue and select the corresponding information table. There will be a total of 4 corresponding positions for the game. If the size of the game is expanded, there will be more positions. The present invention takes 4 positions as an example and uses Formula 1 as the basis for placing food, where i is the game information embedding index coordinate, p is the placement of food, s is the secret information to be hidden, and e is the current game status:
[0101] p=f(s|e)(1)
[0102] First, observe the state of the game. For all places occupied by the snake, set their status codes to 1, and the status codes of other unoccupied places to 0, and get the corresponding e i , in the corresponding game state, select the food placement location that meets the embedding conditions according to the specific information, and randomly select one of them to place the food. The specific information hiding process is as follows Figure 5 shown.
[0103] 3. Game model plays the game: After the food is placed, the pre-trained snake game model plays the game and eats the food.
[0104] 4. Repeat steps 2 and 3: place food and have the game model play the game.
[0105] 5. Use of buffer: In some cases, the characters to be embedded may be occupied in all four positions. In this case, food is placed randomly in the buffer area.
[0106] 2. Information extraction part:
[0107] 1. The information receiving program receives the picture group sent by the other party.
[0108] 2. Arrange the received picture groups according to the size of the snake (the smaller the snake, the smaller the number), and sort out the picture groups with specific number arrangements.
[0109] 3. Through the conversion rules and the position of specific serial numbered foods, the program can derive the ASCII value and serial number to be transmitted by a single image. Repeat this process to obtain the ASCII values and corresponding serial numbers contained in all image groups.
[0110] 4. According to all ASCII values and corresponding serial numbers, the information receiving program sorts the corresponding ASCII values from small to large according to the serial numbers to obtain complete information. The specific information extraction process is as follows: Figure 6 shown.
[0111] 5. For game images that contain food in the buffer, the program will automatically skip them and not assign a sequence number, and continue processing the next game image.
[0112] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. Information steganography method based on the location of food in the snake game, It is characterized in that The following steps are involved: S1. Read the secret information to be transmitted and store it in a data structure, convert the secret information character by character into the corresponding ASCII code, and arrange the ASCII codes into a queue; S2, establish a grid background of the snake game, and read the ASCII codes in the queue in step S1 one by one, select positions in the game grid, and generate food at these positions to represent the corresponding ASCII codes in the secret information; S3. After the food is placed, the pre-trained snake game model is used to simulate the behavior of the player operating the snake to hunt, play the snake game and eat the food; S4, repeating steps S2-S3 until all secret information is hidden by placing and eating food; The snake game grid background includes an embedding area and a buffer area, wherein the embedding area is used to embed the secret information, and the buffer area is used to relieve the body blockage of the snake; The grid background of the Snake game adopts a 24*24 grid layout, with a total of 576 positions for character presentation; Among them, 480 positions are set as embedding areas for placing food corresponding to ASCII codes, and the snake consumes the food to present the content of the transmitted information character by character; 96 positions are reserved as buffer areas to alleviate information congestion caused by the size of the snake.
2. The information steganography method based on the food position in the snake game according to claim 1, It is characterized in that The end position of the secret information is marked by an ASCII code. After the information transmission is completed, the game ends, or enters the normal play mode to conceal the actual end point of the information transmission.
3. Information steganography system based on the location of food in the Snake game, It is characterized in that include: The information reading and processing module is used to read the secret information to be transmitted and store it in a data structure, convert the secret information character by character into the corresponding ASCII code, and arrange the ASCII codes into a queue; A game grid generation module is used to establish a grid background for the snake game, and read the ASCII codes in the queue one by one, select positions in the game grid, and generate food at these positions to represent the corresponding ASCII codes in the secret information; The snake simulation module is used to use the pre-trained snake game model to simulate the player's behavior of operating the snake to hunt, play the snake game and eat food; A steganography control module, used for coordinating the game grid generation module and the snake simulation module, so that the process of hiding secret information is carried out uninterruptedly until all secret information is hidden through the placement and predation of food; The snake game grid background includes an embedding area and a buffer area, wherein the embedding area is used to embed the secret information, and the buffer area is used to relieve the body blockage of the snake; The grid background of the Snake game adopts a 24*24 grid layout, with a total of 576 positions for character presentation; Among them, 480 positions are set as embedding areas for placing food corresponding to ASCII codes, and the snake consumes the food to present the content of the transmitted information character by character; 96 positions are reserved as buffer areas to alleviate information congestion caused by the size of the snake.
4. Information extraction method based on food location in the snake game, It is characterized in that Extracting hidden information from an image encoded by the distribution of food in the snake game includes the following steps: R1, receiving a group of pictures of a Snake game interface, wherein the group of pictures hides secret information through the location of food; R2, according to the size of the snake, the pictures in the received picture group are arranged in sequence numbers to sort out a picture group with sequence numbers; R3, repeat the process of obtaining the ASCII value and serial number of a single image through the conversion rules and the serial number food position, until the ASCII values and corresponding serial numbers contained in all images are obtained; R4. After obtaining the ASCII values and corresponding serial numbers of all images, sort the ASCII values from small to large according to the serial numbers to obtain complete information; The grid background of the snake game includes an embedding area and a buffer area, wherein the embedding area is used to embed the secret information, and the buffer area is used to relieve the body blockage of the snake; for the game picture containing food in the buffer area in the incoming picture, it is automatically skipped and no sequence number is assigned, and the next game picture is processed.
5. Information extraction system based on food location in the Snake game, It is characterized in that include: A receiving module, used for receiving a group of pictures in the game interface of Snake, wherein the group of pictures hides secret information through the location of food; A serialization processing module is used to arrange the pictures in the received picture group by serial number according to the size of the snake, and sort out a picture group with serial number arrangement; The information decoding module is used to repeatedly obtain the ASCII value and serial number of a single image through the conversion rules and the serial number food position, until the ASCII values and corresponding serial numbers contained in all images are obtained; The information reconstruction module is used to obtain the ASCII values and corresponding serial numbers contained in all pictures, and then sort the ASCII values from small to large according to the serial numbers to obtain complete information; The grid background of the snake game includes an embedding area and a buffer area, wherein the embedding area is used to embed the secret information, and the buffer area is used to relieve the body blockage of the snake; For the game pictures that contain food in the buffer area in the incoming pictures, they are automatically skipped and not assigned with serial numbers, and the next game picture is processed.
6. The information extraction system based on the food position in the snake game according to claim 5, It is characterized in that The information extraction system also includes a data management module for managing all data involved in the information extraction system.
7. An electronic device, It is characterized in that include: at least one processor; as well as a memory communicatively coupled to the at least one processor; Wherein, the memory stores one or more computer programs executed by the at least one processor, and one or more of the computer programs are executed by the at least one processor so that the at least one processor can execute the information steganography method as described in any one of claims 1-2, or the information extraction method as described in claim 4.
