Unidirectional function generation method, system and equipment and storage medium

By multiplexing symmetric encryption algorithms and using mapping relationships to construct unidirectional functions, the problems of complex construction of unidirectional functions and large computing overhead in the prior art are solved, and the effect of reducing application costs and saving overhead is achieved.

CN119402172APending Publication Date: 2025-02-07CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411580687.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

In the prior art, constructing one-way functions requires the use of advanced mathematical knowledge, which has a high computational overhead, and the use of hash functions in actual products requires the introduction of complex algorithm modules, which affects product cost and size.

Method used

By multiplexing the symmetric encryption algorithm, the preset symmetric encryption algorithm, the zeroth map and the first map are used to calculate the ciphertext, and the mapping relationship between the ciphertext and the independent variable is used as a one-way function.

Benefits of technology

It reduces the application cost of one-way functions, saves the overhead of related products, and avoids the necessity of introducing complex mathematical methods and hash algorithm modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402172A_ABST
    Figure CN119402172A_ABST
Patent Text Reader

Abstract

The invention discloses a one-way function generation method, system and device and a storage medium. The generation method comprises the steps of obtaining a preset symmetric encryption algorithm, a zeroth mapping and a first mapping; wherein the zeroth mapping and the first mapping have single and same independent variables, and the first mapping is one-to-one mapping; through the symmetric encryption algorithm, taking the mapping value of the zeroth mapping as an input plaintext, taking the mapping value of the first mapping as an input secret key, and carrying out encryption calculation to obtain a first ciphertext; and taking the mapping relation between the first ciphertext and the independent variable as a generated one-way function. According to the method, the one-way function is constructed by simply multiplexing the symmetric encryption algorithm, a hash algorithm module does not need to be specially introduced, a complex mathematical method does not need to be used for constructing the one-way function either, the application cost of the one-way function can be reduced, and the overhead of related products can be saved. The method can be widely applied to the technical field of cryptography.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of cryptography, and in particular to a method, system, device and storage medium for generating a one-way function. Background Art

[0002] One-way function is an important concept in cryptography. It is a mathematical function that is easy to calculate but difficult to reverse. Specifically, given an input value x, the output value y = f(x) can be easily calculated through a one-way function f. However, if only the output value y is known, it is computationally infeasible to find the original input value x through reverse calculation. Based on the above characteristics, one-way functions are widely used in the field of information security.

[0003] In the prior art, constructing a one-way function requires profound and obscure mathematical knowledge. For example, a one-way function can be constructed based on modular exponential operations on finite fields or point multiplication operations (also called scalar multiplication) on elliptic curves, but this implementation method has a relatively large computational overhead. Hash functions are a special type of one-way function. In addition to their one-way nature, they also have some other useful properties, and the relevant technical standards are also very mature. Therefore, in conventional applications, where a one-way function is needed, hash functions usually appear (even if other properties of the hash function other than one-way nature are not needed). In actual products, the use of hash functions requires the introduction of a hash algorithm module (whether in software or hardware form), which may make the product complicated and affect the cost and size of the product.

[0004] In summary, the current status of relevant technologies can be improved depending on the specific circumstances. Summary of the invention

[0005] The embodiments of the present application provide a method, system, device and storage medium for generating a one-way function, which can reduce the application cost of the one-way function and save the expenses of related products.

[0006] An aspect of an embodiment of the present application provides a method for generating a one-way function, the method comprising:

[0007] Obtaining a preset symmetric encryption algorithm, a zeroth mapping, and a first mapping; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping;

[0008] By using the symmetric encryption algorithm, the mapping value of the zeroth mapping is used as the input plain text, and the mapping value of the first mapping is used as the input key to perform encryption calculation to obtain a first ciphertext;

[0009] A mapping relationship between the first ciphertext and the independent variable is used as a generated one-way function.

[0010] In some embodiments, the method further comprises:

[0011] Obtain a second mapping, where the second mapping is a one-to-one mapping and the second mapping has the same independent variable as the first mapping;

[0012] Using the symmetric encryption algorithm, the first ciphertext is used as the input plaintext, and the mapping value of the second mapping is used as the input key to perform encryption calculation to obtain the second ciphertext;

[0013] A mapping relationship between the second ciphertext and the independent variable is used as a generated one-way function.

[0014] In some embodiments, the method further comprises:

[0015] Obtaining an Nth mapping, wherein the Nth mapping is a one-to-one mapping and the independent variable of the Nth mapping is the same as that of the first mapping;

[0016] By using the symmetric encryption algorithm, the N-1th ciphertext is used as the input plaintext and the mapping value of the Nth mapping is used as the input key to perform encryption calculation to obtain the Nth ciphertext;

[0017] If the current value of N is less than the preset value, N is incremented by 1, and the step of obtaining the Nth mapping is returned to be executed; or, if the current value of N is equal to the preset value, the mapping relationship between the current Nth ciphertext and the independent variable is used as a generated one-way function;

[0018] Among them, the initial value of N is 2, and the preset value is an integer value greater than 2.

[0019] On the other hand, an embodiment of the present application provides a method for using a symmetric encryption algorithm, the method comprising:

[0020] Obtain input data, a preset zeroth mapping, a first mapping, and a symmetric encryption algorithm; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping;

[0021] According to the input data, obtaining a zeroth mapping value through the zeroth mapping process, and obtaining a first mapping value through the first mapping process;

