Key generation method and apparatus, and storage medium

By obtaining the random probability values ​​generated by the N-order target matrix, the unpredictability and susceptibility of existing key generation methods are solved, and a simple and secure key generation process is realized.

WO2024239894A1PCT designated stage expired Publication Date: 2024-11-28SHRONG ENERGY TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/089523
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-24
Filing Date
2024-04-24
Publication Date
2024-11-28

AI Technical Summary

Technical Problem

Existing key generation methods have problems such as poor unpredictability, susceptibility to electromagnetic interference and high complexity, especially the pseudo-random numbers generated based on algorithms are poor in security. Classical physical random numbers and quantum physical random numbers generators require additional physical circuits. And easily disturbed.

Method used

By obtaining the N-order target matrix, the sum of each row and/or column elements is 1, a random probability value corresponding to the matrix is ​​generated, a position identification number is determined, and a key sequence is generated based on the number of probability values, without additional circuits, The implementation is simple and unpredictable.

Benefits of technology

The generated key sequence is unpredictable and cannot be deciphered, simplifying the key generation process and ensuring the security of the key, avoiding electromagnetic interference and complexity problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024089523_28112024_PF_FP_ABST
    Figure CN2024089523_28112024_PF_FP_ABST
Patent Text Reader

Abstract

The present disclosure provides a key generation method and apparatus, and a storage medium. The key generation method comprises: acquiring an N-order target matrix, the sum of all elements in each row and / or column in the target matrix being 1; generating sets in one-to-one correspondence with rows and / or columns of the target matrix, the sets comprising N sub-intervals which are connected in sequence, and the sets covering [0,1]; generating random probability values in one-to-one correspondence with the rows and / or columns of the target matrix, and determining position identification numbers of the sub-intervals to which the random probability values belong in the sets corresponding to corresponding rows and / or columns; and generating a key sequence according to the number of random probability values corresponding to each position identification number.
Need to check novelty before this filing date? Find Prior Art

Description

Key generation method, device and storage medium

[0001] This disclosure is based on and claims the priority of Chinese patent application with application number 2023105935758, application date May 24, 2023, and application name “A key generation method, device and storage medium”. The entire content of the Chinese patent application is hereby introduced into this disclosure as a reference. Technical Field

[0002] The present disclosure relates to, but is not limited to, a key generation method, device, and storage medium. Background Art

[0003] Cryptography is an ancient discipline concerned with information confidentiality. Due to the widespread use of information transmission, storage, and processing in the modern information society, the need for information confidentiality is ubiquitous, making cryptographic technology even more crucial in today's society. In related technologies, a random number generator generates a key, which is then used to encrypt plaintext and decrypt ciphertext. To enhance key security, the random numbers used to generate the key must be unpredictable. This means that future random numbers cannot be inferred from previously generated random numbers. Furthermore, the keys generated from these random numbers must possess good statistical properties.

[0004] Summary of the Invention

[0005] The following is an overview of the subject matter described in detail in this disclosure. This overview is not intended to limit the scope of the claims.

[0006] The present disclosure provides a key generation method, device and storage medium.

[0007] According to a first aspect of an embodiment of the present disclosure, a key generation method is provided, the key generation method comprising:

[0008] Obtain an N-order target matrix, where the sum of all elements in each row and / or column of the target matrix is ​​1;

[0009] Generate a set corresponding one-to-one to rows and / or columns of the target matrix, wherein the set includes N subintervals connected in sequence and covers [0, 1].

[0010] Generate random probability values ​​corresponding one-to-one to the rows and / or columns of the target matrix, and determine the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding row and / or column;

[0011] A key sequence is generated according to the number of the random probability values ​​corresponding to each of the position identification numbers.

[0012] According to some embodiments of the present disclosure, generating a key sequence according to the number of random probability values ​​corresponding to each location identification number includes:

[0013] If the number of the random probability values ​​corresponding to the location identification number is greater than 0, the key value corresponding to the location identification number is 1;

[0014] If the number of the random probability values ​​corresponding to the location identification number is equal to 0, the key value corresponding to the location identification number is 0;

[0015] The key sequence is composed of key values ​​corresponding to all the position identification numbers arranged in sequence.

[0016] According to some embodiments of the present disclosure, the method further includes:

