CN116073991A - Private key generation method, electronic device, readable storage medium, and program product - Google Patents

Private key generation method, electronic device, readable storage medium, and program product Download PDF

Info

Publication number
CN116073991A
CN116073991A CN202211104721.8A CN202211104721A CN116073991A CN 116073991 A CN116073991 A CN 116073991A CN 202211104721 A CN202211104721 A CN 202211104721A CN 116073991 A CN116073991 A CN 116073991A
Authority
CN
China
Prior art keywords
private key
key
key generation
information
algorithm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211104721.8A
Other languages
Chinese (zh)
Inventor
马振克
吕达夫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ARM Technology China Co Ltd
Original Assignee
ARM Technology China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ARM Technology China Co Ltd filed Critical ARM Technology China Co Ltd
Priority to CN202211104721.8A priority Critical patent/CN116073991A/en
Publication of CN116073991A publication Critical patent/CN116073991A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/0822Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) using key encryption key
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy
    • H04L9/3066Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy involving algebraic varieties, e.g. elliptic or hyper-elliptic curves

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Physics (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Algebra (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The application relates to the field of information security, and discloses a private key generation method, electronic equipment, a readable storage medium and a program product. The private key generation method includes the steps that through obtaining preset key generation information, the key generation information is input into a key generation module, a candidate private key for a public key cryptosystem output by the key generation module is obtained, the candidate private key is formatted, a formatting result is determined to be the private key, then the private key is input into a security processing module, so that the security processing module performs information security processing based on the public key cryptosystem according to the private key, automatic private key generation can be provided for the public key cryptosystem according to the preset information, the generated private key is provided for the security processing module to perform information security processing, the private key does not need to be stored, the user is prevented from participating in management of the private key, and the possibility of private key leakage is reduced.

Description

Private key generation method, electronic device, readable storage medium, and program product
Technical Field
The present invention relates to the field of information security, and in particular, to a private key generation method, an electronic device, a readable storage medium, and a program product.
Background
With the continuous emergence of information security requirements such as identity authentication, digital signature and the like in modern society, the cryptographic technology is promoted to be rapidly developed, and a public key cryptosystem is one of the basic stones of modern information security. In the public key cryptosystem, an encryption key, namely a public key, and a decryption key, namely a private key, are different keys, wherein the public key is a public key which can be released, and the private key is stored by the private of a user and cannot be revealed.
At present, a private key of a public key cryptosystem is often managed by a user, for example, the private key is stored in a file form on a portable storage device, when identity authentication or digital signature is required, the user provides a corresponding private key to complete information security processing, and in this way, the user can contact the private key and needs to carry a storage device of the private key, such as a USB flash disk, and the like, so that leakage of the private key is easily caused.
Disclosure of Invention
The embodiment of the application provides a private key generation method, electronic equipment, a readable storage medium and a program product.
In a first aspect, an embodiment of the present application provides a method for generating a private key, which is used for an electronic device, and the method includes:
acquiring preset key generation information;
inputting the key generation information into a key generation module, and obtaining a candidate private key for the public key cryptosystem output by the key generation module;
Formatting the candidate private key, and determining a formatting result as a private key;
and inputting the private key into a security processing module so that the security processing module performs information security processing based on a public key cryptosystem according to the private key.
It can be understood that the private key in the existing public key cryptosystem is randomly generated, and the user realizes the management of the private key, so that the private key is easy to leak, and the security of information security processing such as identity authentication, digital signature and the like is reduced.
By the method, automatic private key generation can be provided for the public key cryptosystem according to preset information, and the generated private key is provided for the security processing module to perform information security processing, so that the private key is not required to be stored, users are prevented from participating in management of the private key, and the possibility of private key leakage is reduced.
In a possible implementation of the first aspect, the key generation module generates the candidate private key through a key ladder mechanism.
By the method, the private key of the public key cryptosystem can be generated in an automatic mode, and the private key is regenerated when the private key is needed to be used, so that the storage of the private key is avoided, and the possibility of leakage of the private key is reduced.
In a possible implementation of the first aspect, the key generation information includes a plurality of pieces of key generation sub-information, and security key information.
By the method, the private key can be generated according to the preset safety key information and the key generation sub-information, and the user can use different numbers of key generation sub-information to generate the private key according to the self requirement.
In a possible implementation of the first aspect, the plurality of key generation sub-information includes first key generation information, second key generation information, and third key generation information.
By the method, the preferred quantity of the key generation sub-information is determined, so that excessive key generation information is avoided on the basis of ensuring the key security.
In a possible implementation of the first aspect described above, the secure key information is stored in a one-time programmable memory and is only accessible by the key generation module.
By the method, the safety of the safety key information can be ensured to the greatest extent, and leakage of the safety key is avoided.
In a possible implementation manner of the first aspect, the key generating module includes a first algorithm unit, a second algorithm unit, and a third algorithm unit, where the first algorithm unit, the second algorithm unit, and the third algorithm unit are configured to encrypt or decrypt input data according to a preset algorithm.
By the method, the optimal number of the algorithm units in the key generation module is determined, so that the key generation speed is increased on the basis of ensuring the security of the key.
In a possible implementation of the first aspect, the method further includes:
inputting the first key generation information and the security key information into a first algorithm unit, and determining a first output result;
inputting the second key generation information and the first output result into a second algorithm unit, and determining a second output result;
inputting the third key generation information and the second output result into a third algorithm unit to determine a third output result;
and taking the third output result as a candidate private key.
By the method, the candidate private key in the public key cryptosystem is generated in a key ladder mode, and the randomness of the generation of the candidate private key is ensured.
In a possible implementation of the first aspect, the security processing module performs the information security processing based on an elliptic curve cryptography algorithm.
By the method, various types of information security processing based on elliptic curve encryption algorithm is realized, and the application range of the generated private key is improved.
In a possible implementation manner of the first aspect, formatting the candidate private key, determining a formatting result as the private key includes:
Performing modular operation on the candidate private key;
in the case where the modulo operation result is non-zero, the modulo operation result is determined to be the private key.
By the method, the generated candidate private key is adjusted to be the private key conforming to the elliptic curve cryptosystem, and the method can be used for the elliptic curve cryptosystem.
In a second aspect, an embodiment of the present application provides an electronic device, including:
a memory for storing instructions for execution by one or more processors of the electronic device, an
A processor, which is one of the processors of the electronic device, for performing the private key generation method of the first aspect and any of the various possible implementations of the first aspect.
In a third aspect, embodiments of the present application provide a computer-readable storage medium having stored thereon instructions that, when executed on a computer, cause the computer to perform the private key generation method of the first aspect and any of the various possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer program product comprising a computer program/instruction which, when executed on a computer, causes the computer to perform the private key generation method of the first aspect described above and any of the various possible implementations of the first aspect.
Drawings
Fig. 1 illustrates a schematic view of a scenario of a private key generation method, according to some embodiments of the present application.
Fig. 2 illustrates a hardware block diagram of an electronic device for a private key generation method, according to some embodiments of the present application.
Fig. 3 illustrates a flow diagram of a private key generation method, according to some embodiments of the present application.
Fig. 4 illustrates a schematic diagram of a key generation module, according to some embodiments of the present application.
FIG. 5 illustrates a parametric diagram of an elliptic curve algorithm, according to some embodiments of the present application.
Fig. 6 illustrates a flow diagram for digital signature using elliptic curve cryptography algorithm, according to some embodiments of the present application.
Fig. 7 illustrates a schematic diagram of a scenario for chip-based identity authentication, according to some embodiments of the present application.
Fig. 8 illustrates a hardware block diagram of another electronic device for a private key generation method, according to some embodiments of the present application.
Detailed Description
Illustrative embodiments of the present application include, but are not limited to, private key generation methods, electronic devices, readable storage media, and program products.
It can be understood that the private key generation method is suitable for generating the private key in the elliptic curve cryptosystem according to the information provided by the user and providing the private key for the elliptic curve cryptosystem in an automatic mode to perform the scene of information security processing.
As described above, in the conventional elliptic curve cryptosystem, the private key is randomly generated and managed by the user, for example, the private key is stored in a portable storage device in a file form, and when the private key is needed to be used, the user provides the private key to perform corresponding processes such as identity authentication and digital signature.
In order to solve the problem, the embodiment of the application provides a private key generation method with higher security, a user does not need to participate in the management and use of the private key, only needs to provide information required by generating the private key to automatically generate the private key, and directly provides the information to a security processing module based on an elliptic curve encryption algorithm to finish corresponding identity authentication, digital signature and other processing, so that the participation of the user is reduced, the private key is prevented from being stored in a storage device, the possibility of revealing the private key is reduced, and the security of the identity authentication, digital signature and other processing is improved.
Fig. 1 is a schematic view of a scenario of a private key generation method according to an embodiment of the present application. As shown in fig. 1, the scenario includes an electronic device 100, a key generation module 200, and a security processing module 300.
Here, the electronic device 100 is used as an execution body of the private key generating method in the embodiment of the present application, and is configured to complete generation of a private key in a public key cryptosystem, and provide the generated private key to an encryption system, where the encryption system completes corresponding information security processing such as encryption, identity authentication, digital signature, and the like according to the private key.
The key generation module 200 is configured to generate a private key in the public key cryptosystem, and may generate a corresponding private key according to information provided by a user, such as the first key generation information, the second key generation information, the third key generation information, and the security key, and provide the private key to the security processing module 300.
It is understood that the key generation method used in the key generation module 200 may be a variety of encryption/decryption algorithms, such as a key ladder-based algorithm, a pseudo-random number generation algorithm, etc., which are not particularly limited in this embodiment of the present application.
Here, the first key generation information, the second key generation information, and the third key generation information are information provided by the user, and the user can use any information according to his own preference. For example, the first key generation information, the second key generation information, and the third key generation information provided by the user may be character strings, or may be a sequence of numbers, or a sequence of characters and numbers, or the like.
It will be appreciated that the first key generation information, the second key generation information, and the third key generation information may be the same type of data, for example, all are strings or digit sequences, or may be different types of data, for example, the first key generation information is a string, the second key generation information is a digit sequence, the third key generation information is a sequence composed of characters and digits, etc., which is not particularly limited in the embodiment of the present application.
It will be appreciated that the number of information provided by the user, the first key generation information, the second key generation information, and the third key generation information, is merely exemplary, and is not meant to limit the number of information provided by the user, and the key generation module 200 may require the user or other device to provide a plurality of pieces of information as needed according to the respective requirements of generating the private key, which the embodiments of the present application do not specifically limit.
The security key is used to generate a private key together with information provided by the user, where the security key is protected by a corresponding security measure, such as a chip identifier, a serial code, etc., and the security measure may be that only the key generation module 200 has access to the security key, and other devices cannot access the security key, etc.
The security processing module 300 is configured to receive the generated private key, encrypt the input plaintext according to the private key, and output the corresponding ciphertext.
It will be appreciated that the public key cryptosystem used in the secure processing module 300 may use a variety of elliptic curve-based cryptosystems, and the embodiments of the present application are not limited in detail.
According to the method and the device, the private key in the public key cryptosystem is generated according to the information provided by the user and the corresponding encryption/decryption algorithm, and the generated private key is transmitted to the security processing module in real time and used by the security processing module, so that the storage of the private key on the storage device is avoided, the user cannot directly contact the private key, the possibility of private key leakage is reduced, and the security of the private key is improved.
The private key generation method is suitable for the scene of information security processing by using a public key cryptosystem.
It is understood that the electronic device 100 in the embodiments of the present application may include, but is not limited to, a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), and the like, and the specific type of the electronic device 100 is not specifically limited by the embodiments of the present application.
Fig. 2 shows a schematic structural diagram of an electronic device 100 for a private key generation method according to an embodiment of the present application. As shown in fig. 2, the electronic device 100 may include a processor 110, a power module 140, a memory 180, a camera 170, a mobile communication module 130, a wireless communication module 120, a sensor module 190, an audio module 150, an interface module 160, and a display screen 102, among others.
It should be understood that the illustrated structure of the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, for example, processing modules or processing circuits that may include a central processor CPU (Central Processing Unit), an image processor GPU (Graphics Processing Unit), a digital signal processor DSP (Digital Signal Processor), a microprocessor MCU (Micro-programmed Control Unit), an AI (Artificial Intelligence ) processor, a programmable logic device FPGA (Field Programmable Gate Array), and the like. Wherein the different processing units may be separate devices or may be integrated in one or more processors. For example, in some embodiments of the present application, the processor 110 may be configured to perform a key generation process according to the received user information, provide the generated key to the encryption device, and perform an encryption algorithm of a corresponding public key cryptosystem according to the key to convert the plaintext into the ciphertext.
The Memory 180 may be used to store data, software programs, and modules, and may be a Volatile Memory (RAM), such as a Random-Access Memory (RAM); or a nonvolatile Memory (Non-Volatile Memory), such as a Read-Only Memory (ROM), a Flash Memory (Flash Memory), a Hard Disk (HDD) or a Solid State Drive (SSD); or a combination of the above types of memories, or may be a removable storage medium, such as a Secure Digital (SD) memory card. In particular, memory 180 may include a program storage area 1801 and a data storage area 1802. Stored within the memory program area 1801 may be program code for causing the processor 110 to perform the private key generation methods provided by some embodiments of the present application by executing the program code. In some embodiments of the present application, the data storage 1802 may be used to store user provided information, elliptic curve parameters, and the like.
The power module 140 may include a power source, a power management component, and the like. The power source may be a battery. The power management component is used for managing the charging of the power supply and the power supply supplying of the power supply to other modules. The charging management module is used for receiving charging input from the charger; the power management module is used for connecting a power supply, and the charging management module is connected with the processor 110.
The mobile communication module 130 may include, but is not limited to, an antenna, a power amplifier, a filter, a low noise amplifier (Low Noise Amplify, LNA), and the like. The mobile communication module 130 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied on the electronic device 100. The mobile communication module 130 may receive electromagnetic waves from an antenna, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to a modem processor for demodulation. The mobile communication module 130 may amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 130 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 130 may be disposed in the same device as at least some of the modules of the processor 110.
The wireless communication module 120 may include an antenna, and transmit and receive electromagnetic waves via the antenna. The wireless communication module 120 may provide solutions for wireless communication including wireless local area network (Wireless Local Area Networks, WLAN) (e.g., wireless fidelity (Wireless Fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (Global Navigation Satellite System, GNSS), frequency modulation (Frequency Modulation, FM), near field wireless communication technology (Near Field Communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The electronic device 100 may communicate with networks and other devices through wireless communication technology.
In some embodiments, the mobile communication module 130 and the wireless communication module 120 of the electronic device 100 may also be located in the same module.
The camera 170 is used to capture still images or video. An optical image of a scene generated by a lens is projected onto a photosensitive element. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to an ISP (Image Signal Processor ) to be converted into a digital image signal. The electronic device 100 may implement a photographing function through an ISP, a camera 170, a video codec, a GPU (Graphic Processing Unit, a graphics processor), a display screen 102, an application processor, and the like.
The display screen 102 includes a display panel. The display panel may employ a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-emitting Diode (OLED), an Active-matrix Organic Light-emitting Diode (AMOLED), a flexible Light-emitting Diode (Flex Light-emitting Diode, FLED), a Mini LED, a Micro OLED, a quantum dot Light-emitting Diode (QLED), or the like. For example, the display screen 102 is used to display a clear text display interface of the electronic device 100, etc.).
The sensor module 190 may include a proximity light sensor, a pressure sensor, a gyroscope sensor, a barometric sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
The audio module 150 may convert digital audio information to an analog audio signal output or convert an analog audio input to a digital audio signal. The audio module 150 may also be used to encode and decode audio signals. In some embodiments, the audio module 150 may be disposed in the processor 110, or some functional modules of the audio module 150 may be disposed in the processor 110. In some embodiments, the audio module 150 may include a speaker, an earpiece, a microphone, and an earphone interface.
The interface module 160 includes an external memory interface, a universal serial bus (Universal Serial Bus, USB) interface, a subscriber identity module (Subscriber Identification Module, SIM) card interface, and the like. Wherein the external memory interface may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface to implement data storage functions. The universal serial bus interface is used for communication between the electronic device 100 and other handsets. The subscriber identity module card interface is used to communicate with a SIM card mounted to the electronic device 100, for example, by reading a telephone number stored in the SIM card or by writing a telephone number to the SIM card.
In some embodiments, the electronic device 100 further includes keys 101, motors, indicators, and the like. The key 101 may include a volume key, an on/off key, and the like. The motor is used to generate a vibration effect for the electronic device 100. The indicators may include laser indicators, radio frequency indicators, LED indicators, and the like.
For convenience of description, the specific process implemented by the private key generation method of the present application will be specifically described below by taking the electronic device 100 as an example of a mobile phone.
The private key generation method according to the embodiment of the present application will be described in detail with reference to fig. 3, and the implementation subject of the method is the mobile phone 100. As shown in fig. 3, the private key generation method in some embodiments of the present application may include the following steps:
step S301: and acquiring preset key generation information.
Here, the mobile phone 100 may include a key generation module and a security processing module, where the key generation module is configured to generate a private key that can be used in a public key cryptosystem according to the key generation information, and the security processing module completes information security processing based on the public key cryptosystem, such as identity verification, digital signature, and the like, according to the generated private key.
It will be appreciated that the key generation information may be a variety of information provided by the user, such as a string, a number sequence, a mixed sequence of characters and numbers, or may be automatically generated information, such as a chip identifier, generated random data, or the like, or may be a combination of information provided by the user and automatically generated information, which is not particularly limited in the embodiments of the present application.
In addition, it is understood that the key generation information may include a plurality of pieces of information, such as first key generation information, second key generation information, third key generation information, and security key provided by the user, and the embodiment of the present application is not particularly limited.
Here, the information provided by the user may be stored in the storage device of the mobile phone 100, or may be provided by the user when the information security related process is required.
In some embodiments of the present application, the key generation information may include information that uniquely identifies hardware, where the hardware may include, but is not limited to: hardware devices, chips, hardware components, hardware circuits, etc.
In some embodiments of the present application, the key generation information includes a secure key that may be stored in one-time programmable memory (One Time Programmable, OTP) that can only be read by the key generation module, and no other device of the handset 100 has the right to read the secure key. The security key information can be, for example, a chip unique root key, and the like, so that the security of the security key can be ensured to the greatest extent, and the leakage of the security key caused by illegal reading is avoided.
Here, the otp memory is a special type of nonvolatile memory that allows programming only once, and once programmed, data is permanently valid, often for storing reliable and repeatable read data.
Step S302: and generating a candidate private key for the public key cryptosystem according to the key generation information.
It will be appreciated that a variety of encryption/decryption mechanisms may be used to generate the candidate private key from the key generation information, such as a key ladder mechanism, a pseudo-random number generation mechanism, etc., as embodiments of the present application are not limited in detail.
In some embodiments of the present application, candidate private keys for a public key cryptosystem are generated from key generation information by a key ladder mechanism. Key Ladder (Key Ladder) is a way to generate a Key, and the Key is generated through multiple encryption/decryption processes.
Fig. 4 illustrates a schematic structure of a key generation module 200 according to an embodiment of the present application. As shown in fig. 4, the key generation module 200 includes a first algorithm unit, a second algorithm unit, and a third algorithm unit, and each algorithm unit performs a corresponding encryption/decryption operation on the input key and key generation information through a preset encryption/decryption algorithm, and outputs an information processing result.
It may be understood that the encryption operation and the decryption operation may be performed on the key generation information in each algorithm unit, which is not particularly limited in the embodiment of the present application.
The following describes an example of decryption operation of the input information by each algorithm unit.
Here, the key generation module 200 reads the secure key from the one-time programmable memory and acquires first key generation information (KI 1), and supplies both of the information to the first algorithm unit; the first algorithm unit receives the first key generation information (KI 1) and the secure key, takes the secure key as a decryption key, takes the first key generation information as ciphertext, carries out decryption operation on the first key generation information to obtain a first output result, and then provides the first output result to the second algorithm unit; the second algorithm unit receives the first output result and second key generation information (KI 2), takes the first output result as a decryption key, decrypts the second key generation information to obtain a second output result, and then provides the second output result to the third algorithm unit; the third algorithm unit receives the second output result and third key generation information (KI 3), decrypts the third key generation information with the second output result as a decryption key to obtain a third output result, and outputs the third output result as a generated candidate private key, which can be used in a public key cryptosystem.
It will be appreciated that the key generation module 200 shown in fig. 4 includes 3 algorithm units, and the number of algorithm units is merely an example, and is not limited to the number of algorithm units in the key generation module 200, and the number of algorithm units in the key generation module may be any number, which is not specifically limited in the embodiment of the present application.
In some embodiments of the present application, the algorithm used by the algorithm unit is a symmetric encryption/decryption algorithm. A symmetric encryption algorithm refers to an encryption algorithm that encrypts and decrypts the same key, for which the security of the encryption algorithm depends on the key, and the leakage of the key means that anyone can decrypt a transmitted or received message, so that the confidentiality of the key is critical in the symmetric encryption algorithm. The encryption algorithm has the characteristics of open algorithm, small calculated amount, high encryption speed and high encryption efficiency.
In some embodiments of the present application, the algorithm unit uses an advanced encryption standard algorithm (Advanced Encryption Standard, AES) or a national commercial cryptographic algorithm SM4. Here, the advanced encryption standard algorithm is a block cipher algorithm, i.e., the plaintext is divided into a plurality of groups, each group having an equal length, and each time a group of data is encrypted, until the entire plaintext is encrypted. In the advanced encryption standard algorithm standard specification, the packet length is 128 bits, that is, each packet is 16 bytes, the key length can be 128 bits, 192 bits or 256 bits, the key length is different, and the recommended number of encryption rounds is different.
The national commercial cryptographic algorithm SM4 is a self-designed block symmetric cryptographic algorithm in China, and can be used for replacing international algorithms such as DES/AES and the like. The SM4 algorithm has the same packet length as the AES algorithm, 128 bits.
It will be appreciated that the algorithm unit in the above embodiment uses the AES algorithm or the SM4 algorithm as an example, and is not limited to the algorithm unit, and any symmetric encryption/decryption algorithm may be used in the algorithm unit, which is not specifically limited in the embodiments of the present application.
Step S303: and formatting the candidate private key.
Here, the candidate private key generated in step S302 may not meet the private key requirement of the public key cryptosystem used, and thus the candidate private key needs to be formatted accordingly to meet the private key requirement of the public key cryptosystem used. Specifically, the candidate private key generated by the key generating module 200 may be provided to the security processing module 300, where the security processing module 300 formats the received candidate private key to obtain a private key, and then uses the obtained private key to perform corresponding information security processing.
In some embodiments of the present application, the security processing module 300 uses elliptic curve cryptosystem as the public key cryptosystem.
Elliptic curve cryptosystem is a widely used public key cryptosystem, and the security basis is the discrete logarithm problem on elliptic curve, and can provide higher-level security with smaller secret key due to great calculation difficulty. Elliptic curve cryptosystems are currently known public key systems, and have the highest encryption strength provided for each bit. Elliptic curve cryptosystem is based on elliptic curve, which is a plane curve determined on rectangular coordinate system using the following formula (1),
y 2 +a 1 xy+a 3 y=x 3 +a 2 x 2 +a 4 x+a 6 (1)
wherein the coefficient a i (i=1, 2,3,4, 6) is defined in a certain rational, irrational, complex or finite field GF (pr), and is applied to a computer, and the finite field GF (pr) is generally used. In addition, each point on the elliptic curve must be non-singular, or "smooth", i.e., mathematically "tangential to any point".
Fig. 5 shows a schematic diagram of the relationship between the parameters in the elliptic curve cryptography algorithm. As shown in fig. 5, in the elliptic curve cryptography algorithm for the public key cryptosystem, parameters used include N and G, where G is a point on a selected elliptic curve, that is, a base point for generating a subgroup, and the coordinates of G are a pair of two very large numbers, and N is the order of the elliptic curve subgroup. The private key d in elliptic curve cryptography algorithm is [1, N-1 ] ]The public key Q is (Q) x ,Q y ) Calculated by the dot multiplication operation of the parameters N and G and the private key d.
In some embodiments of the present application, the candidate private key is formatted to obtain a private key that meets the requirement of the elliptic curve algorithm private key, and modulo-N operation may be performed on the received candidate private key, where N is the order of the elliptic curve subgroup.
Here, the candidate private key is a derived_key, the private key obtained after formatting is d, and the private key d is obtained, and the following formula can be used:
d=derived_key mod N。
wherein mod is modulo operation, and the value range of the formatted private key d is [0, N-1].
It can be understood that if the formatted private key d is 0, since 0 cannot be used as the private key of the elliptic curve algorithm, it is necessary to inform the user that the first key generation information, the second key generation information and the third key generation information currently provided are 0 so that the generated private key cannot be used as the private key of the elliptic curve algorithm, and it is necessary for the user to submit the modified first key generation information, second key generation information and third key generation information to obtain the private key of the available elliptic curve algorithm.
It will be appreciated that the first key generation information, the second key generation information, and the third key generation information provided by the user may be modifications to one of the pieces of information, for example, modifications to the second key generation information, or modifications to two or three of the pieces of information, for example, modifications to the first key generation information and the third key generation information, which are not particularly limited in the embodiments of the present application.
Step S304: and carrying out information security processing according to the private key obtained after formatting.
In some embodiments of the present application, the private key obtained after formatting is used to perform information security processing based on elliptic curve algorithm. The private key obtained after formatting meets the digital range requirement of the private key in the elliptic curve algorithm and can be used as the private key of the elliptic curve algorithm. Elliptic curve arithmetic is widely used in current application, and corresponding information security processing can include but is not limited to encryption, decryption, digital signature, identity authentication and the like. The following describes a procedure of performing information security processing using the formatted private key, taking a digital signature scenario as an example.
Fig. 6 illustrates a flow chart for digital signature using elliptic curve cryptography algorithms according to some embodiments of the present application. As shown in fig. 6, the signature generation apparatus 600 is configured to provide a digital signature service and perform digital signature using elliptic curve digital signature algorithm (Elliptic Curve Digital Signature Algorithm, ECDSA). The signature generating apparatus 600 receives the following 4 sets of data: parameters N and G of elliptic curve, formatted private key d, hash value e to be signed and random number, and digital signature is carried out according to the data, and final signature (r, s) is output. The signature generating apparatus 600 performs digital signature including the steps of:
In step S601, an integer k is randomly generated in [1, N-1 ].
The generation range [1, N-1] of the random number is determined according to the parameter N of the received elliptic curve, an integer is randomly determined in the [1, N-1], and the integer is determined as k.
In step S602, points on the elliptic curve are calculated.
Determining a point on the elliptic curve based on the random integer k obtained in the previous step and the base point G of the elliptic curve, the coordinates (x 1 ,y 1 ) The calculation formula of (2) is as follows:
(x 1 ,y 1 )=k×G
in step S603, a parameter r in the digital signature is calculated.
And determining r in the digital signature according to the coordinates of the points obtained in the previous step and the parameter N of the elliptic curve. The calculation formula of r is as follows:
r=x 1 mod N
in step S604, it is determined whether r is 0.
If the calculated r is 0, indicating that the selected random number k has a problem, returning to the step S601 for execution, and regenerating the random integer k; if r is not 0, step S605 is performed.
Step S605 calculates S of the parameters in the digital signature.
R and related parameters obtained according to the previous step: the random integer k, the hash value e to be signed, the formatted private key d and the parameters N of the elliptic curve determine s in the digital signature. The calculation formula of s is as follows:
s=k -1 *(e+r*d)mod N
in step S606, it is determined whether the obtained S is 0.
If the calculated S is 0, the same returns to the step S601 to execute, and the random integer k is regenerated; if S is not 0, step S607 is performed.
Step S607 returns the generated signature (r, S).
The signature generation apparatus 600 receives the returned signature (r, s) and outputs the signature.
The private key generation method provided by the embodiment of the application has very wide application scenes, and the application scenes can include but are not limited to: chip-based authentication scenarios, private key storage scenarios based on identity authentication, etc. For example, in a chip-based authentication scenario, a chip manufacturer may configure first key generation information, second key generation information, third key generation information, and a security key in a chip, the chip generates a private key for an elliptic curve digital signature algorithm using the first key generation information, the second key generation information, and the third key generation information, digitally signs a message to be authenticated using the generated private key, and an authentication party obtains a public key corresponding to the generated private key from a chip vendor, and performs authentication on a received authentication message including the digital signature. For example, in a private key storage scene based on identity authentication, the internet of things device only needs to store the first key generation information, the second key generation information, the third key generation information and the security key, the private key which needs to be used is not needed to be stored, the storage of the private key needs to provide a larger security storage space, the cost is higher, and a large amount of storage space can be saved by using the private key generation method provided by the embodiment of the application, so that the storage cost is reduced while the security is improved.
The following describes an example of a chip-based authentication application scenario. Fig. 7 illustrates a schematic diagram of a scenario of chip-based identity authentication in accordance with some embodiments of the present application. As shown in fig. 7, a chip provider configures key generation information KI1, KI2, KI3 and a security key to a chip through a chip provider server, for example, stores the key generation information KI1, KI2, KI3 and the security key to the chip through a production line burning mode, the chip can be various types of chips, the chip realizes the private key generation method of the embodiment of the present application, generates a private key for an elliptic curve digital signature algorithm according to the stored key generation information, digitally signs verification information by using the generated private key to obtain a corresponding digital signature, and sends the generated digital signature and the verification information to a verification user. The verification user obtains a public key corresponding to the private key from the chip provider server, uses the public key to verify the received digital signature and verification information, and confirms that the received verification information is indeed from the chip, thereby realizing the identity authentication based on the chip.
Fig. 8 illustrates a block diagram of another electronic device 1400 for a private key generation method in accordance with some embodiments of the present application. In one embodiment, the electronic device 1400 may include one or more processors 1404, system control logic 1408 coupled to at least one of the processors 1404, system memory 1412 coupled to the system control logic 1408, non-volatile memory (NVM) 1416 coupled to the system control logic 1408, and a network interface 1420 coupled to the system control logic 1408.
In some embodiments, the processor 1404 may include one or more single-core or multi-core processors. In some embodiments, the processor 1404 may include any combination of general-purpose processors and special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In embodiments where the electronic device 1400 employs an eNB (enhanced base station) 101 or a RAN (Radio Access Network ) controller 102, the processor 1404 may be configured to perform various embodiments suitable for use in the present application.
In some embodiments, the system control logic 1408 may include any suitable interface controller to provide any suitable interface to at least one of the processors 1404 and/or any suitable device or component in communication with the system control logic 1408.
In some embodiments, the system control logic 1408 may include one or more memory controllers to provide an interface to the system memory 1412. The system memory 1412 may be used for loading and storing data and/or instructions. The memory 1412 of the electronic device 1400 may include any suitable volatile memory in some embodiments, such as suitable Dynamic Random Access Memory (DRAM).
NVM/memory 1416 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions. In some embodiments, NVM/memory 1416 may include any suitable nonvolatile memory such as flash memory and/or any suitable nonvolatile storage device, such as at least one of a HDD (Hard Disk Drive), a CD (Compact Disc) Drive, a DVD (Digital Versatile Disc ) Drive.
The NVM/memory 1416 may include a portion of the storage resources on the apparatus on which the electronic device 1400 is installed, or it may be accessed by, but is not necessarily part of, the device. For example, NVM/storage 1416 may be accessed over a network via network interface 1420.
In particular, the system memory 1412 and NVM/storage 1416 may include: a temporary copy and a permanent copy of instructions 1424. In some embodiments, instructions 1424, hardware, firmware, and/or software components thereof may additionally/alternatively be disposed in system control logic 1408, network interface 1420, and/or processor 1404.
The network interface 1420 may include a transceiver to provide a radio interface for the electronic device 1400 to communicate over one or more networks to any other suitable device (e.g., front end module, antenna, etc.). In some embodiments, the network interface 1420 may be integrated with other components of the electronic device 1400. For example, the network interface 1420 may be integrated with at least one of the processor 1404, the system memory 1412, the nvm/storage 1416, and a firmware device (not shown) having instructions which, when executed by at least one of the processor 1404, implement a private key generation method as shown in fig. 3, by the electronic device 1400.
The network interface 1420 may further include any suitable hardware and/or firmware to provide a multiple-input multiple-output radio interface. For example, network interface 1420 may be a network adapter, a wireless network adapter, a telephone modem, and/or a wireless modem.
In one embodiment, at least one of the processors 1404 may be packaged together with logic for one or more controllers of the system control logic 1408 to form a System In Package (SiP). In one embodiment, at least one of the processors 1404 may be integrated on the same die with logic for one or more controllers of the system control logic 1408 to form a system on chip (SoC).
The electronic device 1400 may further include: input/output (I/O) devices 1432. The I/O device 1432 may include a user interface to enable a user to interact with the electronic device 1400; the design of the peripheral component interface enables the peripheral component to also interact with the electronic device 1400. In some embodiments, the electronic device 1400 further includes a sensor for determining at least one of environmental conditions and location information associated with the electronic device 1400.
In some embodiments, the user interface may include, but is not limited to, a display (e.g., a liquid crystal display, a touch screen display, etc.), a speaker, a microphone, one or more cameras (e.g., still image cameras and/or video cameras), a flashlight (e.g., light emitting diode flash), and a keyboard.
In some embodiments, the peripheral component interface may include, but is not limited to, a non-volatile memory port, an audio jack, and a power interface.
In some embodiments, the sensors may include, but are not limited to, gyroscopic sensors, accelerometers, proximity sensors, ambient light sensors, and positioning units. The positioning unit may also be part of the network interface 1420 or interact with the network interface 1420 to communicate with components of a positioning network, such as Global Positioning System (GPS) satellites.
Embodiments of the mechanisms disclosed herein may be implemented in hardware, software, firmware, or a combination of these implementations. Embodiments of the present application may be implemented as a computer program or program code that is executed on a programmable system including at least one processor, a storage system (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device.
Program code may be applied to input instructions to perform the functions described herein and generate output information. The output information may be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor (Digital Signal Processor, DSP), microcontroller, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or microprocessor.
The program code may be implemented in a high level procedural or object oriented programming language to communicate with a processing system. Program code may also be implemented in assembly or machine language, if desired. Indeed, the mechanisms described in the present application are not limited in scope to any particular programming language. In either case, the language may be a compiled or interpreted language.
In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried by or stored on one or more transitory or non-transitory machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed over a network or through other computer readable media. Thus, a machine-readable medium may include any mechanism for storing or transmitting information in a form readable by a machine (e.g., a computer), including but not limited to floppy diskettes, optical disks, read-Only memories (CD-ROMs), magneto-optical disks, read Only Memories (ROMs), random access memories (Random Access Memory, RAMs), erasable programmable Read-Only memories (Erasable Programmable Read Only Memory, EPROMs), electrically erasable programmable Read-Only memories (Electrically Erasable Programmable Read-Only memories, EEPROMs), magnetic or optical cards, flash Memory, or tangible machine-readable Memory for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the internet in an electrical, optical, acoustical or other form of propagated signal. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a form readable by a machine (e.g., a computer).
In the drawings, some structural or methodological features may be shown in a particular arrangement and/or order. However, it should be understood that such a particular arrangement and/or ordering may not be required. Rather, in some embodiments, these features may be arranged in a different manner and/or order than shown in the illustrative figures. Additionally, the inclusion of structural or methodological features in a particular figure is not meant to imply that such features are required in all embodiments, and in some embodiments, may not be included or may be combined with other features.
It should be noted that, in the embodiments of the present application, each unit/module is a logic unit/module, and in physical aspect, one logic unit/module may be one physical unit/module, or may be a part of one physical unit/module, or may be implemented by a combination of multiple physical units/modules, where the physical implementation manner of the logic unit/module itself is not the most important, and the combination of functions implemented by the logic unit/module is the key to solve the technical problem posed by the present application. Furthermore, to highlight the innovative part of the present application, the above-described device embodiments of the present application do not introduce units/modules that are less closely related to solving the technical problems presented by the present application, which does not indicate that the above-described device embodiments do not have other units/modules.
It should be noted that in the examples and descriptions of this patent, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present application.

Claims (12)

1. A private key generation method for an electronic device, the method comprising:
acquiring preset key generation information;
inputting the key generation information into a key generation module, and obtaining a candidate private key for a public key cryptosystem output by the key generation module;
formatting the candidate private key, and determining a formatting result as a private key;
and inputting the private key into a security processing module so that the security processing module performs information security processing based on a public key cryptosystem according to the private key.
2. The method of claim 1, wherein the key generation module generates the candidate private key through a key ladder mechanism.
3. The method of claim 2, wherein the key generation information includes a plurality of pieces of key generation sub information, and security key information.
4. The method of claim 3, wherein the plurality of pieces of key generation sub-information comprises
First key generation information, second key generation information, and third key generation information.
5. The method of claim 4, wherein the secure key information is stored in one-time programmable memory and is accessible only by the key generation module.
6. The method according to claim 4 or 5, wherein the key generation module comprises a first algorithm unit, a second algorithm unit and a third algorithm unit, and the first algorithm unit, the second algorithm unit and the third algorithm unit are used for encrypting or decrypting input data according to a preset algorithm.
7. The method of claim 6, wherein the method further comprises:
inputting the first key generation information and the security key information into the first algorithm unit, and determining a first output result;
inputting the second key generation information and the first output result into the second algorithm unit to determine a second output result;
inputting the third key generation information and the second output result into the third algorithm unit to determine a third output result;
and taking the third output result as the candidate private key.
8. The method of claim 1, wherein the security processing module performs the information security processing based on an elliptic curve cryptography algorithm.
9. The method of claim 8, wherein formatting the candidate private key, determining the formatting result as the private key, comprises:
Performing modular operation on the candidate private key;
in the case where the modulo operation result is non-zero, the modulo operation result is determined to be the private key.
10. An electronic device, comprising:
a memory for storing instructions for execution by one or more processors of the electronic device, an
A processor, being one of the processors of an electronic device, for performing the private key generation method of any of claims 1-9.
11. A computer readable storage medium having stored thereon instructions which, when executed on a computer, cause the computer to perform the private key generation method of any of claims 1-9.
12. A computer program product comprising computer programs/instructions which, when executed on a computer, cause the computer to perform the private key generation method of any of claims 1-9.
CN202211104721.8A 2022-09-09 2022-09-09 Private key generation method, electronic device, readable storage medium, and program product Pending CN116073991A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211104721.8A CN116073991A (en) 2022-09-09 2022-09-09 Private key generation method, electronic device, readable storage medium, and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211104721.8A CN116073991A (en) 2022-09-09 2022-09-09 Private key generation method, electronic device, readable storage medium, and program product

Publications (1)

Publication Number Publication Date
CN116073991A true CN116073991A (en) 2023-05-05

Family

ID=86182705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211104721.8A Pending CN116073991A (en) 2022-09-09 2022-09-09 Private key generation method, electronic device, readable storage medium, and program product

Country Status (1)

Country Link
CN (1) CN116073991A (en)

Similar Documents

Publication Publication Date Title
CN109547471B (en) Network communication method and device
CN112640510B (en) Method and apparatus for establishing a wireless secure link while maintaining privacy from tracking
EP4254861A1 (en) Secure access method and device
CN101247605A (en) Short information enciphering and endorsement method, mobile terminal and short information ciphering system
CN114944925B (en) Signaling secure transmission method and device, server and SE chip
CN101682507A (en) Generation of device dependant rsa key
CN111935166B (en) Communication authentication method, system, electronic device, server, and storage medium
CN113573304A (en) Signature realization method, signature verification method, signature terminal, signature verification terminal and storage medium
CN108574571B (en) Private key generation method, device and system
WO2010023506A1 (en) Methods, apparatuses, computer program products, and systems for providing secure pairing and association for wireless devices
CN112182624A (en) Encryption method, encryption device, storage medium and electronic equipment
CN113852459B (en) Key agreement method, device and computer readable storage medium
CN114362951B (en) Method and device for updating certificates
CN111247770B (en) Method and related system for protecting vehicle external communication by using IBC
CN117560150A (en) Key determination method, device, electronic equipment and computer readable storage medium
CN113365264A (en) Block chain wireless network data transmission method, device and system
CN111277605B (en) Data sharing method and device, computer equipment and storage medium
CA2754370A1 (en) Method and device for data encryption and decryption
CN105681256A (en) Audio communication method and audio communication application device
CN116208411A (en) Encryption method and device and electronic equipment
CN116073991A (en) Private key generation method, electronic device, readable storage medium, and program product
EP4184857A1 (en) Bluetooth node pairing method and related apparatus
CN113918992A (en) Log data processing method and device, storage medium and electronic equipment
CN112667992A (en) Authentication method, authentication device, storage medium, and electronic apparatus
CN112242977A (en) Data transmission method and data transmission system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination