Data processing method and device

By converting the sensitive information that needs to be protected in mobile applications into target values ​​of RGB color space and generating redundantly filled target pictures, the security risks brought about by the plaintext storage of sensitive information in mobile applications are solved and the reliability of encryption is improved.

CN114692187BActive Publication Date: 2025-03-28中国邮政储蓄银行股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210375834.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2025-03-28
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

In the development of mobile application programs, sensitive information (such as communication interaction keys and client private keys) that need to be stored in plain text poses a major security risk, and the existing technology has failed to effectively protect these key information.

Method used

By converting the original character information into the target value in the RGB color space, an initial picture is generated based on the target value, and redundantly fill the initial picture to obtain the target picture, thereby encrypting the original character information.

Benefits of technology

It improves the encryption reliability of sensitive information, prevents security risks caused by plain text storage, and realizes effective protection of sensitive information in mobile applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692187B_ABST
    Figure CN114692187B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method and a device thereof. The method comprises: obtaining original character information, wherein the original character information is character information corresponding to the original text; obtaining the original character information and a target value corresponding to a random value, wherein the target value is represented by a predetermined number of color component values; obtaining an initial image corresponding to the original character information based on a valid pixel block corresponding to the target value; performing redundant padding on the initial image to obtain a target image corresponding to the original character information, so as to encrypt the original character information. The present invention solves the technical problem in the related art that the reliability of the encryption method for some information that needs to be stored in plain text during the development of mobile applications is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular to a data processing method and a device thereof. Background Art

[0002] In the field of mobile application development, there is usually some information that needs to be stored in the engineering code in plain text. This information may include sensitive content such as communication interaction keys, client private keys assigned by third-party platforms, etc. For industries with high confidentiality such as banking, military industry, and government, these plain text stored keys obviously pose a great security risk; and in the existing technology, usually only encryption protection is provided for the network communication process and the message itself, while ignoring the effective protection of the key information used for encryption and decryption.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiment of the present invention provides a data processing method and device thereof, so as to at least solve the technical problem in the related art that in the process of developing mobile application programs, the reliability of encrypting some information that needs to be stored in plain text is low.

[0005] According to one aspect of an embodiment of the present invention, there is provided a data processing method, comprising: obtaining original character information, wherein the original character information is character information corresponding to an original text; obtaining a target value corresponding to the original character information and a random value, wherein the target value is represented by a predetermined number of color component values; obtaining an initial image corresponding to the original character information based on a valid pixel block corresponding to the target value; performing redundant padding on the initial image to obtain a target image corresponding to the original character information, so as to encrypt the original character information.

[0006] Optionally, before obtaining the original character information and the target value corresponding to the random value, the data processing method also includes: generating a first mapping code table, wherein the first mapping code table includes the target value; wherein generating the first mapping code table includes: generating a second mapping code table based on a predetermined character set and a decimal value corresponding to the predetermined character set; re-editing the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0007] Optionally, obtaining the original character information and the target value corresponding to the random value includes: searching for the decimal value corresponding to each original character in the original character information in the first mapping code table to obtain a search result; salting the random value to obtain a mixed salt value corresponding to the random value; and converting the sum of the values ​​corresponding to the search result and the mixed salt value to the target value in the RGB color space.

[0008] Optionally, the random value ranges from 0 to 129.

[0009] Optionally, obtaining an initial image corresponding to the original character information based on the valid pixel block corresponding to the target value includes: determining a theme color of the initial image in an RGB color space; determining a color component of the theme color and a color component of a non-theme color in the RGB color space; determining the target value based on the color component of the theme color and the color component of the non-theme color; obtaining the valid pixel block based on the target value; and generating the initial image according to the valid pixel block.

[0010] Optionally, determining the target value based on the color component of the theme color and the color component of the non-theme color includes: determining a color value difference threshold of the initial image and a standard value of the color component of the non-theme color; and determining the target value based on the color value difference threshold, the standard value, and the color component of the non-theme color.

[0011] Optionally, the initial image is redundantly filled to obtain a target image corresponding to the original character information, including: determining an initial image size of the initial image based on the original character information; performing redundant processing on the initial image size to obtain a target size of the initial image; generating an invalid pixel block based on the valid pixel block and the target size; and filling a blank area of ​​the initial image with the invalid pixel block to obtain the target image.

[0012] According to another aspect of an embodiment of the present invention, there is also provided a data processing method, including: obtaining a target image, wherein the target image is an image obtained by performing redundant padding on an initial image; determining a target value corresponding to a valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values; parsing original character information based on the target value; and obtaining original text based on the original character information.

[0013] Optionally, determining a target value corresponding to a valid pixel block in the initial picture includes: acquiring a picture size of the target picture; reading the initial picture in the target picture based on the picture size; and determining the target value based on the initial picture.

[0014] Optionally, determining the target value based on the initial image includes: reading color component values ​​of the valid pixel block in the RGB color space from the initial image; determining a theme color of the initial image in the RGB color space; determining the initial image from the target image based on color components corresponding to the theme color and a standard value, wherein the standard value is a value determined based on a color value difference threshold of the initial image and a color component of a non-theme color; and determining the target value based on the color value difference threshold, the standard value, and the color component of the non-theme color.