[0017] If the key sequence is reused, determining the number of 0s and the number of 1s in the key sequence, deleting key values ​​where one number is greater than the other, and obtaining a target key sequence, wherein the number of 0s and the number of 1s in the target key sequence are equal;

[0018] If the key sequence is not reused, the key sequence is determined to be the target key sequence.

[0019] According to some embodiments of the present disclosure, obtaining an N-order target matrix includes:

[0020] An N-order random unitary matrix is ​​generated, and the square of the modulus of an element at each position in the random unitary matrix is ​​determined as the element at the same position in the target matrix.

[0021] According to some embodiments of the present disclosure, obtaining an N-order target matrix includes:

[0022] An N-order random matrix is ​​generated, and the ratio of each element in the random matrix to the sum of all elements in the row and / or column where the element is located is determined as the element at the same position in the target matrix.

[0023] According to a second aspect of an embodiment of the present disclosure, a key generation device is provided, the key generation device comprising:

[0024] an acquisition module configured to acquire an N-order target matrix, wherein the sum of all elements in each row and / or column of the target matrix is ​​1;

[0025] A first generating module is configured to generate a set corresponding one-to-one to rows and / or columns of the target matrix, wherein the set includes N subintervals connected in sequence and covers [0, 1];

[0026] a sampling module configured to generate random probability values ​​corresponding one-to-one to rows and / or columns of the target matrix, and determine a position identification number of a subinterval to which the random probability value belongs in the set corresponding to the corresponding row and / or column;

[0027] The second generating module is configured to generate a key sequence according to the number of the random probability values ​​corresponding to each of the position identification numbers.

[0028] According to some embodiments of the present disclosure, the second generating module is further configured to:

[0029] If the number of the random probability values ​​corresponding to the location identification number is greater than 0, the key value corresponding to the location identification number is 1;

[0030] If the number of the random probability values ​​corresponding to the location identification number is equal to 0, the key value corresponding to the location identification number is 0;

[0031] The key sequence is composed of key values ​​corresponding to all the position identification numbers arranged in sequence.

[0032] According to some embodiments of the present disclosure, the second generating module is further configured to:

[0033] If the key sequence is reused, determining the number of 0s and the number of 1s in the key sequence, deleting key values ​​where one number is greater than the other, and obtaining a target key sequence, wherein the number of 0s and the number of 1s in the target key sequence are equal;

[0034] If the key sequence is not reused, the key sequence is determined to be the target key sequence.

[0035] According to some embodiments of the present disclosure, the acquisition module is further configured to:

[0036] An N-order random unitary matrix is ​​generated, and the square of the modulus of an element at each position in the random unitary matrix is ​​determined as the element at the same position in the target matrix.

[0037] According to some embodiments of the present disclosure, the acquisition module is further configured to:

[0038] An N-order random matrix is ​​generated, and the ratio of each element in the random matrix to the sum of all elements in the row and / or column where the element is located is determined as the element at the same position in the target matrix.

[0039] According to a third aspect of an embodiment of the present disclosure, there is provided a key generation device, comprising:

[0040] processor;

[0041] a memory for storing processor-executable instructions;

[0042] The processor is configured to execute the method as described in the first aspect of the embodiment of the present disclosure.

[0043] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided, which, when instructions in the storage medium are executed by a processor of a device, enables the device to execute the method as described in the first aspect of an embodiment of the present disclosure.

[0044] In the key generation method provided in the embodiment of the present disclosure, the key generation method does not require additional circuits, the implementation process is simple, and the generated key sequence is unpredictable and cannot be deciphered based on the already generated sequence. Therefore, it can simplify the key generation process while ensuring the security of the key.

[0045] Still other aspects will become apparent upon reading and understanding the accompanying drawings and detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings, which are incorporated into and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, are used to explain the principles of the embodiments of the present disclosure. In these drawings, similar reference numerals are used to represent similar elements. The drawings described below are some embodiments of the present disclosure, but not all. For those skilled in the art, other drawings can be derived from these drawings without inventive effort.

[0047] Fig. 1 is a schematic diagram showing an encryption and decryption system according to an exemplary embodiment.

[0048] Fig. 2 is a flowchart showing a key generation method according to an exemplary embodiment.