[0022] Through the symmetric encryption algorithm, the zeroth mapping value is used as the input plaintext and the first mapping value is used as the input key to perform encryption calculation to obtain the target ciphertext, and the target ciphertext is used as the one-way function value about the input data.

[0023] In some embodiments, obtaining the first mapping value through the first mapping process includes:

[0024] Perform a target operation on the input data and a preset constant to obtain the first mapping value;

[0025] The target operation includes at least one of a sum operation, a difference operation or an XOR operation.

[0026] In some embodiments, obtaining the first mapping value through the first mapping process includes:

[0027] Cutting the input data to obtain a plurality of data segments; wherein each of the data segments includes a plurality of bits of data content;

[0028] The data segments are reordered according to a preset rule and combined to obtain the first mapping value.

[0029] On the other hand, an embodiment of the present application provides a one-way function generation system, the generation system comprising:

[0030] A first acquisition unit, configured to acquire a preset symmetric encryption algorithm, a zeroth mapping, and a first mapping; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping;

[0031] A first processing unit, configured to perform encryption calculation by using the symmetric encryption algorithm, with the mapping value of the zeroth mapping as the input plaintext and the mapping value of the first mapping as the input key to obtain a first ciphertext;

[0032] The first output unit is configured to use the mapping relationship between the first ciphertext and the independent variable as a generated one-way function.

[0033] On the other hand, an embodiment of the present application provides a system for using a symmetric encryption algorithm, the system comprising:

[0034] A second acquisition unit, configured to acquire input data, a preset zeroth mapping, a first mapping, and a symmetric encryption algorithm; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping;

[0035] a second processing unit, configured to obtain a zeroth mapping value through the zeroth mapping process according to the input data, and obtain a first mapping value through the first mapping process;

[0036] The second output unit is used to perform encryption calculation through the symmetric encryption algorithm, using the zeroth mapping value as the input plaintext and the first mapping value as the input key to obtain the target ciphertext, and using the target ciphertext as the one-way function value about the input data.

[0037] On the other hand, an embodiment of the present application provides an electronic device, including:

[0038] Symmetric encryption module;

[0039] at least one processor;

[0040] at least one memory for storing at least one program;

[0041] When the at least one program is executed by the at least one processor, the at least one processor implements the aforementioned method.

[0042] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is executed by a processor to implement the aforementioned method.

[0043] The embodiments of the present application include at least the following beneficial effects: the present application provides a method, system, device and storage medium for generating a one-way function, the generating method obtains a preset symmetric encryption algorithm, a zeroth mapping and a first mapping; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping; through the symmetric encryption algorithm, the mapping value of the zeroth mapping is used as the input plaintext, and the mapping value of the first mapping is used as the input key, and an encryption calculation is performed to obtain a first ciphertext; the mapping relationship between the first ciphertext and the independent variable is used as a generated one-way function. The present application constructs a one-way function by simply reusing a symmetric encryption algorithm, does not require the introduction of a hash algorithm module, and does not require the use of complex mathematical methods to construct a one-way function, which can reduce the application cost of the one-way function and save the cost of related products. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following introduction is made to the drawings of the embodiments of the present application or the related technical solutions in the prior art. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solutions of the present application. For technical personnel in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 A schematic diagram of an implementation environment provided for an embodiment of the present application;

[0046] Figure 2 A schematic diagram of a flow chart of a method for generating a one-way function provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of the principle of constructing a one-way function provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a flow chart of another method for generating a one-way function provided in an embodiment of the present application;

[0049] Figure 5 A flowchart of a method for using a symmetric encryption algorithm provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of a process of obtaining a first mapping value through a first mapping process provided in an embodiment of the present application;

[0051] Figure 7 A schematic diagram of a first mapping principle provided in an embodiment of the present application;

[0052] Figure 8 A schematic diagram of the structure of a one-way function generation system provided in an embodiment of the present application;

[0053] Fig. 9 A schematic diagram of the structure of a system for using a symmetric encryption algorithm provided in an embodiment of the present application;

[0054] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The present application is further described below in conjunction with the accompanying drawings and specific embodiments. The described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.

[0056] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0058] 1) Mapping: One of the basic concepts in mathematics, it describes how the elements in one set correspond to the elements in another set. Formally, let A and B be two sets. If there is a rule f that, for each element a in set A, can find a unique element b in set B that corresponds to it according to rule f, then this rule f is called a mapping from set A to set B.

[0059] 2) Bijective mapping: also known as bijective, is a special type of mapping. For a mapping f from set A to set B, if any element b in set B is the mapping value of an element a in set A according to f, and such a is unique, then the mapping f is a one-to-one mapping.

[0060] 3) Encryption and decryption: The process of converting understandable plaintext into incomprehensible ciphertext. The reverse process is decryption. Common encryption algorithms are symmetric encryption algorithms, which use the same key for encryption and decryption.

[0061] 4) Block ciphers and stream ciphers: Block cipher algorithms are a type of common symmetric encryption algorithms that treat plaintext as a series of fixed-length data blocks (called blocks, one or more) and must be used in conjunction with a corresponding working mode. Block cipher algorithms (such as SM1, SM4, SM7) and working modes (such as ECB) are regulated by corresponding technical standards. Stream cipher algorithms represented by the national standard ZUC are another type of symmetric encryption algorithm that does not require the length of plaintext.

[0062] One-way function is an important concept in cryptography. It is a mathematical function that is easy to calculate but difficult to reverse. Specifically, given an input value x, the output value y = f(x) can be easily calculated through a one-way function f. However, if only the output value y is known, it is computationally infeasible to find the original input value x through reverse calculation (for example, it would consume thousands of years of computing power of a national computing center). Based on the above characteristics, one-way functions are widely used in the field of information security.