[0015] Optionally, parsing the original character information based on the target value includes: searching for a salt value pixel block where a salt value is located in the target image; obtaining the salt value from the salt value pixel block; desalting the target value to obtain a decimal value; and searching for the original character information corresponding to the decimal value in a first mapping code table.

[0016] Optionally, before searching for the original character information corresponding to the decimal value in the first mapping code table, the method also includes: generating a first mapping code table, wherein the first mapping code table includes the target value; wherein generating the first mapping code table includes: generating a second mapping code table based on a predetermined character set and the decimal value corresponding to the predetermined character set; and re-editing the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0017] According to another aspect of an embodiment of the present invention, a data processing device is also provided, including: a first acquisition unit, used to acquire original character information, wherein the original character information is character information corresponding to an original text; a second acquisition unit, used to acquire the original character information and a target value corresponding to a random value, wherein the target value is represented by a predetermined number of color component values; a third acquisition unit, used to obtain an initial image corresponding to the original character information based on a valid pixel block corresponding to the target value; and an encryption unit, used to perform redundant padding on the initial image to obtain a target image corresponding to the original character information, so as to encrypt the original character information.

[0018] Optionally, the device also includes: a first generating unit, used to generate a first mapping code table before obtaining the original character information and the target value corresponding to the random value, wherein the first mapping code table includes the target value; wherein the first generating unit includes: a first generating module, used to generate a second mapping code table based on a predetermined character set and a decimal value corresponding to the predetermined character set; a first editing module, used to re-edit the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0019] Optionally, the second acquisition unit includes: a first search module, used to search for the decimal value corresponding to each original character in the original character information in the first mapping code table to obtain a search result; a salting module, used to salt the random value to obtain a mixed salt value corresponding to the random value; and a conversion module, used to convert the sum of the values ​​corresponding to the search result and the mixed salt value into the target value in the RGB color space.

[0020] Optionally, the random value ranges from 0 to 129.

[0021] Optionally, the third acquisition unit includes: a first determination module, used to determine the theme color of the initial image in the RGB color space; a second determination module, used to determine the color components of the theme color and the color components of the non-theme colors in the RGB color space; a third determination module, used to determine the target value based on the color components of the theme color and the color components of the non-theme colors; a first acquisition module, used to obtain the valid pixel block based on the target value; and a second generation module, used to generate the initial image based on the valid pixel block.

[0022] Optionally, the third determination module includes: a first determination submodule, used to determine a color value difference threshold of the initial image and a standard value of a color component of the non-theme color; and a second determination submodule, used to determine the target value based on the color value difference threshold, the standard value and the color component of the non-theme color.

[0023] Optionally, the encryption unit includes: a fourth determination module, used to determine the initial image size of the initial image based on the original character information; a redundancy processing module, used to perform redundant processing on the initial image size to obtain a target size of the initial image; a third generation module, used to generate an invalid pixel block based on the valid pixel block and the target size; an encryption module, used to fill the blank area of ​​the initial image with the invalid pixel block to obtain the target image.

[0024] According to another aspect of an embodiment of the present invention, a data processing device is also provided, including: a fourth acquisition unit, used to acquire a target image, wherein the target image is an image obtained after redundant padding of an initial image; a determination unit, used to determine a target value corresponding to a valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values; a parsing unit, used to parse out original character information based on the target value; and a fifth acquisition unit, used to obtain original text based on the original character information.

[0025] Optionally, the determination unit includes: a second acquisition module, used to acquire the image size of the target image; a reading module, used to read the initial image in the target image based on the image size; and a fifth determination module, used to determine the target value based on the initial image.

[0026] Optionally, the fifth determination module includes: a reading submodule, used to read the color component value of the valid pixel block in the RGB color space from the initial image; a third determination submodule, used to determine the theme color of the initial image in the RGB color space; a fourth determination submodule, used to determine the initial image from the target image based on the color component corresponding to the theme color and a standard value, wherein the standard value is a value determined based on a color value difference threshold of the initial image and a color component of a non-theme color; a fifth determination submodule, used to determine the target value based on the color value difference threshold, the standard value, and the color component of the non-theme color.

[0027] Optionally, the parsing unit includes: a second search module, used to search for a salt value pixel block where the salt value is located in the target image; a third acquisition module, used to obtain the salt value from the salt value pixel block; a desalting module, used to desalt the target value to obtain a decimal value; and a second search module, used to search for original character information corresponding to the decimal value in the first mapping code table.

[0028] Optionally, the data processing device also includes: a second generating unit, used to generate a first mapping code table before searching the first mapping code table for the original character information corresponding to the decimal value, wherein the first mapping code table includes the target value; wherein the second generating unit includes: a fourth generating module, used to generate a second mapping code table based on a predetermined character set and the decimal value corresponding to the predetermined character set; a second editing module, used to re-edit the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0029] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned data processing methods.

[0030] According to another aspect of an embodiment of the present invention, a processor is provided, wherein the processor is used to run a computer program, wherein the computer program executes any one of the above-mentioned data processing methods when running.