[0049] Fig. 3 is a schematic diagram of line segments of each set according to an exemplary embodiment.

[0050] FIG4 is a diagram showing the relationship between the order of a target matrix and the total number of generated sampling samples according to an exemplary embodiment.

[0051] FIG5A is a probability distribution diagram of sampling samples according to an exemplary embodiment.

[0052] FIG5B is a probability histogram showing a sampling process according to an exemplary embodiment.

[0053] Fig. 6 is a block diagram showing a key generation device according to an exemplary embodiment.

[0054] Fig. 7 is a block diagram showing a key generation device according to an exemplary embodiment. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the disclosed embodiments. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present disclosure. It should be noted that, in the absence of conflict, the embodiments in the present disclosure and the features in the embodiments can be arbitrarily combined with each other.

[0056] Figure 1 is a schematic diagram of an encryption and decryption system according to an exemplary embodiment. As shown in Figure 1 , at the sending end, an encryption module E encrypts plaintext information s using an encryption key e, generating ciphertext y = E(s, e). Ciphertext y is then transmitted to the receiving end via a public channel. At the receiving end, a decryption module D decrypts ciphertext y using a decryption key d, resulting in plaintext information s = D(y, d). If the encryption key e and the decryption key d are equal, the system is called a symmetric encryption system; if the encryption key e and the decryption key d are not equal, the system is called an asymmetric encryption system. A cryptographic system includes the following elements: plaintext, key, cryptographic algorithm, and ciphertext. The security of a cryptographic system generally depends on the security of the key. Cryptographic security assessments are typically based on the Kerckhoff assumption, which states that, except for the key, all details of the cryptographic algorithm are known. The plaintext or ciphertext can be intercepted, and the encryption or decryption machine can also be intercepted. In other words, the cryptographic algorithm in a cryptographic system is generally public and standardized, while only the key needs to be kept secret. Therefore, attacks on cryptographic systems are mainly aimed at keys, and key security is the security of the cryptographic system.

[0057] In related technologies, the methods for generating keys mainly include the following three: 1. Generating pseudo-random numbers based on deterministic algorithms; 2. Generating physical noise random numbers based on the noise generation principle in classical physics; 3. Generating quantum random numbers based on the principles of quantum physics.

[0058] However, these three methods have the following limitations and disadvantages:

[0059] 1. The pseudo-random numbers generated by deterministic algorithms have a fixed pattern. If the seed is the same, the generated sequence is exactly the same. In addition, the algorithms of such pseudo-random number generators are generally public. Based on the generated sequence, the seed for generating the sequence can be calculated. Therefore, the pseudo-random numbers generated by the algorithm are not unpredictable.

[0060] Second, random numbers generated according to the principles of classical physics are a physical process that can be controlled by parameters. If there are sufficient computing resources, these random sequences can also be predicted. Therefore, the physical noise random numbers generated by this method are not unpredictable. In addition, by applying external electromagnetic interference to this type of random number generator, it is also easy to interfere with and control this type of random number generator.

[0061] 3. Quantum random number generators based on quantum physics principles are not widely used and are currently difficult to integrate with silicon-based integrated circuits, resulting in high generator costs. In addition, the classical physics devices required in such generators, such as detectors, amplifiers, and analog-to-digital converters, are also easily controlled by external electromagnetic interference.

[0062] Therefore, the security of pseudo-random numbers generated based on algorithms is very poor. Both types of random number generators, classical physical random numbers and quantum physical random numbers, require additional physical circuits to implement. Their complexity makes engineering implementation difficult and they are susceptible to electromagnetic interference.

[0063] In an exemplary embodiment of the present disclosure, in order to solve the problems existing in the key generation method in the related art, a key generation method is provided, which obtains an N-order target matrix, wherein the sum of all elements in each row and / or column of the target matrix is ​​1, generates sets corresponding to the rows and / or columns of the target matrix, each set includes N subintervals connected in sequence, and each set covers [0,1], generates random probability values ​​corresponding to the rows and / or columns of the target matrix, determines the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding row and / or column, and generates a key sequence based on the number of random probability values ​​corresponding to each position identification number. The key generation method of the present disclosure does not require additional circuitry and is simple to implement. In addition, the generated key sequence is unpredictable and cannot be deciphered based on the already generated sequence. Therefore, it can simplify the key generation process while ensuring the security of the key.

