Data decryption method and device, equipment and storage medium
By using preset hashing algorithms and data sequence interception processing technology in the consumable chip, we quickly find and feedback the decrypted data required by the image forming equipment, solving the problem of uncontrollable decryption time caused by insufficient computing power of the consumable chip, ensuring the normal progress of the printing process.
Patent Information
- Application Number
- CN202411577241.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-06
AI Technical Summary
The insufficient computing power of the consumable chip leads to too long operation time, the execution time of the decryption process is uncontrollable, and the decryption data cannot be feedback to the image forming equipment in time, resulting in the equipment error and printing impact.
By acquiring the data acquisition request sent by the image forming device, the target encrypted data is read, the binary data sequence is calculated based on the preset hash algorithm, and the preset number of bits is intercepted to obtain a second data sequence for finding the storage address of the decrypted data, thereby quickly reading and feedbacking the decrypted data.
It realizes rapid search and feedback target decryption data, reduces the performance requirements for consumable chips, and ensures the normal progress of the consumable printing process.
Smart Images

Figure CN119562014A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data decryption method, apparatus, device, and storage medium. Background Art
[0002] With the continuous advancement of science and technology, the printing industry has developed rapidly, and printing-related image forming equipment has also been put into more application scenarios. Among them, image forming equipment includes printers, copiers, etc. The application of printing consumables in image forming equipment is becoming more and more extensive. Ink cartridges, toner cartridges, ribbons and other printing consumables have become consumable parts of image forming equipment. Printing consumables are equipped with consumable chips. In addition to storing information such as manufacturer information, remaining quantity information, category information, color, etc., the chip can also communicate with the image forming device for authentication.
[0003] In the related technology, the data decryption process in the consumable chip needs to rely entirely on the execution of the decryption algorithm. The insufficient computing power of the consumable chip may cause the calculation time to be too long, the execution time of the decryption process to be uncontrollable, and other abnormalities. The decrypted data cannot be fed back to the image forming device in time, causing the image forming device to report an error, affecting the printing of the consumables, and needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a data decryption method, apparatus, device and storage medium, which solve the problems in the related art such as insufficient computing power of consumable chips causing excessive calculation time, uncontrollable execution time of the decryption process, and inability to timely feed back decrypted data to the image forming device, thereby causing the image forming device to report an error and affecting the printing of consumables. The method realizes hierarchical conversion processing of target encrypted data and obtains a second data sequence for characterizing the storage address of the target decrypted data. The required target decrypted data can be quickly found. While ensuring the security of the decryption process, there is no need to use a complex decryption algorithm, which reduces the performance requirements for the consumable chips and ensures the normal consumable printing process.
[0005] In a first aspect, an embodiment of the present application provides a data decryption method, the method comprising:
[0006] Acquire a data acquisition request sent by the image forming device, and read target encrypted data corresponding to a target data address in the data acquisition request from the first storage area;
[0007] Calculating the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence;
[0008] The first data sequence is truncated by a preset number of bits to obtain a second data sequence, first target decrypted data corresponding to the second data sequence is read from a second storage area, and the first target decrypted data is fed back to the image forming device, wherein the second storage area stores first decrypted data corresponding to a binary data sequence set within a preset number of bits.
[0009] In a second aspect, an embodiment of the present application further provides a data decryption device, including:
[0010] An acquisition module configured to acquire a data acquisition request sent by an image forming device;
[0011] A first reading module is configured to read target encrypted data corresponding to a target data address in the data acquisition request from a first storage area;
[0012] A first calculation module, configured to calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence;
[0013] A second calculation module is configured to perform a truncation process of a preset number of bits on the first data sequence to obtain a second data sequence;
[0014] A second reading module is configured to read the first target decrypted data corresponding to the second data sequence from a second storage area, wherein the second storage area stores the first decrypted data corresponding to the binary data sequence set within a preset number of bits;
[0015] A data feedback module is configured to feed back the first target decrypted data to the image forming device.
[0016] In a third aspect, an embodiment of the present application further provides a data decryption device, the device comprising:
[0017] one or more processors;
[0018] a storage device configured to store one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the data decryption method described in the embodiment of the present application.
[0020] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the data decryption method described in the embodiment of the present application when executed by a computer processor.
[0021] In the embodiment of the present application, by obtaining the data acquisition request sent by the image forming device, the target encrypted data corresponding to the target data address in the data acquisition request is read from the first storage area; the target encrypted data is calculated based on the preset hash algorithm to obtain a binary first data sequence; the first data sequence is intercepted by a preset number of bits to obtain a second data sequence, and the first target decrypted data corresponding to the second data sequence is read from the second storage area, and the first target decrypted data is fed back to the image forming device, and the second storage area stores the first decrypted data corresponding to the binary data sequence set within the preset number of bits. In the above scheme, by converting the target encrypted data into a binary first data sequence, and intercepting the first data sequence by a preset number of bits to obtain the second data sequence, the target encrypted data can be hierarchically converted to obtain a second data sequence for characterizing the storage address of the target decrypted data; by reading the first target decrypted data from the first storage area based on the second data sequence, the required target decrypted data can be quickly found, and while ensuring the security of the decryption process, there is no need to use a complex decryption algorithm, reducing the performance requirements for the consumable chip, and ensuring the normal consumable printing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A flowchart of a data decryption method provided in an embodiment of the present application;
[0023] Figure 2 A flowchart of a data decryption method including a second data sequence obtained through interception processing provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of a process of intercepting a first data sequence to obtain a second data sequence provided in an embodiment of the present application;
[0025] Figure 4 A flowchart of a data decryption method including pre-storing the decrypted data in a second storage area provided in an embodiment of the present application;
[0026] Figure 5 A flowchart of a data decryption method including periodically feeding back first target decrypted data to an image forming device provided in an embodiment of the present application;
[0027] Figure 6 A flowchart of a data decryption method including reading second target decrypted data based on a third data sequence provided in an embodiment of the present application;
[0028] Figure 7 A flowchart of a data decryption method including reading third target decrypted data based on a fourth data sequence provided in an embodiment of the present application;
[0029] Figure 8 A structural block diagram of a data decryption device provided in an embodiment of the present application;
[0030] Fig. 9 A schematic diagram of the structure of a data decryption device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0033] The data decryption method provided in the embodiment of the present application is used in the printing process of the image forming device to read the target encrypted data stored internally, perform data conversion and interception processing on the target encrypted data, obtain a data sequence representing the data address, and read the target decrypted data based on the data sequence, and provide the target decrypted data for verification to the image forming device. Specific application scenarios may include: document printing, picture printing, etc. The several application scenarios listed above are only exemplary and explanatory. In actual applications, the data decryption method can also be used in data decryption in other scenarios, and the embodiment of the present application does not limit this. The present application aims to provide a data decryption method, device, equipment and storage medium to solve the problems in the related technology that the computing power of the consumable chip is insufficient, causing the operation time to be too long, the execution time of the decryption process to be uncontrollable, and the decrypted data cannot be fed back to the image forming device in time, thereby causing the image forming device to report an error and affecting the printing of consumables.
[0034] Figure 1 The flowchart of a data decryption method provided in an embodiment of the present application can be implemented with the processor of the consumable chip as the execution subject. Figure 1 As shown, the data decryption method specifically includes the following steps:
[0035] Step S101: obtaining a data acquisition request sent by an image forming device, and reading target encrypted data corresponding to a target data address in the data acquisition request from a first storage area.
[0036] The data acquisition request may be a request sent by the image forming device to the consumable chip to obtain decrypted data, and the decrypted data may be used for verification before the printer performs a printing operation. Only when the verification is successful can the image forming device perform a printing operation. The data acquisition request may include a target data address, and the target data address may point to a storage location of target encrypted data in a first storage area, and the first storage area may be an internal storage area of the consumable chip. By performing subsequent data processing operations, the first target decrypted data corresponding to the target encrypted data may be determined, and fed back to the image forming device, so that the image forming device verifies whether the first target decrypted data is the same as the expected result value, thereby determining whether the verification is passed.
[0037] Step S102: Calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence.
[0038] The preset hash algorithm may be a SHA (Secure Hash Algorithm) algorithm, including SHA-1, SHA-224, SHA-256, etc., which is not limited in this application. Taking the SHA-1 algorithm as an example, the target encrypted data may be calculated based on the SHA-1 algorithm to obtain a first data sequence of 256 binary bits. The number of bits of the first data sequence may be between 16 bits and 256 bits.
[0039] Step S103, truncate the first data sequence by a preset number of bits to obtain a second data sequence, read first target decrypted data corresponding to the second data sequence from the second storage area, and feed back the first target decrypted data to the image forming device, wherein the second storage area stores first decrypted data corresponding to the binary data sequence set within the preset number of bits.
[0040] Among them, the second storage area can be provided by the internal memory of the chip, or by an externally set memory, which is not limited in this application. The preset number of bits can be adaptively set by the developer according to the available storage space of the consumable chip or external memory in the actual application scenario, for example, 7 bits to 10 bits, which is not limited in this application. The interception process can be based on the sub-data sequence of the preset position extracted from the first data sequence to determine the second data sequence that meets the preset number of bits. In one embodiment, the sub-data sequence that meets the preset number of bits can be directly extracted from the first data sequence according to the preset position as the second data sequence. In one embodiment, the first data sequence can be first translated in a preset direction to remove part of the data bit information, and then the sub-data sequence of the preset number of bits can be extracted from the first data sequence according to the preset position. In one embodiment, a sub-data sequence of a fixed length can also be extracted from the first data sequence according to a preset position, the number of bits of the sub-data sequence is less than the preset number of bits, and then the sub-data sequence is expanded by completing the data bits or fusing other sub-data sequences to obtain a second data sequence that meets the preset number of bits. For example, the content of the data bit can be 0 or 1, and the completion position of the data bit can be a high bit, a low bit or other fixed position. For another example, the content of other sub-data sequences can be a combination of 0 and 1, and the fusion method can be a high bit incorporation, a low bit incorporation or an intermediate position insertion. The developer can make adaptive settings based on the relevant storage position of the decrypted data in the actual application scenario, and this application does not limit this. Since the second storage area can be pre-stored with the first decrypted data corresponding to the binary data sequence set within the preset number of bits, the first target decrypted data corresponding to the target decrypted data can be quickly read from the second storage area based on the second data sequence, and the first target decrypted data can be fed back to the image forming device for its data verification process. For example, the first data sequence can be 16 bits, which can be intercepted to obtain a 10-bit second data sequence, and the second storage area can provide 2 10 =1024 data addresses, each data address can correspond to a 10-bit binary data sequence, which is equivalent to a set of binary data sequences corresponding to 10 bits of binary as a whole, and each data address corresponds to the storage of pre-generated first decrypted data, thereby, each second data sequence can be used as address information to read the corresponding first target decrypted data from the second storage area.
[0041] In the above, by acquiring the data acquisition request sent by the image forming device, the target encrypted data corresponding to the target data address in the data acquisition request is read from the first storage area; the target encrypted data is calculated based on the preset hash algorithm to obtain a first binary data sequence; the first data sequence is intercepted by a preset number of bits to obtain a second data sequence, and the first target decrypted data corresponding to the second data sequence is read from the second storage area, and the first target decrypted data is fed back to the image forming device, and the second storage area stores the first decrypted data corresponding to the binary data sequence set within the preset number of bits. In the above scheme, by converting the target encrypted data into a first binary data sequence, and intercepting the first data sequence by a preset number of bits to obtain the second data sequence, the target encrypted data can be hierarchically converted to obtain a second data sequence for characterizing the storage address of the target decrypted data; by reading the first target decrypted data from the first storage area based on the second data sequence, the required target decrypted data can be quickly found, and while ensuring the security of the decryption process, there is no need to use a complex decryption algorithm, reducing the performance requirements for the consumable chip, and ensuring the normal consumable printing process.
[0042] Figure 2 A flowchart of a data decryption method including a second data sequence obtained through interception processing is provided in an embodiment of the present application. The data decryption method can be implemented with the processor of the consumable chip as the execution subject. Figure 2 As shown, the data decryption method specifically includes the following steps:
[0043] Step S201: Obtain a data acquisition request sent by an image forming device, and read target encrypted data corresponding to a target data address in the data acquisition request from a first storage area.
[0044] Step S202: Calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence.
[0045] Step S203: Shift the first data sequence by a set number of data bits in a first preset direction to obtain an intermediate data sequence, extract data bits from the intermediate data sequence in a second preset direction and a preset start bit to obtain a second data sequence that meets the preset number of bits.
[0046] The first preset direction may be a counting direction from a low position to a high position, or a counting direction from a high position to a low position, and the set number may be 3, 4, 5, etc., which is not limited in this application. The second preset direction may be a counting direction from a low position to a high position, or a counting direction from a high position to a low position, and the preset starting position may be the 1st position, the 2nd position, the 3rd position, etc., which is not limited in this application.
[0047] In one embodiment, Figure 3 A schematic diagram of a process of intercepting a first data sequence to obtain a second data sequence is provided in an embodiment of the present application, such as Figure 3 As shown, the first data sequence 101 is 11000011 1010 0101, the first preset direction is from high bit to low bit, the set number is 3, the second preset direction is from low bit to high bit, the preset starting bit is the 1st bit, and the preset number of bits is 10 bits. Then, after the first data sequence 101 is shifted by 3 data bits according to the first preset direction, an intermediate data sequence 102 can be obtained, and the intermediate data sequence 102 is 0001 1000 0111 0100. After the intermediate data sequence 102 is extracted by 10 data bits according to the second preset direction and with the preset starting bit being the 1st bit, a second data sequence 103 can be obtained, and the second data sequence 103 is 00 0111 0100.
[0048] Step S204, reading first target decrypted data corresponding to the second data sequence from the second storage area, and feeding back the first target decrypted data to the image forming device, wherein the second storage area stores first decrypted data corresponding to the binary data sequence set within a preset number of bits.
[0049] As described above, by performing relevant translation operations and extraction operations on the first data sequence, a second data sequence of preset bits can be obtained, effectively converting the first data sequence into a second data sequence that matches the storage space size of the second storage area, providing effective address information for querying the first target decrypted data.
[0050] Figure 4 A flowchart of a data decryption method including pre-storing the decrypted data in a second storage area is provided in an embodiment of the present application. Figure 4 As shown, the data decryption method specifically includes the following steps:
[0051] Step S301, receiving multiple decrypted data and a binary data sequence corresponding to each decrypted data sent by an external computing device, wherein the multiple decrypted data are decryption results obtained by the external computing device by calculating each binary data sequence within a preset number of bits based on a set decryption algorithm.
[0052] Among them, due to the limited computing power of the consumable chip, the decrypted data corresponding to the encrypted data can be calculated in advance by an external computing device and stored in the corresponding position of the second storage area. Each decrypted data can be calculated by an external computing device according to its corresponding binary data sequence, and the binary data sequence corresponding to each decrypted data can be used as the storage address of the decrypted data in the second storage area. For example, the second storage area can provide a 16-bit binary data address, then the external computing device can calculate the corresponding decryption result based on the binary data sequence corresponding to 0-65535, and the storage address corresponding to each decryption result is consistent with the corresponding binary data sequence. For example, the decryption result calculated by the external computing device based on 1101 1111 1001 1001 can be stored in the second storage area at a position with a binary data address of 1101 1111 1001 1001.
[0053] Step S302: store each decrypted data into an address position corresponding to the binary data sequence in the second storage area.
[0054] Step S303: Obtain a data acquisition request sent by the image forming device, and read target encrypted data corresponding to the target data address in the data acquisition request from the first storage area.
[0055] Step S304: Calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence.
[0056] Step S305, truncate the first data sequence by a preset number of bits to obtain a second data sequence, read first target decrypted data corresponding to the second data sequence from the second storage area, and feed back the first target decrypted data to the image forming device, wherein the second storage area stores first decrypted data corresponding to the binary data sequence set within the preset number of bits.
[0057] As described above, by utilizing the computing performance of the external computing device, multiple required decryption data can be calculated in advance to make up for the problem of insufficient computing power of ordinary consumable chips. In addition, by storing the relevant decryption data in the second storage area in advance, it can be helpful to quickly output the decryption data when processing the data acquisition request sent by the image forming device, thereby ensuring the normal printing of consumables.
[0058] Figure 5 A flowchart of a data decryption method including regularly feeding back first target decrypted data to an image forming device is provided in an embodiment of the present application. Figure 5 As shown, the data decryption method specifically includes the following steps:
[0059] Step S401: Obtain a data acquisition request sent by an image forming device, and read target encrypted data corresponding to a target data address in the data acquisition request from a first storage area.
[0060] Step S402: Calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence.
[0061] Step S403, perform truncation processing on the first data sequence with a preset number of bits to obtain a second data sequence, perform a first timing by using a set timer, read first target decrypted data corresponding to the second data sequence from the second storage area, and when the first timing reaches a preset duration, feed back the first target decrypted data to the image forming device, and the second storage area stores the first decrypted data corresponding to the binary data sequence set within the preset number of bits.
[0062] Among them, in some scenarios, in addition to verifying the decrypted data, the image forming device may also check the decryption time. In the printing program of the image forming device, it is assumed that a certain processing time interval is required for the consumable chip to process the data acquisition request to obtain the first target decrypted data. Therefore, the image forming device has a time range limit for the waiting time from sending the data acquisition request to receiving the first target decrypted data. Since the present embodiment adopts a method of obtaining the first target decrypted data based on the second data sequence query, the processing speed is faster and the time consumed is shorter than that of obtaining the first target decrypted data by calculating the processor. As a result, the image forming device may think that the time interval for obtaining the first target decrypted data is too short and the data source is unreliable, resulting in a printing error. Based on this, the present embodiment sets a timer for the first timing, and only when the first count reaches a preset time, the first target decrypted data is fed back to the image forming device. The preset time can be adaptively set based on the time range corresponding to the waiting time built into the printing program, and this application is not limited here.
[0063] As described above, by setting a timer to control the time point for feeding back the first target decrypted data to the image forming device, it is possible to meet the image forming device's restriction requirements on the decryption time and ensure the normal progress of the printing operation.
[0064] Figure 6 A flowchart of a data decryption method including reading second target decrypted data based on a third data sequence is provided in an embodiment of the present application. Figure 6 As shown, the data decryption method specifically includes the following steps:
[0065] Step S501: Obtain a data acquisition request sent by an image forming device, and read target encrypted data corresponding to a target data address in the data acquisition request from a first storage area.
[0066] Step S502: Calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence.
[0067] Step S503: perform a preset bit truncation process on the first data sequence to obtain a second data sequence, and obtain the current system time.
[0068] Step S504: When the current system time has not reached the preset time node, read the first target decrypted data corresponding to the second data sequence from the second storage area, and feed back the first target decrypted data to the image forming device. The second storage area stores the first decrypted data corresponding to the binary data sequence set within the preset bit number.
[0069] Step S505: When the current system time reaches a preset time node, the second data sequence and the reference data sequence are XORed to obtain a third data sequence, second target decrypted data corresponding to the third data sequence is read from the third storage area, and the second target decrypted data is fed back to the image forming device. The third storage area stores second decrypted data corresponding to a binary data sequence set within a preset number of bits.
[0070] Among them, since the possible values of the second data sequence are limited, the risk of being cracked by external attacks will gradually increase if the first decrypted data of the second storage area is read based on the second data sequence for a long time. Therefore, a preset time node can be set to determine whether the cumulative duration of the consumable chip processing data acquisition request reaches the expected duration threshold. In the case that the current system time does not reach the preset time node, it can be regarded as the cumulative duration is within an acceptable range, so the first target decrypted data corresponding to it can continue to be read based on the obtained second data sequence. In the case that the current system time reaches the preset time node, it can be regarded as the cumulative duration exceeds the expected duration threshold, so it is necessary to transform the data bit value of the second data sequence to obtain the third data sequence, and read the second target decrypted data from the third storage area based on the third data sequence. For example, the second data sequence can be 00 0001 1101, the reference data sequence can be 11 11111111, and the second data sequence and the reference data sequence are XORed, and 0 in the second data sequence can be converted to 1, and 1 can be converted to 0, thereby obtaining the third data sequence: 11 1110 0010. Of course, developers set reference data sequences with other values for different application scenarios, which is not limited in this application.
[0071] In one embodiment, the reference data sequence includes a first reference data sequence and a second reference data sequence, and the specific process of performing an XOR calculation on the second data sequence and the reference data sequence to obtain a third data sequence includes the following steps:
[0072] Performing an XOR calculation on the sub-data sequence at the first preset position in the second data sequence and the first reference data sequence to obtain an intermediate result sequence;
[0073] The sub-data sequence at the second preset position in the intermediate result sequence is XOR-calculated with the second reference data sequence to obtain a third data sequence, and the first preset position is different from the second preset position.
[0074] For example, the second data sequence may be 00 0001 1101, and the sub-data sequence of the first preset position may be the sub-data sequence corresponding to the 1st to 4th bits in the direction from low to high, that is, the sub-data sequence is 1101, and the corresponding first reference data sequence is 0101, then 1101 in the second data sequence is XORed with 0101 to obtain the intermediate result sequence: 00 0001 1000. In addition, for the intermediate result sequence, the sub-data sequence of the second preset position may be the sub-data sequence corresponding to the 5th to 8th bits in the direction from low to high, that is, the sub-data sequence is 0001, and the corresponding second reference data sequence is 1010, then 0001 in the intermediate data sequence is XORed with 1010 to obtain the third data sequence: 00 1011 1000. Of course, there may be other preset positions and reference data sequence settings, which are not limited in this application.
[0075] As described above, by comparing the current system time and the preset time node, it is possible to effectively determine whether the cumulative duration of processing the data acquisition request has reached the expected duration threshold, and when the current system time reaches the preset time node, the second data sequence can be processed by a related conversion process of XOR calculation with the reference data sequence to obtain a third data sequence, and the second target decryption data corresponding to the third data sequence is provided to the image forming device, thereby increasing the difficulty of cracking the decrypted data address and reducing the risk of external cracking.
[0076] Figure 7 A flowchart of a data decryption method including reading third target decrypted data based on a fourth data sequence is provided in an embodiment of the present application. Figure 7 As shown, the data decryption method specifically includes the following steps:
[0077] Step S601: Obtain a data acquisition request sent by an image forming device, update the accumulated number of request processing times, and read target encrypted data corresponding to the target data address in the data acquisition request from a first storage area.
[0078] Step S602: Calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence.
[0079] Step S603: truncate the first data sequence by a preset number of bits to obtain a second data sequence.
[0080] Step S604: When the number of request processing times does not reach the preset number, read the first target decrypted data corresponding to the second data sequence from the second storage area, and feed back the first target decrypted data to the image forming device. The second storage area stores the first decrypted data corresponding to the binary data sequence set within the preset bit number.
[0081] Step S605: When the number of request processing times reaches a preset number, the sub-data sequences corresponding to the third preset position and the fourth preset position in the second data sequence are swapped to obtain a fourth data sequence, and the third target decrypted data corresponding to the fourth data sequence is read from the fourth storage area, and the third target decrypted data is fed back to the image forming device. The fourth storage area stores the third decrypted data corresponding to the binary data sequence set within the preset bit number.
[0082] Among them, by counting the number of request processing times of the data acquisition request, the historical cumulative number of times the first decrypted data is determined using the second data sequence can be determined. Since the possible values of the second data sequence are limited, if the historical cumulative number reaches a certain order of magnitude, it may increase the risk of being cracked by external attacks. Therefore, a preset number of times can be set to determine whether the cumulative number of times the consumable chip processes data acquisition requests has reached the expected number threshold. In the case where the number of request processing times does not reach the preset number of times, it can be regarded that the cumulative number of request processing times is within an acceptable range, and thus the corresponding first target decrypted data can continue to be read based on the obtained second data sequence. In the case where the number of request processing times reaches the preset number of times, it can be regarded that the cumulative number of request processing times exceeds the expected number threshold, and therefore it is necessary to exchange part of the second data sequence to obtain the fourth data sequence, and read the third target decrypted data from the fourth storage area based on the fourth data sequence. For example, the second data sequence may be 00 0001 1101, the sub-data sequence of the third preset position may be the sub-data sequence corresponding to the 1st to 4th bits in the direction from low to high, that is, the sub-data sequence is 1101, the sub-data sequence of the fourth preset position may be the sub-data sequence corresponding to the 5th to 8th bits in the direction from low to high, that is, the sub-data sequence is 0001, and the fourth data sequence can be obtained by swapping 1101 and 0001: 00 11010001. Of course, there may be other preset positions, which are not limited in this application.
[0083] As described above, by comparing the number of request processing times and the preset number of times, it is possible to effectively determine whether the historical cumulative number of data acquisition requests has reached the expected number threshold, and when the number of request processing times reaches the preset number of times, the second data sequence can be partially swapped to obtain a fourth data sequence, and the third target decryption data corresponding to the fourth data sequence can be provided to the image forming device, thereby effectively rearranging the second data sequence, increasing the difficulty of cracking the decrypted data address, and ensuring the security of consumables printing.
[0084] Figure 8 This is a structural block diagram of a data decryption device provided in an embodiment of the present application. The device is configured to execute the data decryption method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 8 As shown, the device specifically includes:
[0085] An acquisition module 201 is configured to acquire a data acquisition request sent by an image forming device;
[0086] A first reading module 202 is configured to read target encrypted data corresponding to a target data address in a data acquisition request from a first storage area;
[0087] A first calculation module 203 is configured to calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence;
[0088] The second calculation module 204 is configured to perform a truncation process of a preset number of bits on the first data sequence to obtain a second data sequence;
[0089] The second reading module 205 is configured to read the first target decrypted data corresponding to the second data sequence from the second storage area, where the first decrypted data corresponding to the binary data sequence set within a preset number of bits is stored;
[0090] The data feedback module 206 is configured to feed back the first target decrypted data to the image forming device.
[0091] In the above, by acquiring the data acquisition request sent by the image forming device, the target encrypted data corresponding to the target data address in the data acquisition request is read from the first storage area; the target encrypted data is calculated based on the preset hash algorithm to obtain a first binary data sequence; the first data sequence is intercepted by a preset number of bits to obtain a second data sequence, and the first target decrypted data corresponding to the second data sequence is read from the second storage area, and the first target decrypted data is fed back to the image forming device, and the second storage area stores the first decrypted data corresponding to the binary data sequence set within the preset number of bits. In the above scheme, by converting the target encrypted data into a first binary data sequence, and intercepting the first data sequence by a preset number of bits to obtain the second data sequence, the target encrypted data can be hierarchically converted to obtain a second data sequence for characterizing the storage address of the target decrypted data; by reading the first target decrypted data from the first storage area based on the second data sequence, the required target decrypted data can be quickly found, and while ensuring the security of the decryption process, there is no need to use a complex decryption algorithm, reducing the performance requirements for the consumable chip, and ensuring the normal consumable printing process.
[0092] In a possible embodiment, the second calculation module 204 is further configured to:
[0093] Shifting the first data sequence by a set number of data bits in a first preset direction to obtain an intermediate data sequence;
[0094] The data bits of the intermediate data sequence are extracted according to the second preset direction and the preset starting bit to obtain a second data sequence that meets the preset bit number.
[0095] In a possible embodiment, it further includes a decryption data storage module configured to:
[0096] Receiving multiple decrypted data and a binary data sequence corresponding to each decrypted data sent by an external computing device, wherein the multiple decrypted data are decryption results obtained by the external computing device by calculating each binary data sequence within a preset number of bits based on a set decryption algorithm;
[0097] Each decrypted data is stored in the address position corresponding to the binary data sequence in the second storage area.
[0098] In a possible embodiment, a timing module is further included, configured as follows:
[0099] Performing a first timing by using a set timer;
[0100] The data feedback module 206 is configured as follows:
[0101] When the first timing reaches a preset time length, the first target decrypted data is fed back to the image forming device.
[0102] In a possible embodiment, it further includes a system time acquisition module configured as follows:
[0103] Get the current system time;
[0104] The second reading module 205 is further configured as:
[0105] When the current system time does not reach the preset time node, reading the first target decrypted data corresponding to the second data sequence from the second storage area;
[0106] Accordingly, a third calculation module is also included, configured as follows:
[0107] When the current system time reaches a preset time node, performing an XOR calculation on the second data sequence and the reference data sequence to obtain a third data sequence;
[0108] The third reading module is configured as follows:
[0109] Reading second target decrypted data corresponding to a third data sequence from a third storage area, wherein the third storage area stores second decrypted data corresponding to a binary data sequence set within a preset number of bits;
[0110] The second data feedback module is configured as follows:
[0111] The second target decrypted data is fed back to the image forming apparatus.
[0112] In a possible embodiment, the third computing module is further configured to:
[0113] Performing an XOR calculation on the sub-data sequence at the first preset position in the second data sequence and the first reference data sequence to obtain an intermediate result sequence;
[0114] The sub-data sequence at the second preset position in the intermediate result sequence is XOR-calculated with the second reference data sequence to obtain a third data sequence, and the first preset position is different from the second preset position.
[0115] In a possible embodiment, it further includes a frequency statistics module configured as follows:
[0116] Update the cumulative number of request processing times;
[0117] The second reading module 205 is further configured as:
[0118] When the number of request processing times does not reach the preset number, reading the first target decrypted data corresponding to the second data sequence from the second storage area;
[0119] Accordingly, a fourth calculation module is also included, configured as follows:
[0120] When the number of request processing times reaches the preset number, the sub-data sequences corresponding to the third preset position and the fourth preset position in the second data sequence are swapped to obtain a fourth data sequence;
[0121] The fourth reading module is configured as follows:
[0122] Reading third target decrypted data corresponding to a fourth data sequence from a fourth storage area, wherein the fourth storage area stores third decrypted data corresponding to a binary data sequence set within a preset number of bits;
[0123] The fourth data feedback module is configured as follows:
[0124] The third target decrypted data is fed back to the image forming apparatus.
[0125] Fig. 9 A schematic diagram of the structure of a data decryption device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the device includes a processor 301, a memory 302, an input device 303 and an output device 304; the number of processors 301 in the device can be one or more. Fig. 9 A processor 301 is taken as an example; the processor 301, memory 302, input device 303 and output device 304 in the device can be connected by a bus or other means. Fig. 9 The example of connecting through a bus is taken. The memory 302, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the data decryption method in the embodiment of the present application. The processor 301 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 302, that is, implements the above-mentioned data decryption method. The input device 303 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 304 may include a display device such as a display screen.
[0126] The data decryption device provided above can be used to execute the data decryption method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0127] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions. When the computer executable instructions are executed by a computer processor, they are configured to execute a data decryption method described in the above embodiment, which includes: obtaining a data acquisition request sent by an image forming device, reading target encrypted data corresponding to the target data address in the data acquisition request from a first storage area; calculating the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence; truncating the first data sequence by a preset number of bits to obtain a second data sequence, reading first target decrypted data corresponding to the second data sequence from a second storage area, and feeding back the first target decrypted data to the image forming device, wherein the second storage area stores first decrypted data corresponding to a set of binary data sequences within a preset number of bits.
[0128] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media, or optical storage; registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.
[0129] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the above data decryption method, can also execute related operations in the data decryption method provided in any embodiment of the present application.
[0130] It is worth noting that in the embodiment of the above-mentioned data decryption device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0131] It should be noted that the numbering of each step in this scheme is only used to describe the overall design framework of this scheme, and does not represent the necessary order relationship between the steps. On the basis that the overall implementation process conforms to the overall design framework of this scheme, it belongs to the protection scope of this scheme, and the order of precedence in the form of text when describing is not an exclusive limitation on the specific implementation process of this scheme. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (fl ash RAM). The memory is an example of a computer-readable medium.
[0132] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data decryption method, characterized in that: include: Acquire a data acquisition request sent by the image forming device, and read target encrypted data corresponding to a target data address in the data acquisition request from the first storage area; Calculating the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence; The first data sequence is truncated by a preset number of bits to obtain a second data sequence, first target decrypted data corresponding to the second data sequence is read from a second storage area, and the first target decrypted data is fed back to the image forming device, wherein the second storage area stores first decrypted data corresponding to a binary data sequence set within a preset number of bits.
2. The data decryption method according to claim 1, characterized in that: The step of performing a truncation process of a preset number of bits on the first data sequence to obtain a second data sequence includes: Shifting the first data sequence by a set number of data bits in a first preset direction to obtain an intermediate data sequence; The data bits of the intermediate data sequence are extracted according to a second preset direction and a preset starting bit to obtain a second data sequence that meets the preset bit number.
3. The data decryption method according to claim 1, characterized in that: Before acquiring the data acquisition request sent by the image forming device, the method further includes: Receive multiple decrypted data and binary data sequences corresponding to each of the decrypted data sent by an external computing device, wherein the multiple decrypted data are decryption results obtained by the external computing device by calculating each binary data sequence within a preset number of bits based on a set decryption algorithm; Each of the decrypted data is stored in an address position corresponding to the binary data sequence in the second storage area.
4. The data decryption method according to claim 1, characterized in that: Before reading the first target decrypted data corresponding to the second data sequence from the second storage area, the method further includes: Performing a first timing by using a set timer; The feeding back the first target decrypted data to the image forming device comprises: When the first timing reaches a preset time length, the first target decrypted data is fed back to the image forming device.
5. The data decryption method according to claim 1, characterized in that: After the first data sequence is truncated by a preset number of bits to obtain a second data sequence, the method further includes: Get the current system time; The step of reading the first target decrypted data corresponding to the second data sequence from the second storage area comprises: When the current system time does not reach a preset time node, reading first target decrypted data corresponding to the second data sequence from the second storage area; Correspondingly, after obtaining the current system time, the method further includes: When the current system time reaches the preset time node, the second data sequence and the reference data sequence are XORed to obtain a third data sequence, second target decrypted data corresponding to the third data sequence is read from a third storage area, and the second target decrypted data is fed back to the image forming device, wherein the third storage area stores second decrypted data corresponding to a binary data sequence set within a preset number of bits.
6. The data decryption method according to claim 5, characterized in that: The reference data sequence includes a first reference data sequence and a second reference data sequence, and performing an XOR calculation on the second data sequence and the reference data sequence to obtain a third data sequence includes: Performing an XOR calculation on the sub-data sequence at the first preset position in the second data sequence and the first reference data sequence to obtain an intermediate result sequence; A third data sequence is obtained by performing an XOR calculation on a sub-data sequence at a second preset position in the intermediate result sequence and the second reference data sequence, wherein the first preset position is different from the second preset position.
7. The data decryption method according to claim 1, characterized in that: After acquiring the data acquisition request sent by the image forming device, the method further includes: Update the cumulative number of request processing times; The step of reading the first target decrypted data corresponding to the second data sequence from the second storage area comprises: When the number of request processing times does not reach a preset number, reading first target decrypted data corresponding to the second data sequence from a second storage area; Correspondingly, after the first data sequence is truncated by a preset number of bits to obtain the second data sequence, the method further includes: When the number of request processing times reaches the preset number of times, the sub-data sequences corresponding to the third preset position and the fourth preset position in the second data sequence are swapped to obtain a fourth data sequence, and the third target decrypted data corresponding to the fourth data sequence is read from the fourth storage area, and the third target decrypted data is fed back to the image forming device. The fourth storage area stores the third decrypted data corresponding to the binary data sequence set within the preset bit number.
8. A data decryption device, characterized in that: include: An acquisition module configured to acquire a data acquisition request sent by an image forming device; A first reading module is configured to read target encrypted data corresponding to a target data address in the data acquisition request from a first storage area; A first calculation module, configured to calculate the target encrypted data based on a preset hash algorithm to obtain a first binary data sequence; A second calculation module is configured to perform a truncation process of a preset number of bits on the first data sequence to obtain a second data sequence; A second reading module is configured to read the first target decrypted data corresponding to the second data sequence from a second storage area, wherein the second storage area stores the first decrypted data corresponding to the binary data sequence set within a preset number of bits; A data feedback module is configured to feed back the first target decrypted data to the image forming device.
9. A data decryption device, comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the data decryption method described in any one of claims 1-7.
10. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the data decryption method according to any one of claims 1 to 7 when executed by a computer processor.
Citation Information
Patent Citations
Storage data encryption and decryption device and method
CN107516047A
Information encryption method and device, medium and electronic equipment
CN113486379A
Data encryption transmission method and system, electronic equipment and storage medium
CN114520746A
Data encryption method and device, data decryption method and device and computer equipment
CN117240565A
Method and device for providing secure load sequence
JP2009080515A