[0031] In an embodiment of the present invention, original character information is obtained, wherein the original character information is character information corresponding to the original text; the original character information and the target value corresponding to the random value are obtained, wherein the target value is represented by a predetermined number of color component values; an initial image corresponding to the original character information is obtained based on the valid pixel block corresponding to the target value; the initial image is redundantly filled to obtain the target image corresponding to the original character information, so as to encrypt the original character information. The data processing method provided by the embodiment of the present invention realizes the purpose of decrypting the image obtained after the original text is converted to obtain the original text, and the opposite logic is used for processing during decryption to improve the reliability of encryption and decryption, thereby solving the technical problem of low reliability of the encryption method for some information that needs to be stored in plain text during the development of mobile applications in the related art. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0033] Figure 1 is a logic diagram of a data processing method according to an embodiment of the present invention;

[0034] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention;

[0035] Figure 3 is a schematic diagram of an ASCII code table according to an embodiment of the present invention;

[0036] Figure 4 is a flow chart of an optional data processing method according to an embodiment of the present invention;

[0037] Figure 5 is a flowchart of another optional data processing method according to an embodiment of the present invention;

[0038] Figure 6is a flowchart of another optional data processing method according to an embodiment of the present invention;

[0039] Figure 7 is a schematic diagram of a data processing device according to an embodiment of the present invention;

[0040] Figure 8 is a schematic diagram of an optional data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0042] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0043] In response to the above technical problems, the related technologies also mention that in order to avoid the restriction on input characters in the input box in the mobile application, the input content is converted into a picture for display. However, the direction of its solution is different from the direction of the solution provided by the present invention. There is also a method of converting the privacy picture to be protected into an encrypted string for storage, and then converting it into a picture after decrypting the string for display. The working process of the solution recorded in the present invention is opposite, and this method converts the picture into a binary stream first and then appends it as a string, while the solution of the present invention is to convert the string into RGB color value after transcoding, which is essentially different.

[0044] In an embodiment of the present invention, a data processing method is provided, that is, a scheme based on the conversion between text information and pictures. The scheme is divided into two parts: the first part realizes the function of converting text to pictures, which is realized by the Nautilus encryption component (NautilusBoya), and the picture obtained after the text is encrypted by the Nautilus encryption component is called a Nautilus picture; the second part realizes the function of converting pictures to text, which is called the Nautilus decryption component (NautilusZiqi).

[0045] Figure 1 is a logic diagram of a data processing method according to an embodiment of the present invention, such as Figure 1 As shown, the text (i.e., the original text to be encrypted) can be input into the Nautilus encryption component first, and the Nautilus image can be obtained after being processed by the Nautilus encryption component; when decryption is required, the Nautilus image can be input into the Nautilus decryption component, and the text can be obtained after being processed by the Nautilus decryption component.

[0046] The data processing method provided by the embodiment of the present invention is described below in conjunction with specific embodiments.

[0047] According to an embodiment of the present invention, a method embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0048] Figure 2 is a flow chart of a data processing method according to an embodiment of the present invention. Figure 2 As shown, the method comprises the following steps:

[0049] Step S202: obtaining original character information, wherein the original character information is character information corresponding to the original text.

[0050] In this embodiment, the original character information may be character information corresponding to an original text, where the original text is the text to be encrypted.

[0051] Step S204, obtaining the original character information and a target value corresponding to the random value, wherein the target value is represented by a predetermined number of color component values.

[0052] Step S206, obtaining an initial picture corresponding to the original character information based on the valid pixel block corresponding to the target value.

[0053] Step S208, performing redundant padding on the initial image to obtain a target image corresponding to the original character information, so as to encrypt the original character information.

[0054] As can be seen from the above, in an embodiment of the present invention, first, the original character information can be obtained, wherein the original character information is the character information corresponding to the original text; then, the original character information and the target value corresponding to the random value are obtained, wherein the target value is represented by a predetermined number of color component values; then, based on the valid pixel block corresponding to the target value, an initial image corresponding to the original character information is obtained; finally, the initial image is redundantly filled to obtain a target image corresponding to the original character information, so as to encrypt the original character information, thereby achieving the purpose of introducing a random value to encrypt the text to be encrypted and achieving the technical effect of improving the reliability of encryption.

[0055] Therefore, the data processing method provided by the embodiment of the present invention solves the technical problem in the related art that the method of encrypting some information that needs to be stored in plain text during the development of mobile applications has low reliability.

[0056] As an optional embodiment, before obtaining the original character information and the target value corresponding to the random value, the data processing method also includes: generating a first mapping code table, wherein the first mapping code table includes the target value; wherein generating the first mapping code table includes: generating a second mapping code table based on a predetermined character set and a decimal value corresponding to the predetermined character set; re-editing the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0057] In this embodiment, the predetermined character set may be a printable character set in ASCII code.

[0058] When the predetermined character set is a printable character set in ASCII code, the correspondence between the printable character set in ASCII code and its decimal number is organized into a mapping code table (i.e., the second mapping code table), and the correspondence between the characters and the decimal in the code table is disrupted to obtain a nonlinearly transformed character-decimal mapping code table, i.e., the first mapping code table.