[0064] In a specific implementation of the present disclosure, the sum of all elements in each column of the target matrix can be set to 1, or the sum of each row can be set to 1, or the sum of each column and the sum of each row can be set to 1. In the exemplary embodiment of the present disclosure, the sum of all elements in each column of the target matrix is ​​set to 1 as an example.

[0065] In an exemplary embodiment of the present disclosure, a key generation method is provided. FIG2 is a flowchart of a key generation method according to an exemplary embodiment. As shown in FIG2 , the method includes the following steps:

[0066] Step S201: Obtain an N-order target matrix, where the sum of all elements in each column of the target matrix is ​​1.

[0067] The N-order target matrix is ​​recorded as matrix A, and matrix A is expressed as:

[0068] Among them, α NN Represents the value of the element at row N and column N in the target matrix A.

[0069] The target matrix A satisfies that the sum of all elements in each column is 1, that is, it satisfies:

[0070] Where i represents the i-th row of the target matrix A, and j represents the j-th column of the target matrix A.

[0071] The method for generating the N-order target matrix can be any method, which is not limited in the present disclosure. For example, a pseudo-random number generation algorithm in related technology is used to generate pseudo-random numbers as elements in the target matrix.

[0072] In some exemplary embodiments, the N-order target matrix may be obtained in one of the following two ways:

[0073] The first method is to generate an N-order random unitary matrix and determine the square of the modulus of the element at each position in the random unitary matrix as the element at the same position in the target matrix.

[0074] The random unitary matrix is ​​denoted as matrix U, then the random unitary matrix U satisfies the relationship: U·U * =I, where U * Denotes the transposed conjugate matrix of the random unitary matrix U, and I denotes the identity matrix. The random unitary matrix U is expressed as:

[0075] but:

[0076] Among them, |U| 2 The matrix represents the square of the modulus of the element at each position in the matrix U, satisfying that the sum of all elements in each column and each row is 1. Therefore, |U| 2 Determine the target matrix.

[0077] The second method is to generate an N-order random matrix and determine the ratio of each element in the random matrix to the sum of all elements in the column where the element is located as the element at the same position in the target matrix.

[0078] The N-order random matrix is ​​recorded as matrix B, which is expressed as:

[0079] Each element in the random matrix B obeys the same probability distribution, such as uniform distribution.

[0080] Calculate the sum of all elements in each column of the random matrix B j :

[0081] Where i represents the i-th row of the random matrix B, and j represents the j-th column of the random matrix B.

[0082] Based on the sum of all elements in each column, the random matrix B is column-normalized, then:

[0083] Among them, the matrix If the sum of all elements in each column is 1, the target matrix A is determined as:

[0084] Step S202 : Generate a set corresponding one-to-one to the columns of the target matrix. The set includes N subintervals connected in sequence, and the set covers [0, 1].

[0085] Let the target matrix be denoted as matrix A:

[0086] The sum of all elements in each column is 1, which satisfies:

[0087] Where i represents the i-th row of the target matrix, and j represents the j-th column of the target matrix.

[0088] According to the element values ​​of each column in the target matrix, a set corresponding to the columns of the target matrix is ​​generated. In each set, the value range [0,1] is divided into N subintervals. The length of each subinterval is the value of each element in the column, that is, the length of each subinterval is a ij Each subinterval in each set corresponds one-to-one to an element in the corresponding column, and the position of the subinterval in the N subintervals is the same as the position of the corresponding element in the N elements of the column.

[0089] FIG3 is a schematic diagram of line segments of each set according to an exemplary embodiment. As shown in FIG3 , a set corresponding to the j-th column of the target matrix is ​​generated, in which the value range [0,1] is divided into N subintervals, and the subinterval a 1j The length of is the value of the first matrix element in the jth column of the target matrix, and the subinterval a 2j The length of is the value of the second matrix element in the jth column of the target matrix, and the subinterval a kj The length of is the value of the kth matrix element in the jth column of the target matrix, and the subinterval a Nj The length of is the value of the Nth matrix element in the jth column of the target matrix, then the value range of the first subinterval is [0, a 1j ), the range of the second subinterval is [a 1j , a 1j +a 2j ), the value range of the kth subinterval is [a1j +a 2j +…++a (k-1)j , a 1j +a 2j +…++a kj ), the value range of the Nth subinterval is [a 1j +a 2j +…++a (N-1)j , 1].