[0063] In the prior art, constructing a one-way function requires profound and obscure mathematical knowledge. For example, a one-way function can be constructed based on modular exponential operations on finite fields or point multiplication operations (also called scalar multiplication) on elliptic curves, but this implementation method has a relatively large computational overhead. Hash functions are a special type of one-way function. In addition to their one-way nature, they also have some other useful properties, and the relevant technical standards are also very mature. Therefore, in conventional applications, where a one-way function is needed, hash functions usually appear (even if other properties of the hash function other than one-way nature are not needed). In actual products, the use of hash functions requires the introduction of a hash algorithm module (whether in software or hardware form), which may make the product complicated and affect the cost and size of the product.

[0064] In the field of information security, encryption algorithms used to protect data confidentiality are the most common cryptographic algorithms, among which symmetric encryption algorithms are usually used to protect business data. As shown below, Table 1 summarizes the commonly used symmetric encryption algorithms.

[0065] Table 1

[0066]

[0067] For symmetric encryption algorithms, the application principle can be simply expressed as c=E(k,p), where k is the key, p is the plaintext, and c is the ciphertext. For encryption algorithm E, k, p, and c are all binary bit strings. A key with a length of |k| bits means that there are a total of 2 possible keys. |k| Similarly, for a block cipher, a plaintext block of |p| bits means that there are a total of 2 possible plaintext blocks. |p| They constitute the so-called plaintext space.

[0068] At present, the symmetric encryption algorithm used more in China is SM4 described in the national standard GB / T 32907-2016, and the one used more internationally is AES-128 described in the US national standard FIPS197. They are all block ciphers: business data is cut into fixed-length binary bit blocks and encrypted (and decrypted) block by block; the basic operation each time is to transform the current plaintext block p into a ciphertext block c under the action of the key k, denoted as c=E(k,p), where the key length |k|=128 bits. Each encryption inputs a plaintext block of length |p|=128 bits and outputs a ciphertext block of length |c|=128 bits (the block cipher |p| is always equal to |c|, called the block length, but not necessarily equal to |k|). It is not difficult to understand that the plaintext usually needs to be padded to make the length an integer multiple of |p| before it can be processed by the block cipher algorithm. The stream cipher algorithm, which is also a symmetric encryption, does not need to cut the plaintext into fixed-length blocks and does not require the plaintext length.

[0069] In practical applications, symmetric encryption algorithms are relatively more common than hash algorithms, and are almost a necessity in cryptographic applications. In most products involving cryptographic applications, symmetric encryption modules such as block cipher modules or sequence cipher modules are deployed. Therefore, in the embodiments of the present application, in order to save expenses (research and development costs, product space, etc.), a one-way function is constructed by reusing a symmetric encryption algorithm. Compared with the mode of introducing a hash algorithm module in the prior art solution, the technical solution in the embodiment of the present application adopts a technical route of local materials and flexible reuse, which helps to reduce the software and hardware costs of the algorithm implementation, and is expected to make the cryptographic application product occupy fewer storage units or dedicated cryptographic chips, thereby realizing it in a smaller physical space.

[0070] It is understandable that the method for generating a one-way function and the method for using a symmetric encryption algorithm provided in the embodiments of the present application can be applied to any computer device with data processing and computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, and a desktop computer, but is not limited to this.

[0071] like Figure 1 As shown, Figure 1 This is a schematic diagram of the implementation environment of a method for generating a one-way function and a method for using a symmetric encryption algorithm provided in an embodiment of the present application. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.

[0072] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0073] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.

[0074] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an IoT device, etc., but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the present embodiment.

[0075] For example, based on Figure 1In the implementation environment shown, the embodiment of the present application provides a method for generating a one-way function and a method for using a symmetric encryption algorithm. The following is an example of applying the method for generating a one-way function and a method for using a symmetric encryption algorithm in the terminal 102. It can be understood that the method for generating a one-way function and the method for using a symmetric encryption algorithm can also be applied to the server 101, and the present application does not impose any restrictions on this.

[0076] Understandably, Figure 1 The implementation environment shown is only used for exemplary description and is not intended to limit the specific implementation environment involved in the method provided in this application.

[0077] Reference Figure 2 , Figure 2 A flow chart of a method for generating a one-way function provided in an embodiment of the present application is shown. The method for generating a one-way function provided in an embodiment of the present application comprises at least the following steps:

[0078] Step 210: Obtain a preset symmetric encryption algorithm, a zeroth mapping, and a first mapping; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping;

[0079] Step 220: using the symmetric encryption algorithm, using the mapping value of the zeroth mapping as the input plain text and the mapping value of the first mapping as the input key, performing encryption calculation to obtain a first ciphertext;

[0080] Step 230: Use the mapping relationship between the first ciphertext and the independent variable as a generated one-way function.

[0081] In an embodiment of the present application, a method for generating a one-way function is provided. Considering that symmetric encryption modules are often used in current cryptographic application scenarios, the method in the embodiment of the present application constructs a one-way function by simply reusing a symmetric encryption algorithm. There is no need to specifically introduce a hash algorithm module, nor is there a need to use complex mathematical methods to construct a one-way function. This can reduce the application cost of the one-way function and save the overhead of related products.