[0059] Figure 3 : is a schematic diagram of an ASCII code table according to an embodiment of the present invention. The printable characters of the original ASCII code table are arranged linearly in alphabetical order and numerical order. The embodiment of the present invention proposes to disrupt the relationship between the characters in the table and the decimal values, and obtain a nonlinear transformation mapping table. The input character finds the corresponding decimal value in this mapping table, which is recorded as A.

[0060] In the above step S204, obtaining the original character information and the target value corresponding to the random value may include: searching for the decimal value corresponding to each original character in the original character information in the first mapping code table to obtain a search result; salting the random value to obtain a mixed salt value corresponding to the random value; and converting the sum of the search result and the mixed salt value corresponding to the target value in the RGB color space.

[0061] That is, in order to improve the reliability of encryption, the random value is salted to obtain a mixed salt value, and the sum of the search result and the mixed salt value is converted into a target value in the RGB color space.

[0062] Specifically, in an embodiment of the present invention, the decimal value A corresponding to the character in the mapping table of the nonlinear transformation can be added to the previously generated random number Rand, and the result obtained can be used as a target value for subsequent calculation of the pixel color, denoted as X, as shown in Formula 1: X=A+Rand{A, Rand|32≤A≤126, 0≤Rand≤129}, wherein X represents the target value, A represents the decimal value after encoding conversion, and Rand represents the random number.

[0063] In an optional embodiment, in order to make the nautilus picture (i.e., the target picture) generated each time different, a random number is introduced in the calculation process for salting calculation in the embodiment of the present invention, and the random number is stored as a salt value in a certain color block (i.e., pixel block) of the nautilus picture. Because the decimal value range of the printable character set of the ASCII code table is between 32 and 126, and in the RGB color space, the value range of each color channel is between 0 and 255, in order for the color of each channel to remain within the range of 0 to 255 after salting calculation, that is, 255-126=129, the value range of the random number is between 0 and 129, and the random number is recorded as Rand.

[0064] That is, in the embodiment of the present invention, the random value ranges from 0 to 129.

[0065] As an optional embodiment, obtaining an initial image corresponding to the original character information based on a valid pixel block corresponding to a target value may include: determining a theme color of the initial image in an RGB color space; determining a color component of the theme color and a color component of a non-theme color in the RGB color space; determining a target value based on the color component of the theme color and the color component of the non-theme color; obtaining a valid pixel block based on the target value; and generating the initial image based on the valid pixel block.

[0066] Further, determining the target value based on the color component of the theme color and the color component of the non-theme color includes: determining a color value difference threshold of the initial image and a standard value of the color component of the non-theme color; determining the target value based on the color value difference threshold, the standard value and the color component of the non-theme color.

[0067] In this embodiment, since the decimal value range of the printable character set of the ASCII code table is between 32 and 126, that is, the difference between a character corresponding to the decimal number 32 in the ASCII code table and a character corresponding to the decimal number 126 in the ASCII code table is 94, and the maximum difference is recorded as delta. If the values ​​of the three color components of red, green, and blue in the RGB color space are directly set to the decimal number of the ASCII code table corresponding to a character, a gray pixel block is obtained, and the color difference between the pixels of the grayscale image drawn in this way will be very obvious. In order to reduce the contrast of different text contents in a picture, it is necessary to minimize the difference in the three color components of a single pixel and the overall color difference of all pixels in the image.

[0068] Therefore, in the embodiment of the present invention, an algorithm is designed for the values ​​of the three color components in the RGB color space. First, the values ​​of red, green, and blue in the RGB color space are respectively recorded as R, G, and B, and one of the colors is designated as the theme color. For example, green is set as the theme color. In order to make the final output image appear as a theme color system, a larger value can be taken for the color component value corresponding to the theme color. The maximum difference delta is divided by 2 and added to the initial value 32. The result is taken as the standard value of the other two color components except the theme color, recorded as SV. A maximum allowable color value difference is set, recorded as MCS. The difference between the target value X and SV is calculated, and the result is divided by 2 times the MCS. The result is rounded and added to SV to obtain the value of the first color component. Here, red R is taken. After obtaining the value of the first color component, the difference between the component and the standard value can be analyzed according to Formula 2 to calculate the value of the last color component. After the three color components have specific values, a pixel block with a length and width of 1 can be generated.

[0069] Wherein, the above formula 2 is: X=SV+2*(R-SV)*MCS+BR, and formula 3 is: X represents the target value, SV represents the standard value, R represents the red component value, MCS represents the maximum allowable color value difference (ie, the color value difference threshold), and B represents the blue component value.

[0070] As an optional embodiment, redundant padding is performed on the initial image to obtain a target image corresponding to the original character information, including: determining the initial image size of the initial image based on the original character information; performing redundant processing on the initial image size to obtain a target size of the initial image; generating invalid pixel blocks based on valid pixel blocks and the target size; and filling blank areas of the initial image with invalid pixel blocks to obtain a target image.

[0071] Since the final generated Nautilus image is a square, and the length of the input text content is not fixed, it is necessary to calculate the image size of the final generated image based on the length of the input character content, and fill the remaining part with redundancy. First, the image size needs to be calculated. The specific method is to first read the input character length, add an extra bit for the random number mark bit, and the image side length calculation formula is as follows: Length represents the side length of the image, count represents the length of the text to be encrypted (i.e., the length of the original text); then some pixel blocks are copied, and the theme color values ​​are modified to distinguish the valid content, and these new pixel blocks are used to fill the remaining blank areas in turn.

