Key generation method, apparatus, device, medium, and product
By dividing the key cube into sub-key cubes and generating keys using associated information, the problems of poor randomness and limited number of keys generated are solved, thereby improving the randomness and complexity of key generation.
Patent Information
- Application Number
- CN202511374674.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2045-09-25
AI Technical Summary
Existing key generation schemes suffer from poor randomness, low key complexity, and a limited number of keys that can be generated due to limitations in key generation methods.
By pre-constructing a target key cube, dividing it into multiple sub-key cubes, and generating a target key by sequentially selecting random number units based on the association information of the sub-key cubes, random numbers are selected from a target number of key cubes with equal data length using the association information between the sub-key cubes.
It improves the randomness and quantity of generated keys, increases key complexity, and enhances the flexibility and efficiency of key generation.
Smart Images

Figure CN120880661B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of information security technology, and in particular to a key generation method, apparatus, device, medium and product. Background Technology
[0002] With the development of the information industry, information security has become a key area of concern for information service providers. In order to improve information security, devices, software, hardware and / or data that serve as information carriers are usually encrypted.
[0003] In related technologies, keys can be generated by constructing a key cube, which mainly utilizes the random numbers on the surface of the key cube to generate keys.
[0004] However, the key generation schemes provided in related technologies suffer from poor randomness, low key complexity, and a limited number of keys that can be generated due to the limited number of faces of the key cube. Summary of the Invention
[0005] This disclosure is made in view of the above-mentioned problems. This disclosure provides a key generation method, apparatus, device, medium, and product that improves the randomness and quantity of keys that can be generated.
[0006] According to a first aspect of this disclosure, a key generation method is provided, comprising:
[0007] In response to receiving a key generation instruction, a pre-constructed target key cube is read, wherein the key generation instruction includes the data length of the target key to be generated, and the target key cube includes... The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. There are 1 random number unit, and each random number unit corresponds to a random number;
[0008] Based on the subkey cube association information, in the From each subkey cube, a random number is sequentially selected from any random number unit within the target number of subkey cubes to generate the target key. The subkey cube association information includes information related to the target key. Each subkey cube in the subkey cube is associated with multiple optional subkey cubes, wherein each optional subkey cube is a subkey cube that allows random number generation in the next iteration after a random number is selected in each subkey cube, and the target number is equal to the data length.
[0009] According to a second aspect of this disclosure, a key generation apparatus is provided, comprising:
[0010] The reading module is configured to read a pre-constructed target key cube in response to receiving a key generation instruction, wherein the key generation instruction includes the data length of the target key to be generated, and the target key cube includes... The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. There are 1 random number unit, and each random number unit corresponds to a random number;
[0011] The key generation module is configured to generate a key based on subkey cube association information, in the... From each subkey cube, a random number is sequentially selected from any random number unit within the target number of subkey cubes to generate the target key. The subkey cube association information includes information related to the target key. Each subkey cube in the subkey cube is associated with multiple optional subkey cubes, wherein each optional subkey cube is a subkey cube that allows random number generation in the next iteration after a random number is selected in each subkey cube, and the target number is equal to the data length.
[0012] According to a third aspect of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method of the first aspect.
[0013] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method described in the first aspect.
[0014] According to a fifth aspect of this disclosure, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in the first aspect.
[0015] The key generation method, apparatus, device, medium, and product provided in this disclosure can pre-construct a target key cube containing multiple random number units and divide the target key cube into multiple sub-key cubes. This allows for the selection of random numbers from a target number of key cubes of equal length to the data during the key generation process, based on the association information between the sub-key cubes. Since each sub-key cube also contains multiple random number units, the flexibility in selecting random numbers within each sub-key cube is greater. This not only increases the number of target keys that can be generated but also enhances the randomness of the generated target keys, thereby increasing the complexity of the generated target keys.
[0016] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description
[0017] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1 This is a flowchart of a key generation method according to an embodiment of the present disclosure.
[0019] Figure 2 This is one embodiment of the present disclosure. A schematic diagram of a standard random number matrix.
[0020] Figure 3 This is a schematic diagram of an initial key cube according to an embodiment of this disclosure.
[0021] Figure 4 This is a schematic diagram of a target key cube according to an embodiment of this disclosure.
[0022] Figure 5 This is a block diagram of a key generation apparatus according to an embodiment of the present disclosure.
[0023] Figure 6 This is a schematic diagram of a computer program product according to an embodiment of the present disclosure.
[0024] Figure 7 This is a hardware block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this disclosure more apparent, exemplary embodiments according to this disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments of this disclosure. It should be understood that this disclosure is not limited to the exemplary embodiments described herein.
[0026] Figure 1 The flowchart illustrates an exemplary embodiment of the present disclosure of a key generation method. This method can be applied to a terminal device, which may be a server, computer, laptop, tablet, or mobile phone, etc. Figure 1 As shown, the method in this embodiment of the disclosure may include:
[0027] Step S101: In response to receiving the key generation instruction, read the pre-constructed target key cube;
[0028] The key generation instruction includes the data length of the target key to be generated, and the target key cube includes... The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. There are 1 random number unit, and each random number unit corresponds to a random number;
[0029] Step S102, based on the subkey cube association information, in the From each subkey cube, a random number is sequentially selected from any random number unit within the target number of subkey cubes to generate the target key;
[0030] Wherein, the subkey cube association information includes, with the Each subkey cube in the subkey cube is associated with multiple optional subkey cubes, wherein each optional subkey cube is a subkey cube that allows random number selection in the next iteration after a random number is selected in each subkey cube, and the target number is equal to the data length.
[0031] In summary, the key generation scheme method provided in this disclosure can pre-construct a target key cube containing multiple random number units and divide the target key cube into multiple sub-key cubes. This allows for the selection of random numbers from a target number of key cubes of equal length to the data during the key generation process, based on the association information between the sub-key cubes. Since each sub-key cube also contains multiple random number units, the flexibility in selecting random numbers within each sub-key cube is greater. This not only increases the number of target keys that can be generated but also enhances the randomness of the generated target keys, thereby increasing the complexity of the generated target keys.
[0032] The following are Figure 1 The specific implementation methods of each step in the illustrated embodiment are described in detail below:
[0033] In step S101, the terminal device, in response to receiving the key generation instruction, reads the pre-constructed target key cube.
[0034] In this embodiment of the disclosure, the key generation instruction includes the data length of the target key to be generated. The unit of data length can be bytes, and the specific length can be determined based on the user's actual needs. This embodiment of the disclosure does not limit this. For example, the data length can be 8 bytes or 10 bytes.
[0035] It should be noted that the target key cube includes The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. Each random number unit corresponds to a random number; where m and n can be specification parameters of the target key cube, which can be determined based on actual needs, and this disclosure does not limit them.
[0036] It is understandable that before receiving the key generation instruction, the terminal device can build the target key cube in advance, so that in the key acquisition scenario, the key can be generated directly based on the pre-built target key cube, thereby improving the efficiency of target key generation.
[0037] In one alternative implementation, the process of the terminal device constructing the target key cube may include: in response to receiving a key cube construction instruction, generating a key cube based on a first specification parameter in the key cube construction instruction. A random number, and according to the... m random number matrices are constructed from a set of random numbers, wherein the random number matrices include... The random number units, The random numbers in each random number unit are different, and the random numbers in the random number units at the same position in the m random number matrices are different; then, the m random number matrices are stacked to obtain an initial key cube, and based on the... A random number is used to perform a random number deduplication check on each face of the initial key cube to obtain a deduplication result; further, if the deduplication result indicates that there is a key cube face to be processed on the initial key cube, then based on the... A target random number is determined by a set of random numbers on the cube of the key to be processed, wherein the cube of the key to be processed contains the same random number, and the target random number is the [missing information]. In a random number matrix, the random numbers not included on the key cube to be processed are selected. Finally, the positions of the identical random numbers and the target random number in the target random number matrix are swapped to obtain the target key cube, wherein the target random number matrix is the random number matrix containing the identical random numbers. After superimposing the constructed random number matrices into a key cube, the random numbers on each face of the key cube can be deduplicated to ensure the randomness of the random numbers in the random number units on each face of the constructed key cube, thereby ensuring the randomness of the random numbers in the random number units of each sub-key cube, further improving the randomness of the key generated based on the key cube.
[0038] It should be noted that, in this embodiment of the disclosure, the first rule parameter is a random number parameter, and the random number matrix specification parameter is m. Specifically, the first rule parameter can be determined based on actual needs, and this embodiment of the disclosure does not limit it; wherein, the terminal device can generate based on the first specification parameter. A random number, and according to the... The first specification parameter m can be used to construct m random number matrices. Specifically, the value of m can be determined based on actual needs, and this embodiment does not limit this. The number of bits in the random numbers can also be determined based on actual needs, and this embodiment does not limit this.
[0039] For example, assuming the first rule parameter is 16, the terminal device can generate 256 random numbers, and construct 16 rules based on these 256 random numbers. A random number matrix of specified size (containing 256 random number units), where random numbers can range from 0x00 to 0xFF; for example... Figure 2 As shown, Figure 2 An embodiment of this disclosure is shown. A random number matrix of specified specifications.
[0040] It is understood that, in the embodiments of this disclosure, the terminal device is based on the... The process of constructing an m random number matrix from a set of random numbers may include: repeating the process m times... A random number is randomly filled into... The process of generating m initial random number matrices is as follows: During the generation of the m random number matrices, the terminal device needs to ensure that the random numbers in the random number cells at the same position in the m random number matrices are different.
[0041] Another example is the initial key cube constructed by the terminal device based on the first rule parameter 16, such as... Figure 3 As shown, the initial key cube consists of 16... The random number matrix A1-A16 of the specified standard are superimposed to generate the key cube. If there are identical random numbers on the surface along the negative y-axis, assuming that the identical random numbers are random numbers x in the random number units of random number matrix A2 and random number matrix A12, and the target random number is determined to be y based on 256 random numbers, then the random numbers y and x in random number matrix A2 can be swapped; or, the random numbers y and x in random number matrix A12 can be swapped to obtain the target key cube.
[0042] In one optional implementation, after constructing the target key cube, the terminal device may further: divide the target key cube into segments based on the second specification parameter in the key cube construction instruction. Each subkey cube is first identified; then, subkey cubes adjacent to each subkey cube in terms of points, lines, and faces are determined, resulting in multiple optional subkey cubes associated with each subkey cube; finally, these are combined with... Each subkey cube is associated with multiple optional subkey cubes, yielding subkey cube association information. After constructing the target key cube, it can be divided into multiple subkey cubes. By utilizing the adjacency relationships between subkey cubes based on points, lines, and surfaces, the optional subkey cubes that can be used for random number selection in each subkey cube can be determined. This subkey cube association information facilitates rapid key cube generation during the key generation process.
[0043] It should be noted that in the embodiments of this disclosure, the second specification parameter is the partitioning specification parameter of the subkey cube. The second specification parameter can be n, and specifically, it can be determined based on actual needs. This embodiment of the disclosure does not limit this.
[0044] Based on the adjacency relationship between the surfaces of the subkey cubes and other subkey cubes, the multiple subkey cubes can be divided into a first subkey cube and a second subkey cube. Each face of the first subkey cube has an adjacent subkey cube, while at least one face of the second subkey cube does not have an adjacent subkey cube. The multiple optional subkey cubes associated with the first subkey cube include 26, while the multiple optional subkey cubes associated with the second subkey cube include 17.
[0045] For example, if the second specification parameter is 3, then the target key cube is divided into... Subkey cube, such as Figure 4 As shown, Figure 4 It shows a segmented into A schematic diagram of the target key cube of the sub-key cubes.
[0046] In one alternative implementation, the terminal device may read a pre-built target key cube in response to receiving a key generation instruction.
[0047] In step S102, the terminal device, based on the subkey cube association information, in the... From each of the subkey cubes, a random number is selected from any random number unit within the target number of subkey cubes to generate the target key.
[0048] In this embodiment of the disclosure, the subkey cube association information includes, with the Each subkey cube in the subkey cube is associated with multiple optional subkey cubes, wherein the optional subkey cubes are subkey cubes that allow random number generation in the next iteration after a random number is selected in each subkey cube.
[0049] Understandably, if the selected subkey cube is the first subkey cube, then the number of optional subkey cubes associated with the first subkey cube includes 26; if the selected subkey cube is the second subkey cube, then the number of optional subkey cubes associated with the second subkey cube includes 17.
[0050] In one alternative implementation, the terminal device, based on the subkey cube association information, in the... The process of generating the target key by sequentially selecting random numbers from any random number unit within the target number of subkey cubes in the subkey cubes includes: in the... Select any one of the subkey cubes to obtain the target subkey cube. Next, select a random number from any random number unit within the target subkey cube to obtain the random numbers to be combined. Then, query the subkey cube association information for multiple optional subkey cubes associated with the target subkey cube. Further, determine any one of the multiple optional subkey cubes associated with the target subkey cube as the updated target subkey cube, and repeat the above process by selecting a random number from any random number unit within the target subkey cube to obtain the random numbers to be combined, until the target number of random numbers to be combined are selected from the target number of subkey cubes. Finally, combine the target number of random numbers to be combined to obtain the target key. Based on the subkey cube association information, a target number of random numbers can be selected from multiple subkey cubes with a target number of subkey cubes of equal data length to generate the target key, ensuring the randomness and reliability of the generated key.
[0051] In one optional implementation, the process by which the terminal device combines the target number of random numbers to be combined to obtain the target key may include: combining the target number of random numbers to be combined in a random order to obtain the target key. The target number of random numbers to be combined, which are selected to be the same length as the data, can be randomly combined to further enhance the randomness of the obtained target key.
[0052] In one optional implementation, the process by which the terminal device combines the target number of random numbers to be combined to obtain the target key may include: combining the target number of random numbers to be combined in the order in which they were selected to obtain the target key.
[0053] For example, with the first rule parameter being 16, and the target key cube being divided into... In the case of multiple subkey cubes, if the data length is 8 bytes, and since the target key cube contains 4096 random number units, and there are 26 or 17 optional subkey cubes associated with each subkey cube, the terminal device can generate w keys, where...
[0054] ;
[0055] As can be seen, the target key cube can generate at least 28 trillion and at most 855 trillion keys for terminal devices, which greatly increases the number of keys that can be generated.
[0056] In an optional implementation, the terminal device may further: in response to receiving a key cube update instruction, construct an updated target key cube based on the updated first specification parameter and the updated second specification parameter in the key cube construction instruction, and determine the updated sub-key cube association information, wherein the updated first specification parameter is greater than the original first specification parameter, and the updated second specification parameter is greater than the original second specification parameter. If the number of keys that can be generated from the constructed target key cube still cannot meet the requirement for the number of random keys, it may be considered to increase the parameters used to construct the key cube and the parameters used to divide the key cube to construct a target key cube that can generate more keys for the terminal device.
[0057] An exemplary embodiment of this disclosure provides a key generation apparatus, which can be a terminal device or a chip applied to a terminal device. Figure 5 A schematic block diagram of the functional modules of a key generation apparatus according to an exemplary embodiment of the present disclosure is shown. Figure 5 As shown, the key generation device 500 includes:
[0058] The reading module 501 is configured to read a pre-constructed target key cube in response to receiving a key generation instruction, wherein the key generation instruction includes the data length of the target key to be generated, and the target key cube includes... The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. There are 1 random number unit, and each random number unit corresponds to a random number;
[0059] The key generation module 502 is configured to generate the key based on the subkey cube association information in the... From each subkey cube, a random number is sequentially selected from any random number unit within the target number of subkey cubes to generate the target key. The subkey cube association information includes information related to the target key. Each subkey cube in the subkey cube is associated with multiple optional subkey cubes, wherein each optional subkey cube is a subkey cube that allows random number generation in the next iteration after a random number is selected in each subkey cube, and the target number is equal to the data length.
[0060] Optionally, the key generation module 502 is configured to:
[0061] In the Select any subkey cube from the subkey cubes to obtain the target subkey cube;
[0062] Select a random number from any random number unit within the target subkey cube to obtain the random number to be combined, and query multiple optional subkey cubes associated with the target subkey cube in the subkey cube association information;
[0063] One of the multiple optional subkey cubes associated with the target subkey cube is determined as the updated target subkey cube, and a random number is selected from any random number unit in the target subkey cube to obtain the random number to be combined. The above process is repeated until the target number of random numbers to be combined are selected from the target number of subkey cubes.
[0064] The target key is obtained by combining the target number of random numbers to be combined.
[0065] Optionally, the key generation module 502 is configured to:
[0066] The target key is obtained by combining the target number of random numbers to be combined in a random order.
[0067] Optional, such as Figure 5 As shown, the key generation device 500 also includes a construction module 503, configured to:
[0068] In response to receiving the key cube construction instruction, generate a key cube based on the first specification parameter in the key cube construction instruction. A random number, and according to the... m random number matrices are constructed from a set of random numbers, wherein the random number matrices include... The random number units, The random numbers in each random number unit are different, and the random numbers in the random number units at the same position in the m random number matrices are different;
[0069] The m random number matrices are stacked to obtain the initial key cube, and based on the... A random number is used to check for duplicates on each face of the initial key cube to obtain the deduplication result;
[0070] If the deduplication result indicates that there is a key cube to be processed on the initial key cube, then based on the... A target random number is determined by a set of random numbers on the cube of the key to be processed, wherein the cube of the key to be processed contains the same random number, and the target random number is the [missing information]. The random number not included in the cubic aspect of the key to be processed in the random number;
[0071] The same random number and the target random number in the target random number matrix are swapped to obtain the target key cube, wherein the target random number matrix is the random number matrix containing the same random number.
[0072] Optionally, module 503 is also configured as follows:
[0073] Based on the second specification parameter in the key cube construction instruction, the target key cube is divided into Subkey cube;
[0074] Determine the subkey cubes that are adjacent to each subkey cube in terms of points, lines, and faces, to obtain multiple optional subkey cubes associated with each subkey cube;
[0075] Combination and Each subkey cube is associated with multiple optional subkey cubes, thus obtaining subkey cube association information.
[0076] Optional, such as Figure 5 As shown, the key generation device 500 also includes an update module 504, configured to:
[0077] In response to receiving a key cube update instruction, an updated target key cube is constructed based on the updated first specification parameter and the updated second specification parameter in the key cube construction instruction, and the updated sub-key cube association information is determined, wherein the updated first specification parameter is greater than the original first specification parameter, and the updated second specification parameter is greater than the original second specification parameter.
[0078] Exemplary embodiments of this disclosure also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the electronic device to perform a method according to an embodiment of this disclosure.
[0079] Exemplary embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to embodiments of this disclosure.
[0080] like Figure 6 As shown, an exemplary embodiment of this disclosure also provides a computer program product 600, including a computer program 601, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of this disclosure.
[0081] refer to Figure 7 The present invention describes a structural block diagram of an electronic device 700 that can serve as a terminal device of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0082] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the electronic device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0083] Multiple components in electronic device 700 are connected to I / O interface 705, including: input unit 706, output unit 707, storage unit 708, and communication unit 709. Input unit 706 can be any type of device capable of inputting information to electronic device 700. Input unit 706 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 707 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 708 may include, but is not limited to, disk and optical disk. Communication unit 709 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0084] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above. For example, in some embodiments, the methods of the exemplary embodiments of this disclosure can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 700 via ROM 702 and / or communication unit 709. In some embodiments, the computing unit 701 can be configured to perform the methods of the exemplary embodiments of this disclosure by any other suitable means (e.g., by means of firmware).
[0085] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0086] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0087] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0088] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0089] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0090] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this disclosure are performed, in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a terminal, a user equipment, or other programmable device. The computer program or instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center integrating one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive (SSD).
[0091] Although this disclosure has been described in conjunction with specific features and embodiments, it will be apparent that various modifications and combinations can be made therein without departing from the spirit and scope of this disclosure. Accordingly, this specification and drawings are merely exemplary illustrations of the disclosure as defined by the appended claims and are to be considered as covering any and all modifications, variations, combinations, or equivalents within the scope of this disclosure. It is obvious that those skilled in the art can make various alterations and modifications to this disclosure without departing from its spirit and scope. Thus, this disclosure is also intended to include any such modifications and modifications that fall within the scope of the claims of this disclosure and their equivalents.
Claims
1. A key generation method, characterized in that, include: In response to receiving a key generation instruction, a pre-constructed target key cube is read, wherein the key generation instruction includes the data length of the target key to be generated, and the target key cube includes... The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. There are 1 random number unit, and each random number unit corresponds to a random number; Based on the subkey cube association information, in the In each of the subkey cubes, a random number is sequentially selected from any random number unit within the target number of subkey cubes to generate the target key. The subkey cube association information includes information related to the target key. Each subkey cube in the subkey cube is associated with multiple optional subkey cubes. Each optional subkey cube is a subkey cube that allows random number generation in the next iteration after a random number is selected in each subkey cube. The target number is equal to the data length. The multiple optional subkey cubes associated with each subkey cube include subkey cubes that are adjacent to points, lines, and surfaces of each subkey cube. Wherein, the subkey cube association information is used in the In each of the sub-key cubes, random numbers are sequentially selected from any random number unit within the target number of sub-key cubes to generate the target key, including: In the Select any subkey cube from the subkey cubes to obtain the target subkey cube; Select a random number from any random number unit within the target subkey cube to obtain the random number to be combined, and query multiple optional subkey cubes associated with the target subkey cube in the subkey cube association information; Choose any one of the multiple optional subkey cubes associated with the target subkey cube as the updated target subkey cube, and select a random number from any random number unit within the target subkey cube to obtain the random number to be combined. Repeat the above process until the target number of random numbers to be combined are selected from the target number of subkey cubes. The target key is obtained by combining the target number of random numbers to be combined.
2. The key generation method as described in claim 1, characterized in that, The process of combining the target number of random numbers to be combined to obtain the target key includes: The target key is obtained by combining the target number of random numbers to be combined in a random order.
3. The key generation method as described in claim 1, characterized in that, include: In response to receiving the key cube construction instruction, generate a key cube based on the first specification parameter in the key cube construction instruction. A random number, and according to the... m random number matrices are constructed from a set of random numbers, wherein the random number matrices include... The random number units, The random numbers in each random number unit are different, and the random numbers in the random number units at the same position in the m random number matrices are different; The m random number matrices are stacked to obtain the initial key cube, and based on the... A random number is used to check for duplicates on each face of the initial key cube to obtain the deduplication result; If the deduplication result indicates that there is a key cube to be processed on the initial key cube, then based on the... A target random number is determined by a set of random numbers on the cube of the key to be processed, wherein the cube of the key to be processed contains the same random number, and the target random number is the [missing information]. Among the random numbers, the random numbers not included in the cubic aspect of the key to be processed; The same random number and the target random number in the target random number matrix are swapped to obtain the target key cube, wherein the target random number matrix is the random number matrix containing the same random number.
4. The key generation method as described in claim 3, characterized in that, The method further includes: Based on the second specification parameter in the key cube construction instruction, the target key cube is divided into Subkey cube; Combination and Each subkey cube is associated with multiple optional subkey cubes, thus obtaining subkey cube association information.
5. The key generation method as described in claim 4, characterized in that, The method further includes: In response to receiving a key cube update instruction, an updated target key cube is constructed based on the updated first specification parameter and the updated second specification parameter in the key cube construction instruction, and the updated sub-key cube association information is determined, wherein the updated first specification parameter is greater than the original first specification parameter, and the updated second specification parameter is greater than the original second specification parameter.
6. A key generation device, characterized in that, include: The reading module is configured to read a pre-constructed target key cube in response to receiving a key generation instruction, wherein the key generation instruction includes the data length of the target key to be generated, and the target key cube includes... The target key cube is divided into random number units and is divided into... Each of the subkey cubes includes a subkey cube. There are 1 random number unit, and each random number unit corresponds to a random number; The key generation module is configured to generate a key based on subkey cube association information, in the... In each of the subkey cubes, a random number is sequentially selected from any random number unit within the target number of subkey cubes to generate the target key. The subkey cube association information includes information related to the target key. Each subkey cube in the subkey cube is associated with multiple optional subkey cubes. Each optional subkey cube is a subkey cube that allows random number generation in the next iteration after a random number is selected in each subkey cube. The target number is equal to the data length. The multiple optional subkey cubes associated with each subkey cube include subkey cubes that are adjacent to points, lines, and surfaces of each subkey cube. Wherein, the subkey cube association information is used in the In each of the sub-key cubes, random numbers are sequentially selected from any random number unit within the target number of sub-key cubes to generate the target key, including: In the Select any subkey cube from the subkey cubes to obtain the target subkey cube; Select a random number from any random number unit within the target subkey cube to obtain the random number to be combined, and query multiple optional subkey cubes associated with the target subkey cube in the subkey cube association information; One of the multiple optional subkey cubes associated with the target subkey cube is determined as the updated target subkey cube, and a random number is selected from any random number unit in the target subkey cube to obtain the random number to be combined. The above process is repeated until the target number of random numbers to be combined are selected from the target number of subkey cubes. The target key is obtained by combining the target number of random numbers to be combined.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 5.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Magic cube-based random number generation device and method
CN116431100A