[0082] Specifically, when applying the method for generating a one-way function provided in the embodiment of the present application, it is necessary to obtain a preset symmetric encryption algorithm and two mappings, where the symmetric encryption algorithm can be a symmetric encryption algorithm used by a symmetric encryption module that already exists in a related system or product, and the two mappings can be recorded as the zeroth mapping and the first mapping, the number of independent variables of the zeroth mapping and the first mapping is 1, and the independent variables of the two mappings are the same. Among them, the first mapping is a one-to-one mapping, and the present application does not limit the type of the zeroth mapping.

[0083] In the embodiment of the present application, the symmetric encryption algorithm is denoted as c=E(k,p), the zeroth mapping can be a pre-set arbitrary mapping from the key space of the symmetric encryption algorithm to the plaintext space of the symmetric encryption algorithm, denoted as g0(x); the first mapping can be a pre-set one-to-one mapping from the key space of the symmetric encryption algorithm to the key space of the symmetric encryption algorithm, denoted as g1(x). For example, more specifically, the zeroth mapping can be g0(x)=0, and the first mapping can be g1(x)=x.

[0084] Taking the first mapping g1(x) as an example, illustratively, in some embodiments, the first mapping may be g1(x)=x+a, where a is a constant, and the lowest |x| bits of the calculation result are truncated, that is, the word length is kept unchanged. For example, a can be -1 in decimal, that is, all 1s in binary. In this way, when x is 1, g1(x) is equal to 0; when x is 0, g1(x) is equal to all 1s in binary; when x is all 1s in binary, g1(x) is equal to -2 in decimal.

[0085] Exemplarily, in some embodiments, the first mapping may be g1(x)=x⊕a, where a is a constant and ⊕ is an exclusive OR in computer operations. For example, a may be all 1s in binary, and in this case g1(x) is to invert x bit by bit. In this case, when x is -1 in decimal, g1(x) is equal to 0; when x is 0, g1(x) is equal to all 1s in binary; when x is 1, g1(x) is equal to -2 in decimal.

[0086] Of course, it can be understood that the above is only used to provide an exemplary description of the zeroth mapping and the first mapping provided in the embodiment of the present application. In actual applications, they can be flexibly set according to specific needs, and the present application does not impose any restrictions on this.

[0087] In the embodiment of the present application, after obtaining the symmetric encryption algorithm, the zeroth mapping and the first mapping, a one-way function can be generated based on them. For example, the mapping value of the zeroth mapping can be used as the plaintext input to the symmetric encryption algorithm, and the mapping value of the first mapping can be used as the key input to the symmetric encryption algorithm. The ciphertext output by the symmetric encryption algorithm is obtained by performing encryption calculation. In the embodiment of the present application, it is recorded as the first ciphertext. Figure 3 , Figure 3 A schematic diagram of the principle of constructing a one-way function provided in an embodiment of the present application is shown. In the embodiment of the present application, taking the aforementioned g0(x) and g1(x) as the zeroth mapping and the first mapping as examples, the first ciphertext can be expressed as E(g1(x), g0(x)). In the embodiment of the present application, the mapping relationship between the first ciphertext and the independent variable x can be used as a generated one-way function, and the one-way function can be expressed as y=E(g1(x), g0(x)).

[0088] It is understandable that the method for generating a one-way function provided in the embodiment of the present application is based on the symmetric encryption algorithm used by the existing symmetric encryption module in the relevant system or product, and provides a pre-set zeroth mapping and a first mapping to generate a one-way function. Compared with the mode of introducing a hash algorithm module in the prior art solution, the technical solution in the embodiment of the present application adopts a technical route of using local materials and flexible reuse, which helps to reduce the software and hardware costs of the algorithm implementation, and is expected to make the cryptographic application product occupy fewer storage units or dedicated cryptographic chips, thereby realizing it in a smaller physical space. Compared with the mode of using complex mathematical methods to construct a one-way function, the technical solution in the embodiment of the present application is easy to implement, which is conducive to improving the generation and use efficiency of one-way functions.

[0089] It should be pointed out that the method for generating a one-way function provided in the embodiments of the present application is applicable to the scenario where a symmetric encryption module already exists in the relevant system or product. Obviously, in cryptographic applications that do not originally involve symmetric encryption algorithms, it is impossible to reuse symmetric encryption algorithms to construct one-way functions. In this case, a hash algorithm module can be introduced to be used as a one-way function, and the present application does not limit this.

[0090] Specifically, refer to Figure 4 In some embodiments, the method further comprises:

[0091] Obtain a second mapping, where the second mapping is a one-to-one mapping and the second mapping has the same independent variable as the first mapping;

[0092] Using the symmetric encryption algorithm, the first ciphertext is used as the input plaintext, and the mapping value of the second mapping is used as the input key to perform encryption calculation to obtain the second ciphertext;

[0093] A mapping relationship between the second ciphertext and the independent variable is used as a generated one-way function.

[0094] In the embodiment of the present application, when constructing a one-way function, a symmetric encryption algorithm can be further used. For example, in the embodiment of the present application, another mapping can be obtained in advance, that is, the second mapping, and the second mapping is also a one-to-one mapping, and the independent variable is the same as the first mapping. After obtaining the first ciphertext as mentioned above, the symmetric encryption algorithm can be used to perform the encryption calculation again with the first ciphertext as the plaintext input to the symmetric encryption algorithm and the mapping value of the second mapping as the key input to the symmetric encryption algorithm to obtain a new ciphertext, which can be recorded as the second ciphertext in the embodiment of the present application. Then, the mapping relationship between the second ciphertext and the independent variable can be used as a generated one-way function.