[0072] After all characters have been converted and pixel blocks have been generated, the remaining area in the image is filled with redundancy to obtain a picture that stores information, called a Nautilus picture. At this point, the workflow of the Nautilus encryption component is completed.

[0073] Figure 4 is a flowchart of an optional data processing method according to an embodiment of the present invention. Figure 4 As shown, after inputting character information, a random number (i.e., a random value) is generated, followed by encoding conversion, and then mixed salt value processing, and a pixel block (i.e., a valid pixel block) is generated based on the mixed salt value, and the blank area in the initial image is redundantly filled to obtain a nautilus image.

[0074] As can be seen from the above, in an embodiment of the present invention, the correspondence between the printable character set and its decimal number in the ASCII code table is organized into a mapping code table, and the correspondence between the characters and the decimal in the code table is disrupted to obtain a nonlinearly transformed character-decimal mapping code table. The decimal value corresponding to the input character in the code table is found, and then the value is converted into a color component value in the RGB color space, and a random number is introduced in the conversion process. The decimal value of a character can be represented by three color components of red, green, and blue, and then a pixel block is obtained. All input characters are converted into pixel blocks, and invalid pixel blocks are used to redundantly fill the remaining area of ​​the image, and finally a picture (i.e., a nautilus picture) with the original character information hidden is obtained.

[0075] Through the data processing method provided by the embodiment of the present invention, the text content that needs to be protected can be saved in the picture, and the third party cannot restore the original information protected in the picture without knowing the way to interpret the picture, and the same content can be output as a Nautilus picture with different effects each time after being encrypted by the Nautilus encryption component, thereby increasing the difficulty of the Nautilus picture being easily cracked.

[0076] According to an embodiment of the present invention, a method embodiment of a data processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0077] Figure 5 is a flowchart of another optional data processing method according to an embodiment of the present invention. Figure 5 As shown, the data processing method may include:

[0078] Step S502, obtaining a target picture, wherein the target picture is a picture obtained by performing redundant padding on the initial picture.

[0079] The target image here is the Nautilus image, that is, the image obtained by encrypting the original text using the Nautilus encryption component.

[0080] Step S504: determining a target value corresponding to a valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values.

[0081] Step S506, parsing the original character information based on the target value.

[0082] Step S508, obtaining the original text based on the original character information.

[0083] As can be seen from the above, in an embodiment of the present invention, a target image can be obtained, wherein the target image is an image obtained after redundant padding of an initial image; a target value corresponding to a valid pixel block in the initial image is determined, wherein the target value is represented by a predetermined number of color component values; original character information is parsed based on the target value; original text is obtained based on the original character information, thereby achieving decryption of the image obtained after conversion from the original text to obtain the original text, and using the opposite logic to that of encryption during decryption, which also improves the reliability of encryption and decryption.

[0084] Therefore, the data processing method provided by the embodiment of the present invention solves the technical problem in the related art that the method of encrypting some information that needs to be stored in plain text during the development of mobile applications has low reliability.

[0085] As an optional embodiment, determining a target value corresponding to a valid pixel block in an initial image includes: obtaining a picture size of the target image; reading an initial image in the target image based on the picture size; and determining a target value based on the initial image.

[0086] Among them, in the above embodiment, determining the target value based on the initial image includes: reading the color component values ​​of the valid pixel blocks in the RGB color space from the initial image; determining the theme color of the initial image in the RGB color space; determining the initial image from the target image based on the color components corresponding to the theme color and the standard value, wherein the standard value is a value determined based on the color value difference threshold of the initial image and the color component of the non-theme color; determining the target value based on the color value difference threshold, the standard value and the color component of the non-theme color.

[0087] As an optional embodiment, parsing the original character information based on the target value includes: searching for a salt value pixel block where the salt value is located in the target image; obtaining the salt value from the salt value pixel block; desalting the target value to obtain a decimal value; and searching for the original character information corresponding to the decimal value in the first mapping code table.

[0088] As an optional embodiment, before searching for the original character information corresponding to the decimal value in the first mapping code table, the method also includes: generating a first mapping code table, wherein the first mapping code table includes the target value; wherein generating the first mapping code table includes: generating a second mapping code table based on a predetermined character set and the decimal value corresponding to the predetermined character set; re-editing the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0089] Figure 6 is a flowchart of another optional data processing method according to an embodiment of the present invention. Figure 6As shown, input the nautilus picture (i.e., the target picture); then read the size of the nautilus picture, specifically, the size information of the target image can be read from the input nautilus picture to obtain the width and height of the image; then read the valid area content of the target picture, specifically, the color component values ​​of all pixel blocks in the RGB color space can be read in sequence, and the valid and invalid content can be distinguished according to whether the color component corresponding to the theme color is equal to the standard value; then identify the salt value pixel block, specifically, according to the logic of adding salt when generating the image, find the pixel block where the salt is located in the image, and calculate the salt value according to Formula 2. Calculate the target value, specifically, calculate the target value X for the valid pixel block according to Formula 2. Desalting: Desalting the target value according to Formula 1 to obtain the decimal number A. Encoding conversion: Use the decimal number A to reversely check the nonlinear transformation code table to obtain the original character information. Finally, output the original string: After all valid pixel blocks are read and encoded, the original complete string information can be obtained, and the workflow of the nautilus decryption component ends.