[0090] In one example, the target matrix A is:

[0091] The set corresponding to the first column of the target matrix is ​​{0.4, 0.2, 0.4}, the length of the first subinterval is 0.4, the range is [0, 0.4), the length of the second subinterval is 0.2, the range is [0.4, 0.6), the length of the third subinterval is 0.4, the range is [0.6, 1]; the set corresponding to the second column of the target matrix is ​​{0.3, 0.4, 0.3}, the length of the first subinterval is 0.3, the range is [0, 0.3), the length of the third subinterval is 0.4, the range is [0.6, 1]. The length of the second subinterval is 0.4, and the value range is [0.3, 0.7), the length of the third subinterval is 0.3, and the value range is [0.7, 1]; the set corresponding to the third column of the target matrix is ​​{0.5, 0.4, 0.1}, the length of the first subinterval is 0.5, and the value range is [0, 0.5), the length of the second subinterval is 0.4, and the value range is [0.5, 0.9), and the length of the third subinterval is 0.1, and the value range is [0.9, 1].

[0092] Step S203: Generate random probability values ​​that correspond one-to-one to the columns of the target matrix, and determine the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding column.

[0093] Generate the random probability value p corresponding to the jth column of the target matrix j , random probability value p j Obey the uniform distribution between [0, 1] and determine the random probability value p j The position identification number of the subinterval in the set corresponding to the jth column. The position identification number indicates the position number of the subinterval in the column, for example, a 1j <p j 1j +a 2j When a 1j represents the first matrix element in the jth column, a 2j represents the second matrix element in the jth column, which means the random probability value p j ​In the set corresponding to the jth column, it belongs to the second subinterval, that is, the position identification number is 2. Generate the random probability value corresponding to each column of the target matrix, and obtain the position identification number of the subinterval to which the random probability value corresponding to each column belongs in the set of the corresponding column.

[0094] In one example, the target matrix A is:

[0095] The random probability values ​​corresponding to each generated column are 0.5, 0.2, and 0.6 respectively. The random probability value 0.5 corresponding to the first column belongs to the second subinterval, and the position identification number is 2; the random probability value 0.2 corresponding to the second column belongs to the first subinterval, and the position identification number is 1; the random probability value 0.6 corresponding to the third column belongs to the second subinterval, and the position identification number is 2. At this time, the position identification number 1 corresponds to 1 random probability value, the position identification number corresponds to 2 random probability values, and the position identification number 3 corresponds to 0 random probability value.

[0096] Step S204: Generate a key sequence according to the number of random probability values ​​corresponding to each location identification number.

[0097] Count the number of random probability values ​​corresponding to the subinterval of each position identification number, and record the number of random probability values ​​corresponding to the subinterval of position identification number k as s k , then the number of random probability values ​​corresponding to the subintervals of N position identification numbers can be expressed as a set S = {s1, s2, ..., s k ,…,s N}, generate a key sequence based on the set S.

[0098] In one example, the target matrix A is:

[0099] When the random probability values ​​corresponding to each generated column are 0.5, 0.2 and 0.6 respectively, the set S is: S = {1, 2, 0}; when the random probability values ​​corresponding to each generated column are 0.5, 0.2 and 0.95 respectively, the set S is: S = {1, 1, 1}; when the random probability values ​​corresponding to each generated column are 0.1, 0.2 and 0.95 respectively, the set S is: S = {2, 0, 1}.

[0100] When generating a key sequence according to the set S, a 0 / 1 key sequence can be generated through any conversion relationship.

[0101] In one example, if the number of random probability values ​​corresponding to the location identification number is greater than 0, the key value corresponding to the location identification number is 1; if the number of random probability values ​​corresponding to the location identification number is equal to 0, the key value corresponding to the location identification number is 0; the key values ​​corresponding to all location identification numbers are arranged in sequence to form a key sequence.

