Encryption device, decryption device, and encryption method
By introducing encryption and decryption mechanisms into the program, using system time and adjustment direction to form an encrypted array, the problem of unauthorized replication is solved, the system security is ensured and the device legality is verified.
Patent Information
- Application Number
- CN202311850724.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
In the prior art, programs are easily copied and used by unauthorized devices, affecting the interests of developers and system security.
Through the encryption device and the decryption device, the encrypted array is generated using system time and the encrypted array is formed, and the direction is adjusted to the encrypted array, ensuring that only the authorized device can decrypt and execute the simulated instructions.
Effectively prevent unauthorized program replication, ensure system security, and further verify the legitimacy of the device through hardware monitoring functions.
Smart Images

Figure CN120234783A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to encryption and decryption technologies, and particularly to an encryption device, a decryption device, and an encryption method. Background Art
[0002] With the progress of technology and the development of network technology, various programs and software with different functions are widely applied in daily life and various industries, greatly improving the quality of life or production efficiency. However, compared with hardware devices, programs can be easily copied and spread. If a company invests a high cost in developing a program and it is misappropriated by others without authorization, it will seriously affect the interests of the developer and may also affect system security. Therefore, how to prevent a program from being diverted to unauthorized devices has become a major issue at present. Summary of the Invention
[0003] The present disclosure relates to a decryption device, including a storage unit and a processing unit. The storage unit stores a simulation program and decryption data. The processing unit is coupled to the storage unit and is configured to run the simulation program according to a simulation instruction. When the processing unit receives the simulation instruction and an encryption key, the processing unit is configured to perform the following steps: obtaining an encryption array of the encryption key, where the encryption array includes a plurality of encrypted characters; identifying a plurality of fixed characters among the plurality of encrypted characters according to the decryption data; determining the number of adjustment times of the encryption array according to the plurality of fixed characters; rearranging the plurality of encrypted bits except the plurality of fixed characters according to the number of adjustment times to restore the encryption array to an original array; obtaining a decryption key according to the original array, and executing the simulation instruction.
[0004] In an embodiment, the processing unit is configured to identify a value formed by the plurality of fixed characters and determine the number of adjustment times of the encryption array according to the value.
[0005] In an embodiment, the decryption data includes a plurality of fixed positions, and the processing unit is configured to identify the plurality of fixed characters from the encryption array according to the plurality of fixed positions.
[0006] In an embodiment, the decryption data further includes at least one adjustment direction, and the processing unit is configured to restore the encryption array to the original array according to the adjustment direction and the number of adjustment times.
[0007] In an embodiment, at least one adjustment direction includes a first direction and a second direction, and the processing unit is configured to displace a first part of the plurality of encrypted characters along the first direction and displace a second part of the plurality of encrypted characters along the second direction, where neither the first part nor the second part includes the plurality of fixed characters.
[0008] In one embodiment, the decrypted data further includes a plurality of key positions, and the processing unit is configured to identify the decryption key from the original array according to the plurality of key positions.
[0009] In one embodiment, the decrypted data further includes a verification key. When the processing unit determines that the decryption key is the same as the verification key, the processing unit executes the simulation instruction.
[0010] The present disclosure also relates to an encryption device, including a storage unit and a processing unit. The storage unit stores encrypted data, where the encrypted data includes a plurality of key characters. The processing unit is coupled to the storage unit and is configured to perform the following steps: generate a plurality of encoded characters according to the system time; use the plurality of key characters and the plurality of encoded characters as a plurality of encrypted characters to arrange them into an original array, where a first part of the plurality of encrypted characters is a plurality of fixed characters; adjust the positions of the plurality of encrypted bits except the plurality of fixed characters according to at least one adjustment direction to convert the original array into an encrypted array; and transmit the encrypted array and the simulation instruction to the decryption device.
[0011] In one embodiment, a part of the plurality of encoded characters serves as the plurality of fixed characters, and none of the plurality of fixed characters includes any of the plurality of key characters.
[0012] In one embodiment, the plurality of fixed characters are not in the same row and the same column in the original array.
[0013] In one embodiment, at least one adjustment direction includes a first direction and a second direction, and the processing unit is configured to displace a second part of the plurality of encrypted characters along the first direction and displace a third part of the plurality of encrypted characters along the second direction.
[0014] In one embodiment, the encrypted data further includes a plurality of key positions, and the processing unit is configured to set the positions of the plurality of key characters in the original array according to the plurality of key positions.
[0015] In one embodiment, the encrypted data further includes operation parameters, and the processing unit is configured to perform an operation on the operation parameters and the system time to generate the plurality of encoded characters.
[0016] The present disclosure also relates to an encryption method, including: generating, by an encryption device, a plurality of encoded characters according to the system time; using a plurality of key characters and the plurality of encoded characters as a plurality of encrypted characters to arrange them into an original array, where a first part of the plurality of encrypted characters is a plurality of fixed characters; adjusting the positions of the plurality of encrypted bits except the plurality of fixed characters according to at least one adjustment direction to convert the original array into an encrypted array; and transmitting the encrypted array and the simulation instruction to the decryption device.
[0017] In one embodiment, a part of the plurality of encoded characters serves as the plurality of fixed characters, and none of the plurality of fixed characters includes any of the plurality of key characters.
[0018] In one embodiment, a method of arranging the plurality of key characters and the plurality of encoded characters as the plurality of encrypted characters into an original array includes: setting positions of the plurality of fixed characters in the original array such that the plurality of fixed characters are not in the same row and the same column of the original array.
[0019] In one embodiment, at least one adjustment direction includes a first direction and a second direction, and a method of adjusting positions of the plurality of encrypted bits except the plurality of fixed characters according to the at least one adjustment direction includes: displacing a second part of the plurality of encrypted characters along the first direction and displacing a third part of the plurality of encrypted characters along the second direction.
[0020] In one embodiment, the first direction and the second direction are parallel to each other, but displacement directions of the second part and the third part of the plurality of encrypted characters are opposite.
[0021] In one embodiment, a method of generating the plurality of encoded characters includes: performing an operation on the system time according to operation parameters to generate the plurality of encoded characters.
[0022] In one embodiment, a method of performing an operation on the system time according to operation parameters includes: dividing the system time by the operation parameters and using the remainder to generate the plurality of encoded characters.
[0023] Accordingly, by setting an encryption and decryption mechanism in a control program or a simulation program, it is possible to prevent others from privately copying the control program or the simulation program to other devices for use without authorization, thereby avoiding program piracy and ensuring system security at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 FIG. is a schematic diagram of a simulation system according to some embodiments of the present disclosure;
[0025] Figure 2 FIG. is a schematic diagram of a simulation system according to some embodiments of the present disclosure;
[0026] Figure 3A FIG. is a schematic diagram of an encryption method according to some embodiments of the present disclosure;
[0027] Figure 3B FIG. is a schematic diagram of a decryption method according to some embodiments of the present disclosure;
[0028] Figure 4Schematic diagram of the original array according to some embodiments of the present disclosure;
[0029] Figures 5A - 5B Schematic diagram of the original array according to some embodiments of the present disclosure;
[0030] Figure 6 Schematic diagram of the encrypted array according to some embodiments of the present disclosure.
[0031] [Symbol description]
[0032] DH: Control host
[0033] DS: Simulator
[0034] PS: Simulation program
[0035] PC: Control program
[0036] D01: Encrypted data
[0037] D02: Decrypted data
[0038] 100: Simulation system
[0039] 111: Processing unit
[0040] 112: Storage unit
[0041] 113: Input unit
[0042] 114: Display unit
[0043] 121: Processing unit
[0044] 122: Storage unit
[0045] 400: Original array
[0046] 401: Key position
[0047] 402: Fixed position
[0048] 501: Vertical column
[0049] 502: Horizontal row
[0050] 503: Part
[0051] 504: Part
[0052] 600: Encrypted array
[0053] 601: Fixed position
[0054] 602: Part
[0055] 603: Part
[0056] S301 - S305: Steps
[0057] S301 - S311: Steps Detailed implementation manners
[0058] The following will disclose multiple implementation manners of the present invention with the accompanying drawings. For the sake of clear illustration, many practical details will be described together in the following narration. However, it should be understood that these practical details are not used to limit the present invention. That is to say, in some implementation manners of the present invention, these practical details are not necessary. In addition, for the purpose of simplifying the drawings, some conventional structures and elements will be shown in a simple schematic manner in the drawings.
[0059] In this article, when an element is referred to as "connected" or "coupled", it may refer to "electrically connected" or "electrically coupled". "Connected" or "coupled" can also be used to indicate the mutual cooperation operation or interaction between two or more elements. In addition, although terms such as "first", "second",... are used in this article to describe different elements, this term is only used to distinguish elements or operations described with the same technical term. Unless clearly specified in the context, this term does not specifically refer to or imply an order or sequence, nor is it used to limit the present invention.
[0060] Figure 1 Shown is a schematic diagram of a simulation system 100 according to some embodiments of the present disclosure. The simulation system 100 includes a control host DH and a simulation machine DS. The control host DH can be a server, a computer, or other electronic devices capable of generating simulation instructions. The simulation machine DS is an electronic device installed with a simulation program PS and is communicatively connected to the control host DH. The simulation machine DS can receive simulation instructions from the control host DH and execute the simulation program PS according to the simulation instructions.
[0061] In one embodiment, a control program PC is installed in the control host DH. The user can input a control signal through an input device (such as a keyboard, a touch screen) to generate simulation instructions through the control program PC. In some embodiments, the operating system of the simulation machine DS is relatively closed (such as Linux), while the operating system of the control host DH is relatively open (such as Windows). Therefore, the user can remotely operate the simulation machine DS through the control host DH.
[0062] The simulation program PS has multiple arithmetic expressions or arithmetic models to perform specific operations according to the received simulation instructions, and the simulation machine DS will transmit the operation results back to the control host DH. For example, the simulation instruction provided by the control host DH can be the "throttle instruction of the vehicle". The control host DH uses the "throttle instruction of the vehicle" as input data, and uses the simulation model pre-established in the simulation program PS to calculate the "operating state of the vehicle's motor", and transmits the calculation result back to the control host DH, so that the control host DH or the user can judge whether the operating state of the motor meets the safety range or is consistent with the expected result.
[0063] In some embodiments, the simulation machine DS can also be coupled to one or more test devices. Taking the aforementioned simulation instruction as the "throttle instruction of the vehicle" as an example, the simulation machine DS can be coupled to devices such as motors and axles, as well as multiple sensors. Therefore, the simulation machine DS can generate control instructions according to the simulation instructions (such as: the voltage provided to the motor, or the torque provided to the axle), so that test devices such as motors and axles can operate according to the set conditions. Then, the simulation machine DS receives the operating states of test devices such as motors and axles through the sensors, and transmits the simulation results back to the control host DH.
[0064] The simulation instructions and the simulation program PS are not limited to the aforementioned examples. In other embodiments, the simulation instructions can also be driving behavior commands or vehicle steering commands, etc. In addition, the simulation target of the simulation program PS is not limited to simulating "vehicles", and can also be various different fields such as power supply equipment, network equipment, and security monitoring systems.
[0065] Since the control program PC in the control host DH and the simulation program PS in the simulation machine DS may both be copied and applied to other systems without the authorization of the operator of the simulation system 100. Therefore, in some embodiments of the present disclosure, an encryption and decryption mechanism is added to the control host DH and the simulation machine DS to protect the security of the control program PC and the simulation program PS.
[0066] Figure 2 Shown is a schematic diagram of a simulation system 100 according to some embodiments of the present disclosure. The simulation system 100 includes an encryption device 110 and a decryption device 120. Among them, the encryption device 110 can be Figure 1 the control host DH or a part thereof in Figure 1 the simulation machine DS or a part thereof in.
[0067] The encryption device 110 includes a processing unit 111 and a storage unit 112. The processing unit 111 is coupled to the storage unit 112, and the storage unit 112 is used to store the control program PC. In one embodiment, the encryption device 110 may be coupled to or include an input unit 113 (such as input devices like keyboards, mice, etc.) and a display unit 114 (such as a display panel).
[0068] The decryption device 120 includes a processing unit 121 and a storage unit 122. The processing unit 121 is coupled to the storage unit 122, and the storage unit 122 is used to store the simulation program PS. In one embodiment, the decryption device 120 may also be coupled to a plurality of test devices and a plurality of sensors (not shown in the figure) to drive the test devices and obtain the operating status of the test devices through the sensors.
[0069] In one embodiment, the encryption device 110 and the decryption device 120 have a communication module or communication circuit (not shown in the figure) to enable a communication connection to be established between them. Since those skilled in the art can understand the data transmission methods between devices, it will not be elaborated herein.
[0070] The processing unit 111 / 121 is used to perform various operations, which may include but are not limited to the integration of a single processor and multiple microprocessors. The processing unit 111 may be implemented as a central processing unit (CPU), a system on chip (SoC), an application processor, a digital signal processor, or a processing chip or controller with specific functions.
[0071] The storage unit 112 / 122 may include but are not limited to flash memory, hard disk drive (HDD), solid state drive (SSD), dynamic random access memory (DRAM), static random access memory (SRAM), or non-transitory computer-readable media.
[0072] In one embodiment, the encryption device 110 (control host DH) and the decryption device 120 (simulation machine DS) store encrypted data D01 and decrypted data D02 respectively. The encrypted data D01 and the decrypted data D02 have the same verification key respectively.
[0073] Continuing from the above, the encryption device 110 transmits simulation instructions and the encrypted verification key (encryption key) to the decryption device 120. When the decryption device 120 receives the simulation instructions and the encryption key, the decryption device 120 decrypts the encryption key. If the decrypted key is the same as the verification key in the decrypted data D02, the decryption device 120 will execute the simulation instructions.
[0074] Therefore, in the simulation system 100, if either the encryption device 110 or the decryption device 120 is missing, the simulation system 100 will not be able to operate correctly. In other words, if the control program PC or the simulation program PS is copied and used in other systems without authorization, the control program PC or the simulation program PS alone cannot be executed correctly. In addition, in some embodiments, the control program PC and the simulation program PS also have a hardware monitoring function. That is, the control program PC will record the internal hardware of the encryption device 110 (such as: recording the machine code). Therefore, if the control program PC is copied to other devices, the control program PC will determine that the hardware of other devices does not match that of the encryption device 110 and will not operate properly (such as: it can be designed to directly generate an incorrect key). Similarly, if the simulation program PS determines that the hardware of the device where it is located is not the decryption device 120, it will also not operate correctly.
[0075] The following begins to describe some embodiments of the encryption mechanism and the decryption mechanism. FIGS. 3A and 3B show the operation flowcharts of the simulation system according to some embodiments of the present disclosure, where Figure 3A is used to illustrate the encryption method, Figure 3B while is used to illustrate the decryption method. In step S301, the encryption device 110 runs the control program PC and obtains a plurality of key characters from the storage unit 112. As described above, in one embodiment, when the encryption device 110 runs the control program PC, the control program PC can automatically detect the hardware configuration of the encryption device 110 (such as: judging the machine code) to confirm whether the encryption device 110 is an authorized device.
[0076] In one embodiment, the key characters can be combined into a sixteen-bit code. During the encryption process, the key characters can be divided into two groups of eight-bit codes, for example, into group A key characters "A0 to A7" and group B key characters "B0 to B7". After these two groups of key characters are combined, they can be interpreted as the correct verification key. However, it should be particularly noted that the length and format of the key characters can be adjusted arbitrarily according to requirements, for example, they can be eight-bit or four-bit codes, and there is no need to be split into two groups.
[0077] In step S302, the processing unit 111 of the encryption device 110 generates a plurality of encoded characters according to the system time. For example: the processing unit 111 can perform an operation on the system time and a preset operation parameter to generate encoded characters (for example: using the remainder of the division of the two to generate encoded characters). The "encoded characters" here are used to complicate the data, but are not used as key characters for identifying correctness, so the actual content of the encoded characters is irrelevant. The "system time" is the time parameter in the encryption device 110, and this time can be set manually or obtained from the outside (for example: connected to the network to obtain the current time according to the time zone).
[0078] In one embodiment, the control program PC is provided with a method for generating encoded characters. The processing unit 111 first generates one or more variables according to the system time, and then generates a plurality of redundant characters according to these variables. Then, the processing unit 111 generates encoded characters according to the redundant characters. For example, the encrypted data D01 includes one or more operation parameters. The processing unit 111 first performs an operation on the "current system time" and the operation parameters to generate four variables, herein referred to as "TA to TD", respectively:
[0079]
[0080] After generating the foregoing four variables, according to the foregoing four variables "TA to TD", the processing unit 111 performs an operation to generate multiple groups of different redundant characters. In one embodiment, the processing unit 111 needs to generate a total of 48 redundant characters (but the present disclosure is not limited thereto), which are respectively group C redundant characters "C0 to C15", group D redundant characters "D0 to D15", and group E redundant characters "E0 to E15". The generation methods of these three groups of redundant characters are as follows:
[0081] Redundant characters Generation method Group C redundant characters Group A key characters × 2 + Group B key characters + TC Group D redundant characters Group A key characters + Group B key characters × 3 + TD Group E redundant characters Obtained after the operation of Group A - B key characters and Group C - D redundant characters
[0082] The generation method of the foregoing group E redundant characters can be generated by performing a cyclic redundancy check (CRC) on the group A to B key characters and the group C to D redundant characters. "Cyclic redundancy check" is a hash function that generates a short and fixed-bit verification code according to a data packet or a computer file. Cyclic redundancy check is often used to detect or verify whether there are errors in data transmission, but in this embodiment, the result of the cyclic redundancy check is used as a new group of redundant characters. As described above, the group C to E redundant characters are used to complicate the encrypted data, so the actual content does not affect the interpretation of the encryption key.
[0083] Continuing from the above, the group C to E redundant characters will each be encoded with 16 bits, and the processing unit 111 will delete a part of these redundant characters and generate the same number of group F fixed characters (the meaning of the fixed characters will be described in detail later). In one embodiment, one or more redundant characters in the group E redundant characters will be deleted, and the generation method of the group F fixed characters is the "quotient of TB / 10", and the operation parameter "10" can be changed according to the design requirements. In this embodiment, the "quotient of TB / 10" will be a five-bit code. In other words, five redundant bits of the group E redundant characters will be deleted.
[0084] In step S303, the processing unit 111 uses the key characters and the encoded characters as encrypted characters, and arranges the encrypted characters into an original array. Figure 4FIG. 0 is a schematic diagram of the original array 400 according to some embodiments of the present disclosure. In one embodiment, the original array 400 is an 8×8 matrix array, but the present disclosure is not limited thereto, and the original array can also be designed as an array of other sizes.
[0085] The encrypted data D01 contains the configuration of the original array 400, so that the processing unit 111 can place encrypted characters at various positions of the original array 400 according to the configuration. As Figure 4 shown, the "configuration" may include the key positions 401 and the fixed positions 402, so that the processing unit 111 can fill in the key characters and the fixed characters according to the key positions and the fixed positions. As described above, a part of the encrypted characters will be fixed characters (i.e., the F group of fixed characters). In one embodiment, the fixed characters do not contain any key characters.
[0086] As Figure 4 shown, in this embodiment, the fixed characters "F0~F4" replace the redundant characters "E1, E2, E7, E13, E14". In addition, although in the Figure 4 embodiment shown, the fixed characters "F3, F4" are adjacent and in the same row, but in other embodiments, the fixed characters are set to be non-adjacent to each other and not arranged in the same column or the same row of the original array 400 (e.g., the fixed characters "F2, F4") to increase the difficulty of being cracked.
[0087] In step S304, after generating the original array 400, the processing unit 111 changes the positions of "other encrypted bits except the fixed characters" in the original array 400 according to the adjustment data in the encrypted data D01 to convert the original array 400 into an encrypted array.
[0088] In one embodiment, the adjustment data includes at least one adjustment direction. For example, the adjustment data is "other encrypted bits except the fixed characters are moved to the left". The adjustment data may not need to set the number of adjustments, because the decryption device 120 can infer the number of adjustments by itself. The decryption method will be described in the following paragraphs.
[0089] In other embodiments, the adjustment data may include multiple adjustment directions, adjustment orders, and adjustment times. For example, the adjustment data can be "other encrypted bits except the fixed characters are first moved to the left three times and then moved up five times".
[0090] Figures 5A - 5B FIG. 25 is a partial embodiment according to the present disclosure to illustrate the adjustment method of the original array 400. As Figure 5AAs shown, the original array 400 includes a plurality of vertical columns 501 and a plurality of horizontal rows 502. The adjustment direction in the encrypted data D01 corresponds to the vertical direction or the horizontal direction, and the processing unit 111 is used to adjust the positions of the encrypted bits except for the fixed characters according to the adjustment direction.
[0091] For example, if the adjustment direction is "move the encrypted characters in each vertical column 501 to the right", the processing unit 111 will move the encrypted bits except for the fixed characters to the right. As Figure 5A shown, the encrypted character "D1" will be moved to the original position of "C14", and the rightmost encrypted character "D12" will be moved to the original position of the leftmost encrypted character "D8". In addition, to the right of the encrypted character "D0" is the fixed character "F3", so the encrypted character "D0" will skip the fixed character and be directly moved to the original position of the encrypted character "D4".
[0092] As Figure 5B shown, the original array 400 is divided into two different parts 503 and 504, and the encrypted data D01 includes different directions corresponding to the different parts. The processing unit 111 displaces the "encrypted characters in each horizontal row 502" in part 503 in the first direction (such as Figure 5B shown, upward), and displaces the "encrypted characters in each horizontal row 502" in part 504 in the second direction (such as Figure 5B shown, downward). The first direction and the second direction are parallel to each other, but the displacement directions of parts 503 and 504 are opposite.
[0093] As mentioned above, the movement of parts 503 and 504 does not include fixed characters. As Figure 5B shown, the encrypted character "A2" will be moved to the original position of "D1", and above the encrypted character "C14" is the fixed character "F3", so the encrypted character "C14" will skip the fixed character and be moved to the bottom of part 503, that is, the original position of the encrypted character "A3".
[0094] Similarly, the encrypted character "B5" will be moved to the original position of "D6", and below the encrypted character "C15" is the fixed character "F0", so the encrypted character "C15" will skip the fixed character and be moved to the bottom of part 503, that is, the original position of the encrypted character "A4".
[0095] Figure 5A And Figure 5B shown adjustment methods can be used alone or in combination. That is, the encryption device 110 can move the encrypted bits except for the fixed characters along a specific direction according to the Figure 5A way, or according to the Figure 5BIn this way, the encrypted bits other than the fixed characters are divided into multiple parts and then displaced along different directions respectively. In addition, the encryption device 110 can also first adjust the original array 400 in the Figure 5A way, and then continue to adjust the original array 400 in the Figure 5B way.
[0096] In addition, it should be particularly mentioned here that although the encryption device 110 does not change the positions of the fixed characters, since the generation method of the fixed characters is related to the "system time", the values of all the encoded characters (including the fixed characters) in the original array 400 will change with time until the encryption device 110 converts the original array 400 into an encrypted array and transmits it to the decryption device 120 as the encryption key.
[0097] The encrypted array 600 adjusted by the foregoing method is as shown in Figure 6 In step S305, after the original array 400 is adjusted to the encrypted array 600, the processing unit 111 will send the encrypted array 600 and the simulation instruction to the decryption device 120. In one embodiment, the processing unit 111 converts the encrypted array into the "double-precision floating-point" format to provide it to the decryption device 120 as the encryption key. Since those skilled in the art can understand the method of transmitting array data, it will not be elaborated here.
[0098] The decryption method of the decryption device 120 will be described below. Please refer to FIGS. 3B and 6. In step S306, the decryption device 120 runs the simulation program and establishes a communication connection with the encryption device 110 to receive the simulation instruction and the encryption key transmitted by the encryption device 110. The decryption device 120 will restore the format of the encryption key to an array to obtain the encrypted array 600. The characters in each field of the encrypted array 600 are referred to as "encrypted characters" here.
[0099] In step S307, the processing unit 121 of the decryption device 120 identifies a plurality of fixed characters among all the encrypted characters according to the decryption data D02. For example, the processing unit 121 can identify a plurality of fixed characters (i.e., the fixed characters "F0 to F4") in the encrypted array 600 according to the plurality of encrypted positions recorded in the decryption data D02. In addition to indicating the field positions of the encrypted array 600, the encrypted positions also record the order between the encrypted positions. In other words, the processing unit 121 can identify and combine the encrypted characters "F0 to F4" according to the encrypted positions.
[0100] In step S308, the processing unit 121 determines the number of adjustments of the encryption array 600 according to the multiple fixed characters. Here, the "number of adjustments" refers to the number of times the characters in the array are moved during the process of converting the original array 400 into the encryption array 600. Specifically, the decryption data D02 records the generation methods of the encoded characters, such as the generation methods of the foregoing variables TA to TD, and the generation methods of the redundant characters in groups C to D. Therefore, the processing unit 121 can know the number of adjustments of the encryption array 600 from the original array 400 according to the fixed characters.
[0101] Here, a method for the decryption device 120 to "deduce the number of adjustments based on fixed bits" is described. First, in the foregoing embodiments, the generation methods of the variable TB and the F groups of fixed characters have been mentioned:
[0102] Variable TA The integer part of the system time (discarding the decimal part) Variable TB The remainder after dividing TA by a specific parameter, e.g., the remainder of TA / 240 Group F fixed characters The quotient after dividing TB by a specific parameter, e.g., the quotient of TB / 10
[0103] As can be seen from the above table, in this embodiment, the value of the variable TB will be between 0 and 239, and the F groups of fixed characters will be between 0 and 23. In other words, there are only 24 variations of the F groups of fixed characters. The processing unit 121 of the decryption device 120 can interpret / identify the value formed by the F groups of fixed characters (such as the value represented by eight binary codes), and then determine the number of adjustments according to the value. Specifically, the generation methods of the variable TB and the F groups of fixed characters are recorded in the decryption data D02. The processing unit 121 of the decryption device 120 can interpret the F groups of fixed characters and use the value formed by the F groups of fixed characters as the aforementioned "number of adjustments".
[0104] Continuing from the above, since the value of the key character itself does not change over time and the redundant characters in groups C to D do not need to be interpreted, therefore, as long as the number of adjustments is deduced, it can be used to restore the original array 400.
[0105] In step S309, after determining the number of adjustments, the processing unit 121 rearranges the encrypted bits except for the fixed characters according to the number of adjustments to restore the encryption array 600 to the original array 400.
[0106] In one embodiment, the decryption data D02 includes adjustment data, and the adjustment data is used to record at least one adjustment direction of the original array or record at least one restoration direction. For example: if the adjustment data is "the other encrypted bits except for the fixed characters are moved to the left", then the adjustment direction is "left", and the restoration direction is "right". Therefore, the processing unit 121 can restore the encryption array 600 to the original array 400 according to the adjustment direction (or restoration direction) and the number of adjustments.
[0107] In other embodiments, the adjustment data may include multiple adjustment directions, and each adjustment direction may also correspond to an adjustment order and an adjustment number of times. For example, the adjustment data may be "other encrypted bits except for fixed characters, first move three times to the left and then move five times upward".
[0108] Please refer to Figure 4 , Figure 5B and Figure 6 , similar to Figure 5B , the processing unit 121 can identify different parts of the encryption array 600 according to the decryption data D02, for example, divided into a first part 602 (upper half) and a second part 603 (lower half), and these parts 602, 603 do not contain fixed characters. According to the adjustment data of the decryption data D02, the processing unit 121 is used to displace / restore the first part 602 along the first direction and displace / restore the second part 603 in the second direction to restore the encryption array 600 to the original array 400.
[0109] For example, the processing unit 121 has confirmed that the number of adjustment times is "4 times" in step S308, and the processing unit 121 also knows the adjustment method is "right, right, simultaneously up and down" according to the adjustment data of the decryption data D02. Then the processing unit 121 can confirm the adjustment method of the original array 400 as: "All move two times straight to the right, the upper half moves up once, and the lower half moves down once". After confirming the adjustment method, only by operating in the reverse direction can the restoration be completed. Therefore, the restoration method will be "the upper half moves down once, the lower half moves up once, and finally all move two times straight to the left".
[0110] Continuing from the above, please refer to Figure 4 and Figure 6 as shown. According to the aforementioned restoration method, the encrypted character "A01" in the encryption array 600 will first move down and then move left two times. Since the encrypted character "A01" is at the bottom of the first part 602 of the encryption array 600, therefore, the encrypted character "A01" should return to the top of the first part 602, but skip the fixed character "F3" and be in the original position of the encrypted character "D9". Then, move left two more times to adjust to the original position of the encrypted character "E8", and this position is consistent with Figure 4 the original array 400 in
[0111] In step S310, after restoring the encryption array 600 to the original array 400, the processing unit 121 is used to identify the key bits in the original array 400 according to the key position in the decryption data D02 as the decryption key.
[0112] In step S311, the processing unit 121 determines whether the decrypted decryption key is the same as the verification key in the decrypted data D02. Only when the decryption key is the same as the verification key in the decrypted data D02, will the processing unit 121 execute the simulation instruction and run the simulation program PS according to the simulation instruction.
[0113] The present disclosure uses the system time to generate encoded characters, and mixes the encoded characters with key characters to form an encryption key. Since the encoded characters are not required for decryption, it is possible to complicate the encryption key while ensuring the accuracy and correctness during decryption.
[0114] The encryption method and decryption method of the present disclosure can cooperate with each other. In data transmission, the transmitting party (such as Figure 1 the control host DH shown or Figure 2 the encryption device 110 shown) and the receiving party (such as Figure 1 the simulation machine DS shown or Figure 2 the decryption device 120 shown) must have corresponding encryption and decryption methods, otherwise they cannot run independently. Therefore, if someone privately copies the simulation program PS to other machines, the simulation instruction will not be executed because the encryption key cannot be decrypted. On the contrary, if someone privately copies the control program PC to other hosts, even if a simulation instruction is sent to the simulation machine DS, the simulation machine DS will not execute the simulation instruction accordingly.
[0115] In addition, the foregoing encryption / decryption mechanism can also be combined with a hardware detection function, that is, the simulation program PS / control program PC will determine whether the current hardware configuration matches the preset configuration. If the hardware configuration does not match, the simulation program PS / control program PC will not run properly either.
[0116] The various elements, method steps or technical features in the foregoing embodiments can be combined with each other, and are not limited to the order of the text description or the order of the drawings in the present disclosure.
[0117] Although the present disclosure has been disclosed as above in the form of embodiments, it is not intended to limit the present disclosure. Any person skilled in this art can make various changes and modifications without departing from the spirit and scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to that defined by the appended claims.
Claims
1. A decryption device, characterized in that, Comprising: A storage unit storing a simulation program and a decryption data; and A processing unit coupled to the storage unit and configured to run the simulation program according to a simulation instruction; Wherein when the processing unit receives the simulation instruction and an encryption key, the processing unit is configured to perform the following steps: Obtain an encryption array of the encryption key, wherein the encryption array includes a plurality of encrypted characters; Identify a plurality of fixed characters among the plurality of encrypted characters according to the decryption data; Confirm an adjustment count of the encryption array according to the plurality of fixed characters; Rearrange the plurality of encrypted bits except the plurality of fixed characters according to the adjustment count to restore the encryption array to an original array; Obtain a decryption key according to the original array and execute the simulation instruction.
2. The decryption device according to claim 1, wherein The processing unit is configured to identify a value formed by the plurality of fixed characters and confirm the adjustment count of the encryption array according to the value.
3. The decryption device according to claim 1, wherein, The decryption data includes a plurality of fixed positions, and the processing unit is configured to identify the plurality of fixed characters from the encryption array according to the plurality of fixed positions.
4. The decryption device according to claim 1, wherein The decryption data further includes at least one adjustment direction, and the processing unit is configured to restore the encryption array to the original array according to the at least one adjustment direction and the adjustment count.
5. The decryption device according to claim 4, characterized in that, The at least one adjustment direction includes a first direction and a second direction, and the processing unit is configured to displace a first portion of the plurality of encrypted characters along the first direction and displace a second portion of the plurality of encrypted characters along the second direction, and neither the first portion nor the second portion includes the plurality of fixed characters.
6. The decryption device according to claim 1, wherein The decryption data further includes a plurality of key positions, and the processing unit is configured to identify the decryption key from the original array according to the plurality of key positions.
7. The decryption device according to claim 1, wherein The decryption data further includes a verification key, and when the processing unit determines that the decryption key is the same as the verification key, the processing unit executes the simulation instruction.
8. An encryption device, characterized in that, Comprising: A storage unit storing an encrypted data, wherein the encrypted data includes a plurality of key characters; and A processing unit coupled to the storage unit and configured to perform the following steps: Generate a plurality of encoded characters according to a system time; Use the plurality of key characters and the plurality of encoded characters as a plurality of encrypted characters to arrange into an original array, wherein a first portion of the plurality of encrypted characters is a plurality of fixed characters; Adjust the positions of the plurality of encrypted bits except the plurality of fixed characters according to at least one adjustment direction to convert the original array into an encrypted array; and Transmit the encrypted array and a simulation instruction to a decryption device.
9. The encryption device according to claim 8, wherein A portion of the plurality of encoded characters serves as the plurality of fixed characters, and none of the plurality of fixed characters includes any of the plurality of key characters.
10. The encryption device according to claim 8, characterized in that, The plurality of fixed characters are not in the same row and the same column in the original array.
11. The encryption device according to claim 8, wherein The at least one adjustment direction includes a first direction and a second direction, and the processing unit is configured to displace a second portion of the plurality of encrypted characters along the first direction and displace a third portion of the plurality of encrypted characters along the second direction.
12. The encryption device according to claim 8, wherein, The encrypted data further includes a plurality of key positions, and the processing unit is configured to set the positions of the plurality of key characters in the original array according to the plurality of key positions.
13. The encryption device according to claim 8, characterized in that, The encrypted data further includes an operation parameter, and the processing unit is configured to perform an operation on the operation parameter and the system time to generate the plurality of encoded characters.
14. An encryption method, characterized in that, Including: Generating a plurality of encoded characters according to a system time through an encryption device; Taking the plurality of key characters and the plurality of encoded characters as a plurality of encrypted characters to be arranged into an original array, wherein a first part of the plurality of encrypted characters is a plurality of fixed characters; Adjusting the positions of the plurality of encrypted bits except the plurality of fixed characters according to at least one adjustment direction to convert the original array into an encrypted array; and Transmitting the encrypted array and an analog instruction to a decryption device.
15. The encryption method according to claim 14, wherein A part of the plurality of encoded characters serves as the plurality of fixed characters, and none of the plurality of fixed characters includes any of the plurality of key characters.
16. The encryption method according to claim 14, wherein The method of taking the plurality of key characters and the plurality of encoded characters as the plurality of encrypted characters to be arranged into the original array includes: Setting the positions of the plurality of fixed characters in the original array so that the plurality of fixed characters are not in the same row and the same column of the original array.
17. The encryption method according to claim 14, wherein The at least one adjustment direction includes a first direction and a second direction, and the method of adjusting the positions of the plurality of encrypted bits except the plurality of fixed characters according to the at least one adjustment direction includes: Displacing a second part of the plurality of encrypted characters along the first direction and displacing a third part of the plurality of encrypted characters along the second direction.
18. The encryption method according to claim 17, wherein The first direction and the second direction are parallel to each other, but the displacement directions of the second part and the third part of the plurality of encrypted characters are opposite.
19. The encryption method according to claim 14, characterized in that, The method of generating the plurality of encoded characters includes: Performing an operation on the system time according to an operation parameter to generate the plurality of encoded characters.
20. The encryption method according to claim 19, wherein The method of performing an operation on the system time according to the operation parameter includes: Dividing the system time by the operation parameter and using a remainder to generate the plurality of encoded characters.