[0090] As can be seen from the above, in an embodiment of the present invention, the image size information can be read first, and then the valid content area can be read to find the pixel block storing the salt value, read the written random number, read the three color components of each pixel in sequence, calculate the target value according to the target value calculation formula 2, and then desalt the target value according to formula 1 to obtain a decimal number, and then look up the nonlinear conversion code table to obtain the original character content.

[0091] The data processing method provided by the embodiment of the present invention can protect the content to be protected by re-encrypting it. However, if the content to be protected is already the key information required for other scenarios, this solution still faces the problem of re-protecting the new key. If the method proposed in the embodiment of the present invention is adopted, the decimal value obtained after the character encoding conversion is converted into the RGB color space for encryption protection, that is, the information to be protected is converted into a picture. A third person will not be able to obtain the information hidden in the picture without the help of the Nautilus decryption component proposed by the present invention, and the code table of the nonlinear transformation and the pixel block storing the salt value mentioned in the implementation process can be customized and changed as needed to prevent the Nautilus picture from being decrypted by the same Nautilus decryption component, which provides a strong guarantee for the protection of information such as engineering keys in the field of mobile development.

[0092] The embodiment of the present invention further provides a data processing device. It should be noted that the data processing device of the embodiment of the present invention can be used to execute the data processing method provided by the embodiment of the present invention. The data processing device provided by the embodiment of the present invention is introduced below.

[0093] Figure 7is a schematic diagram of a data processing device according to an embodiment of the present invention. Figure 7 As shown, the data processing device may include: a first acquisition unit 71, a second acquisition unit 73, a third acquisition unit 75 and an encryption unit 77. The data processing device is described below.

[0094] The first acquisition unit 71 is used to acquire original character information, wherein the original character information is character information corresponding to the original text.

[0095] The second acquisition unit 73 is used to acquire the original character information and a target value corresponding to the random value, wherein the target value is represented by a predetermined number of color component values.

[0096] The third acquisition unit 75 is used to obtain an initial picture corresponding to the original character information based on the valid pixel block corresponding to the target value.

[0097] The encryption unit 77 is used to perform redundancy padding on the initial image to obtain a target image corresponding to the original character information so as to encrypt the original character information.

[0098] It should be noted that the first acquisition unit 71, the second acquisition unit 73, the third acquisition unit 75 and the encryption unit 77 correspond to steps S202 to S208 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiment. It should be noted that the modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0099] As can be seen from the above, in the embodiment of the present invention, the first acquisition unit can be used to first acquire the original character information, wherein the original character information is the character information corresponding to the original text; then the second acquisition unit is used to acquire the original character information and the target value corresponding to the random value, wherein the target value is represented by a predetermined number of color component values; then the third acquisition unit is used to obtain the initial image corresponding to the original character information based on the valid pixel block corresponding to the target value; finally, the encryption unit is used to perform redundant padding on the initial image to obtain the target image corresponding to the original character information, so as to encrypt the original character information. The data processing device provided by the embodiment of the present invention realizes the purpose of decrypting the image obtained after the original text is converted to obtain the original text. The opposite logic to that of encryption is used for processing during decryption, which also improves the reliability of encryption and decryption, and solves the technical problem of low reliability of the encryption method for some information that needs to be stored in plain text during the development of mobile applications in the related technology.

[0100] As an optional embodiment, the data processing device also includes: a first generating unit, used to generate a first mapping code table before obtaining the original character information and the target value corresponding to the random value, wherein the first mapping code table includes the target value; wherein the first generating unit includes: a first generating module, used to generate a second mapping code table based on a predetermined character set and a decimal value corresponding to the predetermined character set; a first editing module, used to re-edit the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0101] As an optional embodiment, the second acquisition unit includes: a first search module, used to search for the decimal value corresponding to each original character in the original character information in the first mapping code table to obtain a search result; a salting module, used to salt the random value to obtain a mixed salt value corresponding to the random value; and a conversion module, used to convert the sum of the search result and the value corresponding to the mixed salt value into a target value in the RGB color space.

[0102] As an optional embodiment, the random value ranges from 0 to 129.

[0103] As an optional embodiment, the third acquisition unit includes: a first determination module, used to determine the theme color of the initial image in the RGB color space; a second determination module, used to determine the color components of the theme color and the color components of the non-theme color in the RGB color space; a third determination module, used to determine the target value based on the color components of the theme color and the color components of the non-theme color; the first acquisition module, used to obtain a valid pixel block based on the target value; and a second generation module, used to generate the initial image based on the valid pixel block.

[0104] As an optional embodiment, the third determination module includes: a first determination submodule, used to determine the color value difference threshold of the initial image and the standard value of the color component of the non-theme color; a second determination submodule, used to determine the target value based on the color value difference threshold, the standard value and the color component of the non-theme color.