[0095] Similarly, in an embodiment of the present application, the second mapping can be a pre-set one-to-one mapping from the key space of the symmetric encryption algorithm to the key space of the symmetric encryption algorithm, denoted as g2(x). Taking the aforementioned g0(x) and g1(x) as the zeroth mapping and the first mapping as an example, the first ciphertext can be expressed as E(g1(x), g0(x)), and the second ciphertext can be expressed as E(g2(x), E(g1(x), g0(x))). At this time, the new one-way function obtained can be expressed as y=E(g2(x), E(g1(x), g0(x))). For example, for example, g0(x)=x⊕p, g1(x)=x+d, g2(x)=x⊕q (d, p and q are constants), the one-way function can be expressed as y=E(x⊕q, E(x+d, x⊕p)).

[0096] Of course, it can be understood that the above is only used to provide an exemplary description of the second mapping provided in the embodiment of the present application. In actual applications, it can be flexibly set according to specific needs, and the present application does not impose any restrictions on this.

[0097] Furthermore, it should be noted that the method in the embodiment of the present application can iteratively call a symmetric encryption algorithm to generate a one-way function. As a further generalization of the aforementioned generation of a new one-way function based on the second mapping, in the embodiment of the present application, a third mapping, a fourth mapping, a fifth mapping... can be further obtained, and a corresponding one-way function can be generated through nested logic. The second mapping, the third mapping, the fourth mapping, the fifth mapping, etc. are mappings of the same category as the first mapping. And these mappings can be the same or different.

[0098] Specifically, in the embodiment of the present application, a numerical value can be preset, which can be used as an indicator of the end of the iterative call to the symmetric encryption algorithm, that is, when the mapping of the preset threshold is nested, the call of the symmetric encryption algorithm is ended, and the mapping relationship between the currently obtained ciphertext and the independent variable is used as a generated one-way function. The implementation process can be recorded as:

[0099] Obtaining an Nth mapping, wherein the Nth mapping is a one-to-one mapping and the independent variable of the Nth mapping is the same as that of the first mapping;

[0100] By using the symmetric encryption algorithm, the N-1th ciphertext is used as the input plaintext and the mapping value of the Nth mapping is used as the input key to perform encryption calculation to obtain the Nth ciphertext;

[0101] If the current value of N is less than the preset value, N is incremented by 1, and the step of obtaining the Nth mapping is returned to be executed; or, if the current value of N is equal to the preset value, the mapping relationship between the current Nth ciphertext and the independent variable is used as a generated one-way function;

[0102] Among them, the initial value of N is 2, and the preset value is an integer value greater than 2.

[0103] In the embodiment of the present application, it is possible to start from the second mapping, where the value of N is 2. The second ciphertext is obtained by performing encryption calculation based on the second mapping and the first ciphertext through a symmetric encryption algorithm. The value of N is compared with the preset value, and the preset value can be any integer value greater than 2, for example, it can be 4. At this time, the value of N is less than 4, and N is incremented by 1, that is, N=N+1, and the new value of N is 3. Return to continue to obtain a new mapping, that is, the third mapping. The requirements of the third mapping are similar to those of the second mapping, and are not described in detail here. The third ciphertext is obtained by performing encryption calculation based on the third mapping and the second ciphertext through a symmetric encryption algorithm, and the current value of N is compared with the preset value. At this time, the value of N is less than 4, and N is incremented by 1, that is, N=N+1, and the new value of N is 4. Return to continue to obtain a new mapping, that is, the fourth mapping. The requirements of the fourth mapping are similar to those of the second mapping, and are not described in detail here. The symmetric encryption algorithm is used to perform encryption calculation based on the fourth mapping and the third ciphertext to obtain the fourth ciphertext, and the current value of N is compared with the preset value. At this time, the value of N is equal to 4, so the call of the symmetric encryption algorithm can be terminated, and the mapping relationship between the fourth ciphertext and the independent variable is used as a generated one-way function.

[0104] It can be understood that in the embodiment of the present application, the size of the preset value can be flexibly set according to actual needs, and each mapping from the second mapping to the Nth mapping can be selected with reference to the aforementioned requirements and examples, and the present application does not impose any restrictions on this.

[0105] Reference Figure 5 , Figure 5 A flowchart showing a method for using a symmetric encryption algorithm provided in an embodiment of the present application is shown. The method for using a symmetric encryption algorithm provided in an embodiment of the present application at least includes the following steps:

[0106] Step 510: Obtain input data, a preset zeroth mapping, a first mapping, and a symmetric encryption algorithm; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping;

[0107] Step 520: According to the input data, obtain a zeroth mapping value through the zeroth mapping process, and obtain a first mapping value through the first mapping process;

[0108] Step 530: Using the symmetric encryption algorithm, with the zeroth mapping value as the input plaintext and the first mapping value as the input key, perform encryption calculation to obtain a target ciphertext, and use the target ciphertext as the one-way function value about the input data.

[0109] In an embodiment of the present application, based on the aforementioned principle of generating a one-way function, a method for using a symmetric encryption algorithm is provided. This method can realize the construction of a one-way function based on the symmetric encryption algorithm used by an existing symmetric encryption module in a related system or product and the pre-set zeroth mapping and first mapping.