[0102] For example, when the set S is S={1,2,0}, it means that the number of random probability values ​​corresponding to position identification numbers 1 and 2 are both greater than 0, and the number of random probability values ​​corresponding to position identification number 3 is equal to 0, then the generated key sequence is 110; when the set S is S={1,1,1}, it means that the number of random probability values ​​corresponding to position identification numbers 1, 2, and 3 are all greater than 0, then the generated key sequence is 111; when the set S is S={2,0,1}, it means that the number of random probability values ​​corresponding to position identification numbers 1 and 3 are both greater than 0, and the number of random probability values ​​corresponding to position identification number 2 is equal to 0, then the generated key sequence is 101.

[0103] In another example, if the number of random probability values ​​corresponding to the location identification number is greater than 0, the key value corresponding to the location identification number is 0; if the number of random probability values ​​corresponding to the location identification number is equal to 0, the key value corresponding to the location identification number is 1; the key values ​​corresponding to all location identification numbers are arranged in sequence to form a key sequence.

[0104] For example, when the set S is S={1,2,0}, it means that the number of random probability values ​​corresponding to position identification numbers 1 and 2 are both greater than 0, and the number of random probability values ​​corresponding to position identification number 3 is equal to 0, then the generated key sequence is 001; when the set S is S={1,1,1}, it means that the number of random probability values ​​corresponding to position identification numbers 1, 2, and 3 are all greater than 0, then the generated key sequence is 000; when the set S is S={2,0,1}, it means that the number of random probability values ​​corresponding to position identification numbers 1 and 3 are both greater than 0, and the number of random probability values ​​corresponding to position identification number 2 is equal to 0, then the generated key sequence is 010.

[0105] In the above embodiment, the sum of all elements in each column of the target matrix is ​​1. In the specific implementation scheme of the present disclosure, the sum of all elements in each row of the target matrix can also be set to 1. Accordingly, the set interval division shown in Figure 3 can also be set according to the elements of each row of the matrix, and then a random probability value corresponding to the row of the target matrix is ​​generated, and the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding row is determined. The method of the present disclosure is applicable to different implementation forms in which the sum of each column of different matrices is 1, or the sum of each row is 1, or the sum of each column and the sum of each row are both 1.

[0106] In an exemplary embodiment, after a key sequence is generated, it is necessary to determine whether the key sequence needs to be reused:

[0107] If a key sequence is reused, the number of 0s and 1s in the key sequence is determined, and key values ​​where one number is greater than the other are deleted to obtain a target key sequence in which the number of 0s and 1s in the target key sequence is equal;

[0108] If the key sequence is not reused, the key sequence is determined to be the target key sequence.

[0109] When the key sequence needs to be reused, the number of 0s and 1s in the key sequence must be equal. For example, if the generated key sequence is 101101001, which includes 4 0s and 5 1s, one of the 1s can be deleted to make the number of 0s and 1s equal. When deleting, any 1 can be deleted according to actual needs, for example, the last 1 can be deleted to obtain the target key sequence 10110100. If the key sequence does not need to be reused, the generated key sequence can be determined as the target key sequence.

[0110] In an exemplary embodiment of the present disclosure, an N-order target matrix in which the sum of all elements of each row and / or column is 1 is obtained, and sets corresponding one-to-one to the rows and / or columns of the target matrix are generated, each set includes N sub-intervals connected in sequence, and each set covers [0,1]. Random probability values ​​corresponding one-to-one to the rows and / or columns of the target matrix are generated, and the position identification number of the sub-interval to which the random probability value belongs in the set corresponding to the corresponding row and / or column is determined. According to the number of random probability values ​​corresponding to each position identification number, a key sequence is generated. This method does not require additional circuits and is simple to implement.

[0111] In addition, for the same N-order target matrix, the result obtained by executing step S203 once is considered as a sampling sample, that is, the above-mentioned set S is obtained. Then, the number of different sampling samples that can be generated by the N-order target matrix is:

[0112] Wherein, N!=1*2*3*…*N, therefore, the total number of different sample samples that can be generated increases exponentially with the increase of the order N of the target matrix. FIG4 is a diagram showing the relationship between the order of the target matrix and the total number of different sample samples generated according to an exemplary embodiment. As shown in FIG4, the horizontal axis is the order of the target matrix, and the vertical axis is the total number of different sample samples generated. When N is 128, the total number of different sample samples exceeds 10 75 If the total number of different sampling samples is large, the probability of each sampling sample appearing is extremely small, so it can be considered that the same sampling sample will not appear.

[0113] In one example, when N=128, the sampling process of step S203 is repeated 160,000,000 times, each sampling process corresponds to obtaining a sampling sample, and the probability of occurrence of different sampling samples is calculated. FIG5 is a probability distribution diagram of sampling samples according to an exemplary embodiment. FIG5A shows the probability distribution of 10,000 different sampling samples, where the horizontal axis is the number of different sampling samples and the vertical axis is the probability value. The probability distribution is within 10 -230 to 10-265 , which are extremely small probability values. Figure 5B shows the probability histogram of 160,000,000 sampling processes. The horizontal axis is the exponent of the probability value of the sample, and the vertical axis is the probability density. Most of them are concentrated in the range of 10 -245 Nearby, normally distributed.

[0114] Based on the above data, the total number of sampling samples generated by the method disclosed in the present invention is astronomical, and the probability of each sampling sample appearing is extremely small and cannot occur within the time range that can be perceived by humans. Therefore, when the order of the target matrix is ​​large, repeated sampling samples cannot appear, and the repeatability of the key sequence generated thereby is extremely low. Therefore, the generated key sequence is unpredictable and cannot be deciphered based on the already generated sequence, which can ensure the security of the key.

[0115] In an exemplary embodiment of the present disclosure, a key generation device is provided. FIG6 is a block diagram of a key generation device according to an exemplary embodiment, as shown in FIG6 , comprising:

[0116] An acquisition module 601 is configured to acquire an N-order target matrix, where the sum of all elements in each row and / or column of the target matrix is ​​1;

[0117] A first generating module 602 is configured to generate a set corresponding one-to-one to rows and / or columns of a target matrix, the set including N subintervals connected in sequence, and the set covering [0, 1];

[0118] The sampling module 603 is configured to generate random probability values ​​corresponding to rows and / or columns of the target matrix, and determine the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding row and / or column;

[0119] The second generating module 604 is configured to generate a key sequence according to the number of random probability values ​​corresponding to each location identification number.

[0120] In an exemplary embodiment, the second generating module 604 is further configured to:

[0121] If the number of random probability values ​​corresponding to the location identification number is greater than 0, the key value corresponding to the location identification number is 1;

[0122] If the number of random probability values ​​corresponding to the location identification number is equal to 0, the key value corresponding to the location identification number is 0;

[0123] The key sequence is composed of the key values ​​corresponding to all position identification numbers arranged in sequence.

[0124] In an exemplary embodiment, the second generating module 604 is further configured to:

[0125] If a key sequence is reused, the number of 0s and 1s in the key sequence is determined, and key values ​​where one number is greater than the other are deleted to obtain a target key sequence in which the number of 0s and 1s in the target key sequence is equal;

[0126] If the key sequence is not reused, the key sequence is determined to be the target key sequence.

[0127] In an exemplary embodiment, the acquisition module 601 is further configured to:

[0128] Generate an N-order random unitary matrix and set the square of the modulus of the element at each position in the random unitary matrix to the element at the same position in the target matrix.

[0129] In an exemplary embodiment, the acquisition module 601 is further configured to:

[0130] Generate an N-order random matrix, and determine the ratio of each element in the random matrix to the sum of all elements in the row and / or column where the element is located as the element at the same position in the target matrix.

[0131] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0132] Fig. 7 is a block diagram showing a key generation device 700 according to an exemplary embodiment.

[0133] 7 , apparatus 700 may include one or more of the following components: a processing component 702 , a memory 704 , a power component 706 , a multimedia component 708 , an audio component 710 , an input / output (I / O) interface 712 , a sensor component 714 , and a communication component 716 .

[0134] The processing component 702 generally controls the overall operation of the device 700, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 702 may include one or more modules to facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.

[0135] The memory 704 is configured to store various types of data to support operations on the device 700. Examples of such data include instructions for any application or method operating on the device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.

[0136] The power supply component 706 provides power to the various components of the device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 700.

[0137] The multimedia component 708 includes a screen that provides an output interface between the device 700 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front camera and / or a rear camera. When the device 700 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.