[0105] As an optional embodiment, the encryption unit includes: a fourth determination module, used to determine the initial image size of the initial image based on the original character information; a redundancy processing module, used to perform redundant processing on the initial image size to obtain a target size of the initial image; a third generation module, used to generate an invalid pixel block based on the valid pixel block and the target size; an encryption module, used to fill the blank area of ​​the initial image with the invalid pixel block to obtain the target image.

[0106] The embodiment of the present invention further provides a data processing device. It should be noted that the data processing device of the embodiment of the present invention can be used to execute the data processing method provided by the embodiment of the present invention. The data processing device provided by the embodiment of the present invention is introduced below.

[0107] Figure 8 is a schematic diagram of an optional data processing device according to an embodiment of the present invention, such as Figure 7 As shown, the data processing device may include: a fourth acquisition unit 81, a determination unit 83, a parsing unit 85 and a fifth acquisition unit 87. The data processing device is described below.

[0108] The fourth acquisition unit 81 is used to acquire a target picture, wherein the target picture is a picture obtained by performing redundancy padding on the initial picture.

[0109] The determination unit 83 is used to determine a target value corresponding to a valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values.

[0110] The parsing unit 85 is used to parse out the original character information based on the target value.

[0111] The fifth obtaining unit 87 is used to obtain the original text based on the original character information.

[0112] It should be noted that the fourth acquisition unit 81, the determination unit 83, the parsing unit 85 and the fifth acquisition unit 87 correspond to steps S502 to S508 in the embodiment, and the examples and application scenarios implemented by the modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the modules as part of the device can be executed in a computer system such as a set of computer executable instructions.

[0113] As can be seen from the above, in the embodiment of the present invention, the fourth acquisition unit can be used to first acquire the target image, wherein the target image is an image obtained after redundant padding of the initial image; then the determination unit can determine the target value corresponding to the valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values; then the parsing unit is used to parse out the original character information based on the target value; finally, the fifth acquisition unit is used to obtain the original text based on the original character information. The data processing device provided by the embodiment of the present invention achieves the purpose of decrypting the image obtained after the original text is converted to obtain the original text, and the opposite logic to that of encryption is used during decryption, which also improves the reliability of encryption and decryption, and solves the technical problem of low reliability in the related art in the process of mobile application development for some information that needs to be stored in plain text.

[0114] As an optional embodiment, the determination unit includes: a second acquisition module, used to obtain the image size of the target image; a reading module, used to read the initial image in the target image based on the image size; and a fifth determination module, used to determine the target value based on the initial image.

[0115] As an optional embodiment, the fifth determination module includes: a reading submodule, used to read the color component values ​​of the valid pixel block in the RGB color space from the initial image; a third determination submodule, used to determine the theme color of the initial image in the RGB color space; a fourth determination submodule, used to determine the initial image from the target image based on the color component corresponding to the theme color and the standard value, wherein the standard value is a value determined based on the color value difference threshold of the initial image and the color component of the non-theme color; a fifth determination submodule, used to determine the target value based on the color value difference threshold, the standard value and the color component of the non-theme color.

[0116] As an optional embodiment, the parsing unit includes: a second search module, used to search for a salt value pixel block where the salt value is located in the target image; a third acquisition module, used to obtain the salt value from the salt value pixel block; a desalting module, used to desalt the target value to obtain a decimal value; and a second search module, used to search for original character information corresponding to the decimal value in the first mapping code table.

[0117] As an optional embodiment, the data processing device also includes: a second generating unit, used to generate a first mapping code table before searching for the original character information corresponding to the decimal value in the first mapping code table, wherein the first mapping code table includes the target value; wherein the second generating unit includes: a fourth generating module, used to generate a second mapping code table based on a predetermined character set and the decimal value corresponding to the predetermined character set; a second editing module, used to re-edit the mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table to obtain the first mapping code table.

[0118] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium including a stored computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned data processing methods.

[0119] According to another aspect of an embodiment of the present invention, a processor is provided, and the processor is used to run a computer program, wherein the computer program executes any one of the above data processing methods when it is run.

[0120] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0121] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0122] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0123] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0124] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0125] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0126] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A data processing method, characterized in that: include: Acquire original character information, wherein the original character information is character information corresponding to the original text; Acquire the original character information and a target value corresponding to the random value, wherein the target value is represented by a predetermined number of color component values; Obtaining an initial picture corresponding to the original character information based on the valid pixel block corresponding to the target value; Performing redundant padding on the initial image to obtain a target image corresponding to the original character information, so as to encrypt the original character information; Obtaining the initial image corresponding to the original character information based on the effective pixel block corresponding to the target value, including: determining the theme color of the initial image in the RGB color space; determining the color component of the theme color and the color component of the non-theme color in the RGB color space; determining the target value based on the color component of the theme color and the color component of the non-theme color; obtaining the effective pixel block based on the target value; generating the initial image according to the effective pixel block; Determining the target value based on the color component of the theme color and the color component of the non-theme color includes: determining a color value difference threshold of the initial image and a standard value of the color component of the non-theme color; and determining the target value based on the color value difference threshold, the standard value, and the color component of the non-theme color.

2. The data processing method according to claim 1, characterized in that: Before obtaining the original character information and the target value corresponding to the random value, the method further includes: generating a first mapping code table, wherein the first mapping code table includes the target value; The step of generating the first mapping code table includes: Generate a second mapping code table based on a predetermined character set and a decimal value corresponding to the predetermined character set; The mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table is re-edited to obtain the first mapping code table.