[0110] Specifically, in an embodiment of the present application, when a one-way function is needed to calculate a function value corresponding to input data, the input data, two preset mappings, and a symmetric encryption algorithm can be obtained. Here, the symmetric encryption algorithm can be a symmetric encryption algorithm used by a symmetric encryption module that already exists in a related system or product. The two mappings can be recorded as the zeroth mapping and the first mapping. The number of independent variables of the zeroth mapping and the first mapping is 1, and the independent variables of the two mappings are the same. Among them, the first mapping is a one-to-one mapping, and the type of the zeroth mapping is not limited in this application. For the examples of the zeroth mapping and the first mapping, it can be implemented with reference to the aforementioned embodiments.

[0111] In an embodiment of the present application, the input data can be processed using the zeroth mapping, and the result obtained is recorded as the zeroth mapping value, and the input data can be processed using the first mapping, and the result obtained is recorded as the first mapping value. This application does not limit the calculation order of the zeroth mapping and the first mapping, and it can be that the first mapping value is calculated first and then the zeroth mapping value is calculated, or it can be the reverse, the zeroth mapping value is calculated first and then the first mapping value is calculated, or the two mapping values ​​are calculated synchronously. After obtaining the zeroth mapping value and the first mapping value, the zeroth mapping value can be used as the plaintext of the input symmetric encryption algorithm and the first mapping value can be used as the key of the input symmetric encryption algorithm, and the corresponding ciphertext can be obtained after encryption calculation. In an embodiment of the present application, it is recorded as the target ciphertext, and the target ciphertext can be used as a one-way function value about the input data.

[0112] It can be understood that the contents of the above-mentioned one-way function generation method embodiment are all applicable to the use method embodiment of the present symmetric encryption algorithm. The functions specifically implemented by the use method embodiment of the present symmetric encryption algorithm are similar to those of the above-mentioned one-way function generation method embodiment, and the beneficial effects achieved are also similar to the beneficial effects achieved by the above-mentioned one-way function generation method embodiment, which will not be elaborated here.

[0113] Specifically, in some embodiments, obtaining the first mapping value through the first mapping process includes:

[0114] Perform a target operation on the input data and a preset constant to obtain the first mapping value;

[0115] The target operation includes at least one of a sum operation, a difference operation or an XOR operation.

[0116] As described above, the first mapping may be g1(x), and g1(x) may be a target operation on the input data (i.e., x) and a preset constant. The operation method here may include but is not limited to at least one of a sum operation, a difference operation, or an XOR operation, and the result of the operation is the first mapping value.

[0117] Specifically, refer to Figure 6 In the embodiments of the present application, the first mapping may also be some data processing rules. For example, in some embodiments, the first mapping may be to cut the input data into a plurality of data segments, each of which may include a plurality of bits of data content. Then, the data segments may be reordered, and the combined data may be used as the first mapping value. Of course, the data processing rules corresponding to the first mapping need to be pre-set.

[0118] For example, assume that the input data is 128 bits, that is, |x|=128 bits. The input data is represented in bytes as x=x[1]x[2]x[3]x[4]...x

[15] x

[16] , where x[i] represents the i-th byte starting from the most significant bit, and x

[16] is the least significant byte. The first mapping can be to swap the input data in pairs, for example, referring to Figure 7 , Figure 7 A schematic diagram showing a principle of a first mapping provided in an embodiment of the present application is shown. Figure 7 In , two adjacent bytes can be swapped as a group, and the obtained first mapping value can be expressed as:

[0119] g1(x)=x[2]x[1]x[4]x[3]...x

[16] x

[15]

[0120] Of course, it is understandable that in the embodiment of the present application, the first mapping may not necessarily be used to cut and reorganize the input data. Figure 7 In some embodiments, after the input data is cut to obtain a plurality of data segments, one or more of the data segments may be transformed, for example, by adding a set constant, performing an XOR process with the set constant, etc., and then reorganizing to obtain a first mapping value.

[0121] The technical solution in this application helps to improve the output-input ratio and user experience of information security applications, and produces positive economic and social benefits. Below, the technical solution in the embodiment of this application is introduced and explained in combination with specific application scenarios.

[0122] Embodiment 1

[0123] A certain company is an artificial intelligence company. The smart community solution it provides records videos in real time through cameras installed in various places and uploads them to the central control server. The server detects various predefined scenarios in real time through artificial intelligence algorithms and sends corresponding alarms, such as an elderly person falling on the road or corridor in a building, a large open flame near the kitchen window of a house, someone climbing over the wall or fence of a residential area, a car parked in a non-parking area, a fight or even a fight with weapons in the park, thick smoke in the electric garage or elevator, untethered non-small animals appearing in the park, high-rise residents throwing objects out, and infants or young children walking alone from the park to the exit, etc. In order to achieve the corresponding security level, all videos are encrypted, transmitted and stored, and the encryption algorithm uses the domestic sequence cipher algorithm ZUC.

[0124] For any camera, it is inappropriate to always use a fixed symmetric key to encrypt the video and transmit it to the central control server. For example, assuming that at time t, the symmetric key x is leaked to the hacker, then even the encrypted traffic eavesdropped by the hacker before time t can all be decrypted by the hacker. The standard approach to overcome this defect is to update the key x. For example, the camera uses an agreed one-way function f to process the current key x at zero o'clock every day, and replaces x with the calculated one-way function value f(x) as the new key, and notifies the server accordingly, so that the server can also update the key and decrypt the traffic accordingly. In this way, even if a key is leaked, hackers cannot reversely deduce an earlier key to decrypt the previous traffic. Obviously, this happens to be the scenario considered in this application: the symmetric encryption module is already in place (here is the domestic sequence cipher algorithm ZUC), and a new one-way function f needs to be added.