[0138] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), which is configured to receive external audio signals when the device 700 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0139] I / O interface 712 provides an interface between processing component 702 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.

[0140] The sensor assembly 714 includes one or more sensors for providing various aspects of the status assessment of the device 700. For example, the sensor assembly 714 can detect the open / closed state of the device 700, the relative positioning of components, such as the display and keypad of the device 700. The sensor assembly 714 can also detect changes in the position of the device 700 or a component of the device 700, the presence or absence of user contact with the device 700, the orientation or acceleration / deceleration of the device 700, and temperature changes of the device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 714 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0141] The communication component 716 is configured to facilitate wired or wireless communication between the device 700 and other devices. The device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0142] In an exemplary embodiment, the apparatus 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.

[0143] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 704 including instructions, and the instructions can be executed by the processor 720 of the apparatus 700 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0144] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a device, enables the device to perform a key generation method, the key generation method including any of the above methods.

[0145] The above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure. Industrial Applicability

[0146] The key generation method provided by the embodiment of the present disclosure does not require additional circuits and is simple to implement. In addition, the generated key sequence is unpredictable and cannot be deciphered based on the generated sequence. Therefore, it can simplify the key generation process while ensuring the security of the key.

Claims

1. A key generation method, in, The key generation method comprises: Obtain an N-order target matrix, in which the sum of all elements in each row and / or column of the target matrix is ​​1; Generate a set corresponding one-to-one to rows and / or columns of the target matrix, the set comprising N subintervals connected in sequence, and the set covers [0, 1]; Generate random probability values ​​corresponding one-to-one to the rows and / or columns of the target matrix, and determine the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding row and / or column; A key sequence is generated according to the number of the random probability values ​​corresponding to each of the location identification numbers.

2. The key generation method according to claim 1, in, The generating a key sequence according to the number of the random probability values ​​corresponding to each of the position identification numbers comprises: If the number of the random probability values ​​corresponding to the location identification number is greater than 0, the key value corresponding to the location identification number is 1; If the number of the random probability values ​​corresponding to the location identification number is equal to 0, then the key value corresponding to the location identification number is 0; The key sequence is composed of the key values ​​corresponding to all the position identification numbers arranged in sequence.

3. The key generation method according to claim 1, in, The key generation method further comprises: If the key sequence is used repeatedly, determine the number of 0s and the number of 1s in the key sequence, delete the key values ​​where one number is greater than the other number, and obtain a target key sequence, where the number of 0s and the number of 1s in the target key sequence are equal; If the key sequence is not reused, the key sequence is determined to be the target key sequence.

4. The key generation method according to claim 1, in, The obtaining of the N-order target matrix includes: An N-order random unitary matrix is ​​generated, and the square of the modulus of the element at each position in the random unitary matrix is ​​determined as the element at the same position of the target matrix.

5. The key generation method according to claim 1, in, The obtaining of the N-order target matrix includes: An N-order random matrix is ​​generated, and the ratio of each element in the random matrix to the sum of all elements in the row and / or column where the element is located is determined as the element at the same position of the target matrix.

6. A key generation device, in, The key generating device comprises: An acquisition module is configured to acquire an N-order target matrix, wherein the sum of all elements in each row and / or column of the target matrix is ​​1; A first generating module is configured to generate a set corresponding to rows and / or columns of the target matrix one by one, the set comprising N sub-intervals connected in sequence, and the set covers [0, 1]; A sampling module is configured to generate random probability values ​​corresponding one-to-one to the rows and / or columns of the target matrix, and determine the position identification number of the subinterval to which the random probability value belongs in the set corresponding to the corresponding row and / or column; The second generating module is configured to generate a key sequence according to the number of the random probability values ​​corresponding to each of the position identification numbers.

7. A key generating device, in, The key generating device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to execute the method as claimed in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium, in, When the instructions in the storage medium are executed by a processor of a device, the device is enabled to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Glass color sampling simulation method and system considering photon loss and medium

    CN112560280A

  • Key generation method and device and storage medium

    CN116781255A

  • Secret key generation for wireless channels

    US20220158825A1

  • Generating unique cryptographic keys from a pool of random elements

    US20230145683A1

  • Fast solvers for sparse structured linear systems

    WO2023003774A1