3. The data processing method according to claim 2, characterized in that: Obtaining the original character information and the target value corresponding to the random value includes: Searching for a decimal value corresponding to each original character in the original character information in the first mapping code table to obtain a search result; Add salt to the random value to obtain a mixed salt value corresponding to the random value; The sum of the values ​​corresponding to the search result and the mixed salt value is converted into the target value in the RGB color space.

4. The data processing method according to claim 3, characterized in that: The random value ranges from 0 to 129.

5. The data processing method according to any one of claims 1 to 4, characterized in that: Redundancy filling is performed on the initial image to obtain a target image corresponding to the original character information, including: Determining an initial picture size of the initial picture based on the original character information; Performing redundancy processing on the initial image size to obtain a target size of the initial image; generating an invalid pixel block based on the valid pixel block and the target size; The blank area of ​​the initial picture is filled with the invalid pixel block to obtain the target picture.

6. A data processing method, characterized in that: include: Obtaining a target image, wherein the target image is an image obtained by performing redundant padding on the initial image; Determining a target value corresponding to a valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values; Parsing original character information based on the target value; Obtaining original text based on the original character information; Determining a target value corresponding to a valid pixel block in the initial image includes: Acquire the image size of the target image; read the initial image in the target image based on the image size; determine the target value based on the initial image; Determining the target value based on the initial image includes: reading color component values ​​of the valid pixel block in the RGB color space from the initial image; determining a theme color of the initial image in the RGB color space; determining the initial image from the target image based on a color component corresponding to the theme color and a standard value, wherein the standard value is a value determined based on a color value difference threshold of the initial image and a color component of a non-theme color; and determining the target value based on the color value difference threshold, the standard value, and the color component of the non-theme color.

7. The data processing method according to claim 6, characterized in that: Parsing the original character information based on the target value includes: Searching for a salt value pixel block where the salt value is located in the target image; Obtaining the salt value from the salt value pixel block; Desalting the target value to obtain a decimal value; The original character information corresponding to the decimal value is searched in the first mapping code table.

8. The data processing method according to claim 7, characterized in that: Before searching the original character information corresponding to the decimal value in the first mapping code table, the method further includes: generating a first mapping code table, wherein the first mapping code table includes the target value; The step of generating the first mapping code table includes: Generate a second mapping code table based on a predetermined character set and a decimal value corresponding to the predetermined character set; The mapping relationship between the predetermined character set and its corresponding decimal value in the second mapping code table is re-edited to obtain the first mapping code table.

9. A data processing device, characterized in that: include: A first acquisition unit, configured to acquire original character information, wherein the original character information is character information corresponding to the original text; A second acquisition unit is used to acquire the original character information and a target value corresponding to the random value, wherein the target value is represented by a predetermined number of color component values; A third acquisition unit, configured to obtain an initial picture corresponding to the original character information based on the valid pixel block corresponding to the target value; An encryption unit, used to perform redundancy padding on the initial image to obtain a target image corresponding to the original character information, so as to encrypt the original character information; The third acquisition unit includes: a first determination module, used to determine the theme color of the initial image in the RGB color space; a second determination module, used to determine the color component of the theme color and the color component of the non-theme color in the RGB color space; a third determination module, used to determine the target value based on the color component of the theme color and the color component of the non-theme color; a first acquisition module, used to obtain the valid pixel block based on the target value; a second generation module, used to generate the initial image according to the valid pixel block; a first determination submodule, used to determine the color value difference threshold of the initial image and the standard value of the color component of the non-theme color; a second determination submodule, used to determine the target value based on the color value difference threshold, the standard value and the color component of the non-theme color.

10. A data processing device, characterized in that: include: A fourth acquisition unit, configured to acquire a target image, wherein the target image is an image obtained by performing redundant padding on the initial image; A determination unit, configured to determine a target value corresponding to a valid pixel block in the initial image, wherein the target value is represented by a predetermined number of color component values; A parsing unit, used for parsing original character information based on the target value; A fifth acquisition unit, configured to obtain an original text based on the original character information; The determination unit includes: a second acquisition module, used to acquire the image size of the target image; a reading module, used to read the initial image in the target image based on the image size; and a fifth determination module, used to determine the target value based on the initial image. The fifth determination module includes: a reading submodule, which is used to read the color component value of the effective pixel block in the RGB color space from the initial image; a third determination submodule, which is used to determine the theme color of the initial image in the RGB color space; a fourth determination submodule, which is used to determine the initial image from the target image based on the color component corresponding to the theme color and the standard value, wherein the standard value is a value determined based on the color value difference threshold of the initial image and the color component of the non-theme color; and a fifth determination submodule, which is used to determine the target value based on the color value difference threshold, the standard value, and the color component of the non-theme color.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the data processing method described in any one of claims 1 to 8.

12. A processor, characterized in that: The processor is used to run a computer program, wherein the computer program executes the data processing method according to any one of claims 1 to 8 when running.

Citation Information

Patent Citations

  • Information encryption and decryption method and device

    CN106330976A

  • File conversion method and device and file transmission system

    CN106776677A