[0125] Applying the technical solution in the present application, the company can specify an instance of ZUC as p=E(k,c); for a stream cipher such as ZUC, this only requires fixing the initial vector (iv), for example, specifying iv as 128 bits of all 1s. The formula corresponding to the zeroth mapping and the first mapping is g0(x)=g1(x)=x. Whenever the current key x is to be replaced with a new f(x), x itself is encrypted with the current key x to obtain f(x)=E(x,x) as the new version of the key. It can be understood that since x is the ZUC key for encrypting video traffic, |x|=128 bits, and the ciphertext output by the stream cipher algorithm is of the same length as the plaintext, so |f(x)|=|E(x,x)| is also 128 bits, so f(x) can be used as a new key to encrypt video traffic, and can be iteratively calculated and updated regularly (for example, at zero o'clock every day).

[0126] Embodiment 2

[0127] A certain company is an information security company. It already has a product with good sales. The product is a handheld smart mobile device. Its core function is to use a domestic block cipher algorithm (one of SM1, SM4, and SM7) to encrypt, decrypt, send and receive sensitive data. Based on the results of the customer demand survey, the company plans to upgrade the product: add support for password-based identity authentication so that the product can also be used as an electronic key. The company hopes to complete this functional upgrade with the minimum investment, rather than setting up a special project to develop a new electronic key product like other companies in the industry. This strategy is easy to understand: the more devices users need to carry, the worse the experience.

[0128] To this end, the company selected the Lamport one-time password scheme (or an improved scheme based on it) as the identity authentication protocol. The main features of this scheme are: the authentication data sent by the device to the authentication server each time is different (the so-called one-time password); there is a preset upper limit on the number of authentications, and the main operation involved in this scheme is to iteratively call a one-way function f.

[0129] By applying the technical solution in this application, the company can easily implement the one-way function f based on the existing block cipher algorithm without introducing the code or circuit of the hash algorithm such as SM3 as in the conventional technical route. A possible specific implementation is as follows: the user password is limited to a string containing up to 16 uppercase and lowercase letters, numbers, and special symbols, and each character is converted into 8 bits according to the ASCII code table. If the character is less than 16, the tail is filled with 8 0 bits per character, so that the user password is converted into a 128-bit input x.

[0130] The formula corresponding to the zeroth mapping is specified as g0(x)=x+1, that is, x is incremented by 1 and only the lower 128 bits of the result are retained. The formula corresponding to the first mapping is specified as g1(x)=x⊕0x000102030405060708090A0B0C0D0E0F, that is, x is XORed with a 128-bit constant. Specify E as an existing block cipher algorithm, with ECB working mode, first calculate g0(x) and g1(x) respectively, then calculate and output f(x)=E(g1(x),g0(x)).

[0131] It should be added that in the embodiments of the present application, when the password consists of only ASCII characters, it is recommended that the password contain 15 or 16 characters. When the password also contains at least one Chinese character, the password can be appropriately shortened. For example, the GBK encoding includes a total of 21,000 commonly used Chinese characters, and each encoding is 16 bits. For example, the encoding of "科" is 0xBFC6, and the encoding of "学" is 0xD1A7. As long as the password掺入 with Chinese characters can be accommodated in 128 bits, it can be used as the input of f(x) = E(g1(x), g0(x)). For example, the hexadecimal encoding of "ABC科abc学123&\#" is 0x414243BFC6616263D1A7313233232425, with a length of 128 bits, which can better resist attacks.

[0132] Referring to Figure 8 , in the embodiments of the present application, a generation system for a one-way function is further provided. The system includes:

[0133] A first acquisition unit 810, configured to acquire a preset symmetric encryption algorithm, a zero mapping, and a first mapping; wherein, the zero mapping and the first mapping have a single and same independent variable, and the first mapping is a one-to-one mapping;

[0134] A first processing unit 820, configured to perform encryption calculation through the symmetric encryption algorithm, using the mapping value of the zero mapping as the input plaintext and the mapping value of the first mapping as the input key to obtain a first ciphertext;

[0135] A first output unit 830, configured to use the mapping relationship between the first ciphertext and the independent variable as a generated one-way function.

[0136] Referring to Fig. 9 , in the embodiments of the present application, a usage system for a symmetric encryption algorithm is further provided. The system includes:

[0137] A second acquisition unit 910, configured to acquire input data, a preset zero mapping, a first mapping, and a symmetric encryption algorithm; wherein, the zero mapping and the first mapping have a single and same independent variable, and the first mapping is a one-to-one mapping;

[0138] A second processing unit 920, configured to process the input data through the zero mapping to obtain a zero mapping value, and process the input data through the first mapping to obtain a first mapping value;

[0139] A second output unit 930, configured to perform encryption calculation through the symmetric encryption algorithm, using the zero mapping value as the input plaintext and the first mapping value as the input key to obtain a target ciphertext, and using the target ciphertext as the one-way function value with respect to the input data.

[0140] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0141] Reference Fig.10 , the embodiment of the present application further provides an electronic device, including:

[0142] Symmetric encryption module 1010;

[0143] at least one processor 1020;

[0144] At least one memory 1030, used to store at least one program;

[0145] When at least one program is executed by at least one processor 1020, at least one processor 1020 implements the above-mentioned method for generating a one-way function or the method for using a symmetric encryption algorithm.

[0146] The electronic device of the embodiment of the present application may be a terminal device, a computer device or a server device.

[0147] Similarly, the contents of the above method embodiments are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0148] An embodiment of the present application also provides a computer-readable storage medium, which stores a program executable by a central processing unit. When the program executable by the central processing unit is executed by the central processing unit, it is used to execute the above-mentioned method for generating a one-way function or a method for using a symmetric encryption algorithm.

[0149] Similarly, the contents of the above method embodiments are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0150] In some optional embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the application is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. The optional embodiment is expected, wherein the order of various operations is changed and the sub-operation described as a part of a larger operation is performed independently.

[0151] In addition, although the present application is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present application. More specifically, in view of the properties, functions, and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional techniques of the engineer. Therefore, those skilled in the art can implement the present application set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present application, which is determined by the full scope of the attached claims and their equivalents.

[0152] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0153] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.

[0154] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0155] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0156] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0157] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present application, and that the scope of the present application is defined by the claims and their equivalents.

[0158] The above is a specific description of the preferred implementation of the present application, but the present application is not limited to the embodiments. Technical personnel familiar with the field can make various equivalent modifications or substitutions without violating the spirit of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present application.

Claims

1. A method for generating a one-way function, characterized in that: The method comprises: Obtaining a preset symmetric encryption algorithm, a zeroth mapping, and a first mapping; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping; By using the symmetric encryption algorithm, the mapping value of the zeroth mapping is used as the input plain text, and the mapping value of the first mapping is used as the input key to perform encryption calculation to obtain a first ciphertext; A mapping relationship between the first ciphertext and the independent variable is used as a generated one-way function.

2. The method for generating a one-way function according to claim 1, characterized in that: The method further comprises: Obtain a second mapping, where the second mapping is a one-to-one mapping and the second mapping has the same independent variable as the first mapping; Using the symmetric encryption algorithm, the first ciphertext is used as the input plaintext, and the mapping value of the second mapping is used as the input key to perform encryption calculation to obtain the second ciphertext; A mapping relationship between the second ciphertext and the independent variable is used as a generated one-way function.

3. The method for generating a one-way function according to claim 1, characterized in that: The method further comprises: Obtaining an Nth mapping, wherein the Nth mapping is a one-to-one mapping and the independent variable of the Nth mapping is the same as that of the first mapping; By using the symmetric encryption algorithm, the N-1th ciphertext is used as the input plaintext and the mapping value of the Nth mapping is used as the input key to perform encryption calculation to obtain the Nth ciphertext; If the current value of N is less than the preset value, N is incremented by 1, and the step of obtaining the Nth mapping is returned to be executed; or, if the current value of N is equal to the preset value, the mapping relationship between the current Nth ciphertext and the independent variable is used as a generated one-way function; Among them, the initial value of N is 2, and the preset value is an integer value greater than 2.

4. A method for using a symmetric encryption algorithm, characterized in that: The method comprises: Obtain input data, a preset zeroth mapping, a first mapping, and a symmetric encryption algorithm; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping; According to the input data, obtaining a zeroth mapping value through the zeroth mapping process, and obtaining a first mapping value through the first mapping process; Through the symmetric encryption algorithm, the zeroth mapping value is used as the input plaintext and the first mapping value is used as the input key to perform encryption calculation to obtain the target ciphertext, and the target ciphertext is used as the one-way function value about the input data.

5. The method for using a symmetric encryption algorithm according to claim 4, characterized in that: The obtaining a first mapping value through the first mapping process includes: Perform a target operation on the input data and a preset constant to obtain the first mapping value; The target operation includes at least one of a sum operation, a difference operation or an XOR operation.

6. The method for using a symmetric encryption algorithm according to claim 4, characterized in that: The obtaining a first mapping value through the first mapping process includes: Cutting the input data to obtain a plurality of data segments; wherein each of the data segments includes a plurality of bits of data content; The data segments are reordered according to a preset rule and combined to obtain the first mapping value.

7. A one-way function generation system, characterized in that: The generation system comprises: A first acquisition unit, configured to acquire a preset symmetric encryption algorithm, a zeroth mapping, and a first mapping; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping; A first processing unit, configured to perform encryption calculation by using the symmetric encryption algorithm, with the mapping value of the zeroth mapping as the input plaintext and the mapping value of the first mapping as the input key to obtain a first ciphertext; The first output unit is configured to use the mapping relationship between the first ciphertext and the independent variable as a generated one-way function.

8. A system for using a symmetric encryption algorithm, characterized in that: The use system comprises: A second acquisition unit, configured to acquire input data, a preset zeroth mapping, a first mapping, and a symmetric encryption algorithm; wherein the zeroth mapping and the first mapping have a single and identical independent variable, and the first mapping is a one-to-one mapping; a second processing unit, configured to obtain a zeroth mapping value through the zeroth mapping process according to the input data, and obtain a first mapping value through the first mapping process; The second output unit is used to perform encryption calculation through the symmetric encryption algorithm, using the zeroth mapping value as the input plaintext and the first mapping value as the input key to obtain the target ciphertext, and using the target ciphertext as the one-way function value about the input data.

9. An electronic device, characterized in that: include: Symmetric encryption module; at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 6.

10. A computer-readable storage medium storing a program executable by a processor, characterized in that: The processor-executable program is used to implement the method according to any one of claims 1 to 6 when executed by the processor.

Citation Information

Cited By

  • Method for generating one-way function, system, device, and storage medium

    WO2026098067A1