WO2021109668A1 - 一种安全认证方法、装置及电子设备 - Google Patents

一种安全认证方法、装置及电子设备 Download PDF

Info

Publication number
WO2021109668A1
WO2021109668A1 PCT/CN2020/114495 CN2020114495W WO2021109668A1 WO 2021109668 A1 WO2021109668 A1 WO 2021109668A1 CN 2020114495 W CN2020114495 W CN 2020114495W WO 2021109668 A1 WO2021109668 A1 WO 2021109668A1
Authority
WO
WIPO (PCT)
Prior art keywords
random number
ciphertext
security authentication
temporary key
module
Prior art date
Application number
PCT/CN2020/114495
Other languages
English (en)
French (fr)
Inventor
韩喆
蒋海滔
张鸿
杨磊
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021109668A1 publication Critical patent/WO2021109668A1/zh

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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3271Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using challenge-response
    • H04L9/3273Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using challenge-response for mutual authentication
    • 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
    • H04L9/0866Generation of secret information including derivation or calculation of cryptographic keys or passwords involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics
    • 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
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds
    • 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/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3242Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving keyed hash functions, e.g. message authentication codes [MACs], CBC-MAC or HMAC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/60Context-dependent security
    • H04W12/69Identity-dependent
    • H04W12/71Hardware identity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/80Wireless

Definitions

  • the embodiments of this specification relate to the field of information security technology, and more specifically, to a security authentication method, a security authentication device, an electronic device, and a computer-readable storage medium.
  • the Secure Element (SE) is used to improve the security level of the electronic device itself, protect data security, and prevent external malicious analysis attacks.
  • SE Secure Element
  • many electronic devices are not equipped with SE. Therefore, plug-in SE modules are widely used.
  • the more common plug-in SE module can be set in the SIM card.
  • the SIM card As a part of the SIM card, it can communicate with the mobile phone via Bluetooth.
  • Bluetooth itself is wireless communication. Therefore, other electronic devices with a Bluetooth module can also establish a wireless connection with the Bluetooth module of the SIM card of the mobile phone for communication.
  • the identity authentication scheme of the plug-in SE module itself and the reliability of data transmission are low. It is necessary to provide a new method to improve reliability, prevent the wrong connection between the device and the SE module, and at the same time avoid malicious connection by attackers.
  • One purpose of the embodiments of this specification is to provide a new technical solution for security authentication.
  • a security authentication method including: a first end obtains a first random number and a second random number; the first end obtains a first random number and a second random number according to the first random number and the first random number; Two random numbers are calculated to obtain a temporary key; the first end uses the temporary key to respectively encrypt the first random number and the second random number to obtain a first ciphertext and a second ciphertext; The first end sends the first ciphertext to the second end, so that the second end performs security authentication on the first end according to the first ciphertext; the first end obtains information from the first end The third cipher text at the second end; the first end performs security authentication on the second end according to the second cipher text and the third cipher text.
  • the first end calculates the temporary key according to the first random number and the second random number, including: the first end uses a key derivation function KDF to compare the first random number The number, the second random number, the preset fixed key, and the International Mobile Equipment Identity code IMEI are calculated to obtain the temporary key; wherein, in the case that the first end is the SE card end, the IMEI is the all The SE card is pre-stored; in the case that the first end is a device end, the IMEI is obtained from the second end through an interface.
  • KDF key derivation function
  • the first end acquiring the first random number and the second random number includes: the first end generating the first random number, and receiving the second random number from the second end number.
  • the first end uses the temporary key to respectively encrypt the first random number and the second random number to obtain the first ciphertext and the second ciphertext, including: the first ciphertext One end uses a MAC algorithm to perform encryption calculation on the first random number Ra and the temporary key to obtain the first ciphertext;
  • the first end uses the MAC algorithm to perform an encryption calculation on the second random number Rb and the temporary secret calculation to obtain the second ciphertext.
  • the first end performs security authentication on the second end according to the second ciphertext and the third ciphertext, including: the first end determines that the second ciphertext and Whether the third ciphertext is consistent; if the judgment result is consistent, the first end confirms that the second end has passed the security authentication; if the judgment result is inconsistent, the first end confirms the second end End security authentication failed.
  • the MAC algorithm is a CMAC algorithm or an HMAC algorithm.
  • the method further includes: the first end uses the temporary key to encrypt the service data and transmits it to the second end.
  • a security authentication device including: an acquisition module for acquiring a first random number and a second random number; a calculation module for acquiring a first random number and a second random number; The second random number is calculated to obtain a temporary key; an encryption module is configured to use the temporary key to respectively encrypt the first random number and the second random number to obtain a first ciphertext and a second ciphertext; The sending module is used to send the first ciphertext to the second end, so that the second end performs security authentication on the first end according to the first ciphertext; the receiving module is used to obtain The third ciphertext of the second end; an authentication module, configured to perform security authentication on the second end according to the second ciphertext and the third ciphertext.
  • an electronic device including the security authentication device as described in the second aspect of the embodiments of the present specification, or the electronic device includes: a memory for storing executable commands;
  • the processor is configured to execute the security authentication method as described in the first aspect of the embodiment of this specification under the control of the executable command.
  • a computer-readable storage medium that stores executable instructions, and when the executable instructions are executed by a processor, execute the security described in the first aspect of the embodiments of this specification. Authentication method.
  • a beneficial effect of the embodiment of this specification is that the method of this embodiment generates and exchanges a random number at the first end and the second end respectively, and the first end and the second end respectively calculate the temporary key according to the random number, and then use
  • the temporary key encrypts the random number generated by itself to generate a ciphertext and sends it to the opposite end, and the opposite end performs ciphertext authentication to complete the security authentication at both ends. This can prevent incorrect connection to the SE module of other devices, and at the same time can avoid malicious connections by attackers.
  • part of the data used to generate the temporary key is obtained through the wired protocol ISO7816 interface, so that the data for generating the temporary key is mixed with the data obtained through wired communication and wireless communication, which can prevent over-the-air packet capture attacks.
  • Fig. 1 is a schematic diagram of an actual scenario of a security authentication method according to an embodiment of this specification.
  • Fig. 2 is a schematic structural diagram of an electronic device to which the security authentication method according to an embodiment of the present specification can be applied.
  • Fig. 3 is a flowchart of a safety authentication method according to an embodiment of the present specification.
  • Fig. 4 is a functional block diagram of a safety authentication device according to an embodiment of the present specification.
  • Fig. 5 is a functional block diagram of an electronic device according to an embodiment of the present specification.
  • Fig. 6 shows a schematic flowchart of an example of a method according to an embodiment of the present specification.
  • Fig. 1 is a schematic diagram of an actual scenario of a security authentication method according to an embodiment of this specification.
  • the security authentication scenario includes two parts: the device and the card containing the SE module (SE card in the figure).
  • the device and the SE card can communicate with each other through the ISO7816 protocol or through the Bluetooth module. (BLE module) to communicate.
  • BLE module Bluetooth module
  • the device obtains the International Mobile Equipment Identity (IMEI) from the SE card through the ISO7816 protocol.
  • IMEI International Mobile Equipment Identity
  • the device generates a random number Rb and sends it to the SE card through the BLE channel, and the SE card generates a random number Ra and sends it to the device through the BLE channel.
  • the device On the device side, the device generates a temporary key K, and uses the temporary key K to encrypt the random number Rb to obtain the cipher text M and send it to the SE card through the BLE channel. After receiving the ciphertext N from the SE card, the device uses the temporary key K to encrypt the random number Ra to obtain the ciphertext N', and compares the ciphertext N'with the ciphertext N to authenticate the SE card.
  • the SE card At the SE card end, the SE card generates a temporary key K', and uses the temporary key K'to encrypt the random number Ra, and obtains the ciphertext N and sends it to the device through the BLE channel.
  • the SE card After the SE card receives the ciphertext M from the device, it uses the temporary key K’ to encrypt the random number Rb to obtain the ciphertext M’, and compares the ciphertext M’ with the ciphertext M to authenticate the device.
  • the device end and the card end have a successful handshake, and the subsequent service output transmission can be carried out. This can prevent incorrect connection to the SE module of other devices, and at the same time can avoid malicious connection by an attacker.
  • Fig. 2 is a schematic structural diagram of an electronic device to which the security authentication method according to an embodiment of the present specification can be applied.
  • the electronic device 1000 of this embodiment may include a processor 1010, a memory 1020, an interface device 1030, a communication device 1040, a display device 1050, an input device 1060, a speaker 1070, a microphone 1080, and so on.
  • the processor 1010 may be a central processing unit (CPU), a microprocessor MCU, or the like.
  • the memory 1020 includes, for example, ROM (Read Only Memory), RAM (Random Access Memory), nonvolatile memory such as a hard disk, and the like.
  • the interface device 1030 includes, for example, a USB interface, a headphone interface, and the like.
  • the communication device 1040 can perform wired or wireless communication, for example.
  • the display device 1050 is, for example, a liquid crystal display, a touch display, or the like.
  • the input device 1060 may include, for example, a touch screen, a keyboard, and the like.
  • the electronic device 1000 may output audio information through the speaker 1070.
  • the electronic device 1000 can pick up the voice information input by the user through the microphone 1080.
  • the electronic device 1000 may be any device that can support security authentication, such as a smart phone, a portable computer, a desktop computer, or a tablet computer.
  • the first end of the electronic device 1000 (for example, the device end or the card end containing the SE module) can obtain the first random number and the second random number; the first end can obtain the first random number and the second random number according to the first random number and the second random number.
  • Two random numbers are calculated to obtain a temporary key; the first end uses the temporary key to encrypt the first random number and the second random number to obtain the first ciphertext and the second ciphertext; the first end uses the temporary key to encrypt the first random number and the second random number respectively;
  • the first ciphertext is sent to the second end (the second end may correspond to the card end or the device end containing the SE module), so that the second end can perform security authentication on the first end according to the first ciphertext;
  • the first end obtains the third ciphertext from the second end; the first end performs security authentication on the second end according to the second ciphertext and the third ciphertext.
  • the memory 1020 of the electronic device 1000 is used to store instructions, and the instructions are used to control the processor 1010 to operate to support the realization of the security authentication method according to any embodiment of this specification.
  • Technicians can design instructions according to the solutions disclosed in the embodiments of this specification. How the instruction controls the processor to operate is well known in the art, so it will not be described in detail here.
  • the electronic device 1000 in the embodiment of this specification may only involve some of the devices, for example, only the processor 1010 and the memory are involved. 1020, display device 1050, input device 1060, etc.
  • This embodiment provides a security authentication method.
  • the method can be implemented by, for example, a device end in an electronic device or a card end containing an SE module.
  • the electronic device can be a device including the device shown in FIG. 1 and the SE card. Or the electronic device 1000 shown in FIG. 2.
  • the second end when the first end is the device end, the second end is the card end containing the SE module.
  • the first end is the card end containing the SE module
  • the second end is the device end.
  • the device side and the card side containing the SE module are executed each time to implement dual-end authentication, thereby improving reliability and security.
  • the method includes the following steps 2000-2010.
  • step 2000 the first end obtains the first random number and the second random number.
  • the first random number may be randomly generated by the first end, and the second random number may be received from the second end.
  • the second random number is randomly generated by the second end and transmitted to the first end through a Bluetooth channel.
  • the first end randomly generates the first random number, it will also be transmitted to the second end through a Bluetooth channel.
  • the first random number and the second random number may be, for example, a 64-bit number or a 128-bit number randomly generated, which is not specifically limited here.
  • step 2002 the first end calculates a temporary key according to the first random number and the second random number.
  • KDF Key Derivation Function
  • the IMEI is transmitted from the card end containing the SE module to the device end through the ISO7816 protocol interface.
  • the preset fixed key PIN is the device end and the card end containing the SE module.
  • the card end of the SE module has been agreed in advance, and only new users can get the PIN in advance.
  • the device terminal uses the key derivation function KDF to calculate the temporary key K according to the first random number Ra, the second random number Rb, the preset fixed key PIN, and the IMEI.
  • the card end containing the SE module will also use the key derivation function KDF to calculate the temporary key K'according to the first random number Ra, the second random number Rb, the preset fixed key PIN and IMEI. Under normal circumstances, K should be consistent with K’.
  • the IMEI is pre-stored in the card end containing the SE module.
  • the card terminal containing the SE module uses the key derivation function KDF to calculate the temporary key K according to the first random number Ra, the second random number Rb, the preset fixed key PIN, and the IMEI.
  • the device side will also calculate the temporary key K'by using the key derivation function KDF according to the first random number Ra, the second random number Rb, the preset fixed key PIN and IMEI. Under normal circumstances, K should be consistent with K’.
  • step 2004 is continued to perform security authentication on the second end.
  • step 2004 the first end uses the temporary key to respectively encrypt the first random number and the second random number to obtain the first ciphertext and the second ciphertext.
  • MAC algorithm may be a CMAC algorithm; or, the MAC algorithm may be an HMAC algorithm. There is no specific limitation here.
  • step 2006 the first end sends the first ciphertext to the second end, so that the second end performs security authentication on the first end according to the first ciphertext.
  • the first end sends the first ciphertext to the second end through a Bluetooth channel.
  • the first end is the device end
  • the second end is the card end containing the SE module.
  • the card end containing the SE module judges whether M and M'are the same. If they are the same, the card end containing the SE module considers that the device end does contain the relevant key or PIN code, and confirms that the device end has passed the security authentication.
  • the first end is a card end containing an SE module
  • the second end is a device end.
  • the device side judges whether M and M'are consistent. If they are the same, the device side considers that the card side containing the SE module does contain the relevant key or PIN code, and confirms that the card side containing the SE module has passed the security authentication.
  • step 2008 the first end obtains the third ciphertext from the second end.
  • the third ciphertext is obtained by encrypting the second random number Rb by the second end using the temporary key K'.
  • the first end may obtain the third ciphertext from the second end through the Bluetooth channel.
  • step 2010 the first end performs security authentication on the second end according to the second ciphertext and the third ciphertext.
  • the first end judges whether the second ciphertext and the third ciphertext are consistent; if the judgment result is consistent, the first end confirms that the second end has passed the security authentication; if the judgment result is inconsistent, Then the first end confirms that the second end has failed the security authentication.
  • the first end is the device end
  • the second end is the card end containing the SE module.
  • the device side judges whether N and N'are consistent. If they are the same, the device side considers that the card side containing the SE module does contain the relevant key or PIN code, and confirms that the card side containing the SE module has passed the security authentication.
  • the first end is a card end containing an SE module
  • the second end is a device end.
  • the card end containing the SE module judges whether N and N'are the same. If they are the same, the card end containing the SE module considers that the device end does contain the relevant key or PIN code, and confirms that the device end has passed the security authentication.
  • any one of the first end and the second end confirms that the peer end's security authentication fails it means that the first end and the second end have failed to shake hands and will not transmit service data.
  • the method of this embodiment may further include: the first end uses the temporary key to encrypt the service data and transmits it to the second end.
  • the first end uses the temporary key to encrypt the service data
  • the second end that receives the encrypted service data can use the temporary key for decryption to obtain the service data. In this way, the security and reliability in service data transmission can be improved.
  • a random number is generated and exchanged at the first end and the second end respectively.
  • the first end and the second end respectively calculate a temporary key according to the random number, and then use the temporary key to perform the random number generated by themselves.
  • the encrypted ciphertext is sent to the opposite end, and the ciphertext authentication is performed by the opposite end to complete the security authentication at both ends. This can prevent incorrect connection to the SE module of other devices, and at the same time can avoid malicious connections by attackers.
  • part of the data used to generate the temporary key is obtained through the wired protocol ISO7816 interface, so that the data for generating the temporary key is mixed with the data obtained through wired communication and wireless communication, which can prevent over-the-air packet capture attacks.
  • Fig. 6 shows a schematic flowchart of an example of a method according to an embodiment of the present specification.
  • the first end is the device end
  • the second end is the card end containing the SE module.
  • the method includes:
  • Step 6100 the card end containing the SE module sends the IMEI to the device end through the ISO protocol interface.
  • Step 6200 the device side generates a random number Ra and sends it to the card side containing the SE module through the Bluetooth channel.
  • Step 6102 The card end containing the SE module generates a random number Rb and sends it to the device end through the Bluetooth channel.
  • the device is, for example, the security authentication device 4000 shown in FIG. 4.
  • the security authentication device 4000 includes an acquisition module 4100, a calculation module 4200, an encryption module 4300, a sending module 4400, a receiving module 4500 and Authentication module 4600.
  • the obtaining module 4100 is used to obtain the first random number and the second random number.
  • the calculation module 4200 is configured to calculate a temporary key according to the first random number and the second random number.
  • the encryption module 4300 is configured to use the temporary key to respectively encrypt the first random number and the second random number to obtain the first ciphertext and the second ciphertext.
  • the sending module 4400 is configured to send the first ciphertext to the second end, so that the second end performs security authentication on the first end according to the first ciphertext.
  • the receiving module 4500 is used to obtain the third ciphertext from the second end.
  • the authentication module 4600 is configured to perform security authentication on the second end according to the second ciphertext and the third ciphertext.
  • the calculation module 4200 is specifically configured to: use the key derivation function KDF to calculate the first random number, the second random number, the preset fixed key, and the IMEI to obtain the temporary key; the first end is SE In the case of the card end, the IMEI is pre-stored on the SE card end; in the case that the first end is the device end, the IMEI is obtained from the second end through an interface.
  • the acquiring module 4100 is specifically configured to: generate the first random number, and receive the second random number from the second end.
  • the encryption module 4300 is specifically configured to: use the MAC algorithm to perform encryption calculation on the first random number Ra and the temporary key to obtain the first ciphertext; use the MAC algorithm to perform the encryption calculation on the second random number Rb and the temporary secret The key is encrypted and calculated to obtain the second ciphertext.
  • the authentication module 4600 is specifically configured to: determine whether the second ciphertext is consistent with the third ciphertext; if the judgment result is consistent, confirm that the second-end security authentication is passed; if the judgment result is inconsistent, confirm the first The second-end security authentication failed.
  • the MAC algorithm is CMAC algorithm or HMAC algorithm.
  • the encryption module 4300 may also be used to encrypt the service data using the temporary key and transmit it to the second end.
  • the security authentication device of this embodiment can be used to implement the technical solutions of the foregoing method embodiments, and its implementation principles and technical effects are similar, and will not be repeated here.
  • an electronic device which includes the security authentication device 4000 described in the device embodiment of this specification; or, the electronic device is the electronic device 5000 shown in FIG. 5, and includes a memory 5100 and a processor. 5200.
  • the memory 5100 is used to store executable commands.
  • the processor 5200 is configured to execute the method described in any method embodiment in this specification under the control of the executable command stored in the memory 5100.
  • the implementation subject of the electronic device according to the executed method embodiment may be a server or a terminal device.
  • This embodiment provides a computer-readable storage medium in which an executable command is stored, and when the executable command is executed by a processor, the method described in any method embodiment in this specification is executed.
  • the embodiments of this specification may be systems, methods and/or computer program products.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the embodiments of the present specification.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as the instantaneous signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the computer program instructions used to perform the operations of the embodiments of this specification may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or one or more programming Source code or object code written in any combination of languages.
  • Programming languages include object-oriented programming languages-such as Smalltalk, C++, etc., and conventional procedural programming languages-such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • the remote computer can be connected to the user's computer through any kind of network-including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect to the user's computer) connection).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • the computer-readable program instructions are executed to realize various aspects of the embodiments of this specification.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine that makes these instructions when executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner. Thus, the computer-readable medium storing the instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagram can represent a module, program segment, or part of an instruction, and a module, program segment, or part of an instruction contains one or more executables for realizing the specified logic function. instruction.
  • the functions marked in the block may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation through hardware, implementation through software, and implementation through a combination of software and hardware are all equivalent.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Power Engineering (AREA)
  • Telephone Function (AREA)

Abstract

本说明书实施例涉及一种安全认证方法、装置及电子设备,该方法包括:第一端获取第一随机数和第二随机数;根据第一随机数和第二随机数计算得到临时密钥;使用临时密钥分别对第一随机数和所述第二随机数加密,得到第一密文和第二密文;第一端将第一密文发送给第二端,第二端根据第一密文对第一端进行安全认证;第一端获取来自第二端的第三密文,并根据第二密文和第三密文对第二端进行安全认证,从而完成双端认证。

Description

一种安全认证方法、装置及电子设备 技术领域
本说明书实施例涉及信息安全技术领域,更具体地,涉及一种安全认证方法、一种安全认证装置、一种电子设备以及一种计算机可读存储介质。
背景技术
安全单元(Secure Element,SE)用于提高电子设备本身的安全等级,保护数据安全,防止外部的恶意解析攻击。但很多电子设备本身并没有设置SE,因而,插拔式的SE模块被广泛应用。
例如,比较常见的插拔式SE模块可以设置在SIM卡中,作为SIM卡的一部分,可以通过蓝牙与手机进行通信。但蓝牙本身是无线通信,因此,其他具有蓝牙模块的电子设备也可以与该手机SIM卡的蓝牙模块建立无线连接进行通信。
因此,插拔式SE模块本身的身份认证方案以及数据传输的可靠性较低。需要提供一种新的方法来提高可靠性,防止设备与SE模块的错误连接,同时避免攻击者的恶意连接。
发明内容
本说明书实施例的一个目的是提供一种安全认证的新的技术方案。
根据本说明书实施例的第一方面,提供了一种安全认证方法,包括:第一端获取第一随机数和第二随机数;所述第一端根据所述第一随机数和所述第二随机数计算得到临时密钥;所述第一端使用所述临时密钥分别对所述第一随机数和所述第二随机数加密,得到第一密文和第二密文;所述第一端将所述第一密文发送给第二端,以供所述第二端根据所述第一密文对所述第一端进行安全认证;所述第一端获取来自所述第二端的第三密文;所述第一端根据所述第二密文和所述第三密文对所述第二端进行安全认证。
可选地,其中,所述第一端根据所述第一随机数和所述第二随机数计算得到临时密钥,包括:所述第一端使用密钥派生函数KDF对所述第一随机数、所述第二随机数、预设固定密钥以及国际移动设备识别码IMEI进行计算,得到所述临时密钥;其中,所述第一端为SE卡片端的情况下,所述IMEI是所述SE卡片端预存的;所述第一端为设 备端的情况下,所述IMEI是通过接口从所述第二端获取的。
可选地,其中,所述第一端获取第一随机数和第二随机数,包括:所述第一端生成所述第一随机数,并从所述第二端接收所述第二随机数。
可选地,其中,所述第一端使用所述临时密钥分别对所述第一随机数和所述第二随机数加密,得到第一密文和第二密文,包括:所述第一端使用MAC算法对所述第一随机数Ra和所述临时密钥进行加密计算,得到所述第一密文;
所述第一端使用所述MAC算法对所述第二随机数Rb和所述临时密计算进行加密计算,得到所述第二密文。
可选地,其中,所述第一端根据所述第二密文和所述第三密文对所述第二端进行安全认证,包括:所述第一端判断所述第二密文和所述第三密文是否一致;若判断结果为一致,则所述第一端确认所述第二端安全认证通过;若所述判断结果为不一致,则所述第一端确认所述第二端安全认证失败。
可选地,其中,所述MAC算法为CMAC算法或HMAC算法。
可选地,其中,所述方法还包括:所述第一端使用所述临时密钥对业务数据进行加密,并传输给所述第二端。
根据本说明书实施例的第二方面,还提供一种安全认证装置,包括:获取模块,用于获取第一随机数和第二随机数;计算模块,用于根据所述第一随机数和所述第二随机数计算得到临时密钥;加密模块,用于使用所述临时密钥分别对所述第一随机数和所述第二随机数加密,得到第一密文和第二密文;发送模块,用于将所述第一密文发送给第二端,以供所述第二端根据所述第一密文对所述第一端进行安全认证;接收模块,用于获取来自所述第二端的第三密文;认证模块,用于根据所述第二密文和所述第三密文对所述第二端进行安全认证。
根据本说明书实施例的第三方面,还提供一种电子设备,包括如本说明书实施例第二方面所述的安全认证装置,或者,所述电子设备包括:存储器,用于存储可执行命令;处理器,用于在所述可执行命令的控制下,执行如本说明书实施例第一方面所述的安全认证方法。
根据本说明书实施例的第四方面,还提供一种计算机可读存储介质,存储有可执行指令,所述可执行指令被处理器执行时,执行如本说明书实施例第一方面所述的安全认证方法。
本说明书实施例的一个有益效果在于,本实施例的方法在第一端和第二端各生成一个随机数并交换,第一端和第二端分别根据随机数计算出临时密钥,然后使用临时密钥对自己生成的随机数进行加密生成密文发送给对端,由对端执行密文认证,从而完成两端的安全认证。从而可以防止错误连接到其他设备的SE模块,同时可以避免攻击者的恶意连接。另外,通过有线协议ISO7816接口获取了用于生成临时密钥的部分数据,使得生成临时密钥的数据中混合了通过有线通信和无线通信两种方式获取的数据,可以防止空中抓包攻击。
通过以下参照附图对本说明书实施例的示例性实施例的详细描述,本说明书实施例的其它特征及其优点将会变得清楚。
附图说明
被结合在说明书中并构成说明书的一部分的附图示出了本说明书实施例的实施例,并且连同其说明一起用于解释本说明书实施例的原理。
图1为本说明书实施例的安全认证方法的实际场景示意图。
图2为可以应用根据本说明书实施例的安全认证方法的一种电子设备的结构示意图。
图3是根据本说明书实施例的安全认证方法的流程图。
图4是根据本说明书实施例的安全认证装置的原理框图。
图5是根据本说明书实施例的电子设备的原理框图。
图6示出了根据本说明书实施例的方法的例子的流程示意图。
具体实施方式
现在将参照附图来详细描述本说明书实施例的各种示例性实施例。应注意到:除非另外具体说明,否则在这些实施例中阐述的部件和步骤的相对布置、数字表达式和数值不限制本说明书实施例的范围。
以下对至少一个示例性实施例的描述实际上仅仅是说明性的,决不作为对本说明书实施例及其应用或使用的任何限制。
对于相关领域普通技术人物已知的技术、方法和设备可能不作详细讨论,但在适 当情况下,所述技术、方法和设备应当被视为说明书的一部分。
在这里示出和讨论的所有例子中,任何具体值应被解释为仅仅是示例性的,而不是作为限制。因此,示例性实施例的其它例子可以具有不同的值。
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步讨论。
<硬件配置>
图1为本说明书实施例的安全认证方法的实际场景示意图。
参照图1所示,在该安全认证的场景中,包括设备和含有SE模块的卡片(图中SE卡片)两部分,该设备与SE卡片既可以通过ISO7816协议进行有线通信,也可以通过蓝牙模块(BLE模块)进行通信。
具体的,设备通过ISO7816协议从SE卡片获取国际移动设备识别码(International Mobile Equipment Identity,IMEI)。同时,设备生成随机数Rb通过BLE通道发送给SE卡片,SE卡片生成随机数Ra并通过BLE通道发送给设备。
在设备端,设备生成临时密钥K,并使用临时密钥K对随机数Rb加密,得到密文M并通过BLE通道发送给SE卡片。设备接收来自SE卡片的密文N后,使用临时密钥K对随机数Ra加密得到密文N’,将密文N’与密文N进行比较,以认证SE卡片。
在SE卡片端,SE卡片生成临时密钥K’,并使用临时密钥K’对随机数Ra加密,得到密文N并通过BLE通道发送给设备。SE卡片接收来自设备的密文M后,使用临时密钥K’对随机数Rb加密得到密文M’,将密文M’与密文M进行比较,以认证设备。
在双方均认证通过后,设备端与卡片端握手成功,可以进行后续的业务输出的传输。从而可以防止错误连接到其他设备的SE模块,同时可以避免攻击者的恶意连接。
图2为可以应用根据本说明书实施例的安全认证方法的一种电子设备的结构示意图。
如图2所示,本实施例的电子设备1000可以包括处理器1010、存储器1020、接口装置1030、通信装置1040、显示装置1050、输入装置1060、扬声器1070、麦克风1080,等等。
其中,处理器1010可以是中央处理器CPU、微处理器MCU等。存储器1020例如包括ROM(只读存储器)、RAM(随机存取存储器)、诸如硬盘的非易失性存储器等。接 口装置1030例如包括USB接口、耳机接口等。通信装置1040例如能够进行有线或无线通信。显示装置1050例如是液晶显示屏、触摸显示屏等。输入装置1060例如可以包括触摸屏、键盘等。
电子设备1000可以通过扬声器1070输出音频信息。电子设备1000可以通过麦克风1080拾取用户输入的语音信息。
电子设备1000可以是智能手机、便携式电脑、台式计算机、平板电脑等可以支持安全认证的任意设备。
本实施例中,电子设备1000中的第一端(例如是设备端或含有SE模块的卡片端)可以获取第一随机数和第二随机数;第一端根据该第一随机数和该第二随机数计算得到临时密钥;该第一端使用该临时密钥分别对该第一随机数和该第二随机数加密,得到第一密文和第二密文;该第一端将该第一密文发送给第二端(该第二端对应的可以是含有SE模块的卡片端或设备端),以供该第二端根据该第一密文对该第一端进行安全认证;该第一端获取来自该第二端的第三密文;该第一端根据该第二密文和该第三密文对该第二端进行安全认证。
在本实施例中,电子设备1000的存储器1020用于存储指令,该指令用于控制该处理器1010进行操作以支持实现根据本说明书任意实施例的安全认证法。技术人员可以根据本说明书实施例所公开方案设计指令。指令如何控制处理器进行操作,这是本领域公知,故在此不再详细描述。
本领域技术人员应当理解,尽管在图2中示出了电子设备1000的多个装置,但是,本说明书实施例的电子设备1000可以仅涉及其中的部分装置,例如,只涉及处理器1010、存储器1020、显示装置1050、输入装置1060等。
<方法实施例>
本实施例提供了一种安全认证方法,该方法例如可以由电子设备中的设备端或含有SE模块的卡片端实施,该电子设备可以是包含如图1所示的设备和SE卡片的设备,或者是图2所示的电子设备1000。
需要说明的是,在本实施例中,当第一端是设备端时,第二端为含有SE模块的卡片端。当第一端是含有SE模块的卡片端时,第二端为设备端。本实施例的方法在实施时,设备端和含有SE模块的卡片端各自执行一遍,以实现双端认证,从而提高了可靠性和安全性。
如图3所示,该方法包括以下步骤2000~2010。
步骤2000,第一端获取第一随机数和第二随机数。
本步骤中,该第一随机数可以是该第一端随机生成的,该第二随机数可以是从该第二端接收的。其中,该第二随机数是该第二端随机生成,并通过蓝牙通道传输给该第一端。同样的,该第一端随机生成该第一随机数后也会通过蓝牙通道传输给该第二端。
实际应用中,该第一随机数和该第二随机数例如可以是随机生成的64位数或128位数,在此不做具体限定。
步骤2002,该第一端根据该第一随机数和该第二随机数计算得到临时密钥。
具体的,该第一端使用密钥派生函数(Key Derivation Function,KDF)对该第一随机数Ra、该第二随机数Rb、预设固定密钥PIN以及IMEI进行计算,得到该临时密钥K=KDF(Ra,Rb,PIN,IMEI);其中,在该第一端为SE卡片端的情况下,该IMEI是该SE卡片端预存的;在该第一端为设备端的情况下,该IMEI是通过接口从该第二端获取的。
例如,第一端是设备端,第二端是含有SE模块的卡片端,则该IMEI是含有SE模块的卡片端通过ISO7816协议接口传输给设备端的,预设固定密钥PIN是设备端和含有SE模块的卡片端事先约定好的,只有新用户才能事先获知PIN。
本步骤中,设备端根据该第一随机数Ra、该第二随机数Rb、该预设固定密钥PIN以及IMEI,使用密钥派生函数KDF计算得到临时密钥K。同时,含有SE模块的卡片端也会根据该第一随机数Ra、该第二随机数Rb、该预设固定密钥PIN以及IMEI,使用密钥派生函数KDF计算得到临时密钥K’。正常情况下,K应该与K’一致。
又例如,第一端是含有SE模块的卡片端,第二端是设备端,则该IMEI是含有SE模块的卡片端中预存的。本步骤中。含有SE模块的卡片端根据该第一随机数Ra、该第二随机数Rb、该预设固定密钥PIN以及IMEI,使用密钥派生函数KDF计算得到临时密钥K。同时,设备端也会根据该第一随机数Ra、该第二随机数Rb、该预设固定密钥PIN以及IMEI,使用密钥派生函数KDF计算得到临时密钥K’。正常情况下,K应该与K’一致。
在计算得到临时密钥K之后,继续执行步骤2004,以对第二端进行安全认证。
在步骤2004,该第一端使用该临时密钥分别对该第一随机数和该第二随机数加密, 得到第一密文和第二密文。
具体的,该第一端可以使用带秘密密钥的hash函数(Message Authentication Codes,MAC)算法对该第一随机数Ra和该临时密钥K进行加密计算,得到该第一密文M=MAC(Ra,K);并且,该第一端使用该MAC算法对该第二随机数Rb和该临时密钥K进行加密计算,得到该第二密文N=MAC(Rb,K)。其中,该MAC算法可以为CMAC算法;或者,该MAC算法可以HMAC算法。在此不做具体限定。
步骤2006,该第一端将该第一密文发送给第二端,以供该第二端根据该第一密文对该第一端进行安全认证。
实际应用中,该第一端通过蓝牙通道将该第一密文发送给该第二端。
例如,该第一端是设备端,第二端是含有SE模块的卡片端。设备端使用临时密钥K对该第一随机数Ra进行加密,得到该第一密文M=MAC(Ra,K),然后通过蓝牙通道将该第一密文M传输给含有SE模块的卡片端。含有SE模块的卡片端使用临时密钥K’对该第一随机数Ra进行加密,得到密文M’=MAC(Ra,K’)。含有SE模块的卡片端判断M与M’是否一致,若一致,则含有SE模块的卡片端认为设备端确实含有相关密钥或PIN码,确认设备端安全认证通过。
又例如,该第一端是含有SE模块的卡片端,该第二端是设备端。含有SE模块的卡片端使用临时密钥K对该第一随机数Ra进行加密,得到该第一密文M=MAC(Ra,K),然后通过蓝牙通道将该第一密文M传输给设备端。设备端使用临时密钥K’对该第一随机数Ra进行加密,得到密文M’=MAC(Ra,K’)。设备端判断M与M’是否一致,若一致,则设备端认为含有SE模块的卡片端确实含有相关密钥或PIN码,确认含有SE模块的卡片端安全认证通过。
步骤2008,该第一端获取来自该第二端的第三密文。
其中,该第三密文是该第二端使用临时密钥K’对该第二随机数Rb进行加密后得到的。该第一端具体可以通过蓝牙通道获取来自该第二端的第三密文。
步骤2010,该第一端根据该第二密文和该第三密文对该第二端进行安全认证。
本步骤中,该第一端判断该第二密文和该第三密文是否一致;若判断结果为一致,则该第一端确认该第二端安全认证通过;若该判断结果为不一致,则该第一端确认该第二端安全认证失败。
例如,该第一端是设备端,第二端是含有SE模块的卡片端。设备端使用临时密钥K对该第二随机数Rb进行加密,得到该第二密文N=MAC(Rb,K),然后通过蓝牙通道获取来自该含有SE模块的卡片端的该第三密文N’。设备端判断N与N’是否一致,若一致,则设备端认为含有SE模块的卡片端确实含有相关密钥或PIN码,确认含有SE模块的卡片端安全认证通过。
又例如,该第一端是含有SE模块的卡片端,该第二端是设备端。含有SE模块的卡片端使用临时密钥K对该第二随机数Rb进行加密,得到该第二密文N=MAC(Rb,K),然后通过蓝牙通道获取来自设备端的该第三密文N’。含有SE模块的卡片端判断N与N’是否一致,若一致,则含有SE模块的卡片端认为设备端确实含有相关密钥或PIN码,确认设备端安全认证通过。
上述步骤2000~步骤2010结束后,若该第一端和该第二端中任意一端确认对端安全认证失败,说明第一端和第二端握手失败,不会传输业务数据。
若该第一端和该第二端均确认对端安全认证通过,则第一端和第二端握手成功。进一步地,本实施例的方法还可以包括:该第一端使用该临时密钥对业务数据进行加密,并传输给该第二端。
具体的,在传输业务数据时,第一端使用该临时密钥对业务数据进行加密,接收加密后的业务数据的第二端,可以使用临时密钥进行解密,得到业务数据。这样,可以提高业务数据传输中的安全性和可靠性。
本实施例的方法在第一端和第二端各生成一个随机数并交换,第一端和第二端分别根据随机数计算出临时密钥,然后使用临时密钥对自己生成的随机数进行加密生成密文发送给对端,由对端执行密文认证,从而完成两端的安全认证。从而可以防止错误连接到其他设备的SE模块,同时可以避免攻击者的恶意连接。另外,通过有线协议ISO7816接口获取了用于生成临时密钥的部分数据,使得生成临时密钥的数据中混合了通过有线通信和无线通信两种方式获取的数据,可以防止空中抓包攻击。
<例子>
图6示出了根据本说明书实施例的方法的例子的流程示意图。
如图6所示,在本例中,第一端为设备端,第二端为含有SE模块的卡片端。该方法包括:
步骤6100,含有SE模块的卡片端通过ISO协议接口向设备端发送IMEI。
步骤6200,设备端生成随机数Ra并通过蓝牙通道发送给含有SE模块的卡片端。
步骤6102,含有SE模块的卡片端生成随机数Rb并通过蓝牙通道发送给设备端。
步骤6202,设备端根据随机数Ra、Rb、IMEI和PIN,使用密钥派生函数KDF计算得到临时密钥K=KDF(Ra,Rb,PIN,IMEI)。
步骤6104,含有SE模块的卡片端根据随机数Ra、Rb、IMEI和PIN,使用密钥派生函数KDF计算得到临时密钥K’=KDF(Ra,Rb,PIN,IMEI)。
步骤6204,设备端使用MAC算法对随机数Ra进行加密,得到密文M=MAC(Ra,K),并通过蓝牙通道发送给含有SE模块的卡片端。
步骤6106,含有SE模块的卡片端使用MAC算法对随机数Ra进行加密,得到密文M’=MAC(Ra,K’),并判断M’是否与M一致,若一致,则确认设备端安全认证通过。反之,则确认设备端安全认证不通过。
步骤6108,含有SE模块的卡片端使用MAC算法对随机数Rb进行加密,得到密文N=MAC(Rb,K’),并通过蓝牙通道发送给设备端。
步骤6206,设备端使用MAC算法对随机数Rb进行加密,得到密文N’=MAC(Rb,K),并判断N’是否与N一致,若一致,则确认含有SE模块的卡片端安全认证通过。反之,则确认含有SE模块的卡片端安全认证不通过。
<装置实施例>
本实施例提供一种安全认证装置,该装置例如是图4所示的安全认证装置4000,该安全认证装置4000包括获取模块4100,计算模块4200,加密模块4300,发送模块4400,接收模块4500和认证模块4600。
该获取模块4100,用于获取第一随机数和第二随机数。
该计算模块4200,用于根据该第一随机数和该第二随机数计算得到临时密钥。
该加密模块4300,用于使用该临时密钥分别对该第一随机数和该第二随机数加密,得到第一密文和第二密文。
该发送模块4400,用于将该第一密文发送给第二端,以供该第二端根据该第一密文对该第一端进行安全认证。
该接收模块4500,用于获取来自该第二端的第三密文。
该认证模块4600,用于根据该第二密文和该第三密文对该第二端进行安全认证。
其中,该计算模块4200具体用于:使用密钥派生函数KDF对该第一随机数,该第二随机数,预设固定密钥和IMEI进行计算得到该临时密钥;该第一端为SE卡片端的情况下,该IMEI是该SE卡片端预存的;该第一端为设备端的情况下,该IMEI是通过接口从该第二端获取的。
该获取模块4100具体用于:生成该第一随机数,并从该第二端接收该第二随机数。
该加密模块4300具体用于:使用MAC算法对该第一随机数Ra和该临时密钥进行加密计算,得到该第一密文;使用该MAC算法对该第二随机数Rb和所述临时密钥进行加密计算,得到该第二密文。
该认证模块4600具体用于:判断该第二密文和该第三密文是否一致;若判断结果为一致,则确认该第二端安全认证通过;若该判断结果为不一致,则确认该第二端安全认证失败。
其中,该MAC算法为CMAC算法或HMAC算法。
该加密模块4300还可以用于:使用该临时密钥对业务数据进行加密,并传输给该第二端。
本实施例的安全认证装置,可用于执行上述方法实施例的技术方案,其实现原理及技术效果类似,此处不再赘述。
<设备实施例>
本实施例中,还提供一种电子设备,该电子设备包括本说明书装置实施例中描述的安全认证装置4000;或者,该电子设备为图5所示的电子设备5000,包括存储器5100和处理器5200。
存储器5100,用于存储可执行命令。
处理器5200,用于在存储器5100存储的可执行命令的控制下,执行本说明书任意方法实施例中描述的方法。
在电子设备根据所执行的方法实施例的实施主体,可以是服务器,也可以是终端设备。
<计算机可读存储介质实施例>
本实施例提供一种计算机可读存储介质,该存储介质中存储有可执行命令,该可执行命令被处理器执行时,执行本说明书任意方法实施例中描述的方法。
本说明书实施例可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本说明书实施例的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本说明书实施例操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本说明书实施例的各个方面。
这里参照根据本说明书实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本说明书实施例的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本说明书实施例的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。对于本领域技术人物来说公知的是,通过硬件方式实现、通过软件方式实现以及通过软件和硬件结合的方式实现都是等价的。
以上已经描述了本说明书实施例的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人物来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人物能理解本文披露的各实施例。本说明书实施例的范围由所附权利要求来限定。

Claims (10)

  1. 一种安全认证方法,包括:
    第一端获取第一随机数和第二随机数;
    所述第一端根据所述第一随机数和所述第二随机数计算得到临时密钥;
    所述第一端使用所述临时密钥分别对所述第一随机数和所述第二随机数加密,得到第一密文和第二密文;
    所述第一端将所述第一密文发送给第二端,以供所述第二端根据所述第一密文对所述第一端进行安全认证;
    所述第一端获取来自所述第二端的第三密文;
    所述第一端根据所述第二密文和所述第三密文对所述第二端进行安全认证。
  2. 根据权利要求1所述的方法,其中,所述第一端根据所述第一随机数和所述第二随机数计算得到临时密钥,包括:
    所述第一端使用密钥派生函数KDF对所述第一随机数、所述第二随机数、预设固定密钥以及国际移动设备识别码IMEI进行计算,得到所述临时密钥;
    其中,所述第一端为SE卡片端的情况下,所述IMEI是所述SE卡片端预存的;所述第一端为设备端的情况下,所述IMEI是通过接口从所述第二端获取的。
  3. 根据权利要求1所述的方法,其中,所述第一端获取第一随机数和第二随机数,包括:
    所述第一端生成所述第一随机数,并从所述第二端接收所述第二随机数。
  4. 根据权利要求1所述的方法,其中,所述第一端使用所述临时密钥分别对所述第一随机数和所述第二随机数加密,得到第一密文和第二密文,包括:
    所述第一端使用MAC算法对所述第一随机数Ra和所述临时密钥进行加密计算,得到所述第一密文;
    所述第一端使用所述MAC算法对所述第二随机数Rb和所述临时密钥进行加密计算,得到所述第二密文。
  5. 根据权利要求1所述的方法,其中,所述第一端根据所述第二密文和所述第三密文对所述第二端进行安全认证,包括:
    所述第一端判断所述第二密文和所述第三密文是否一致;
    若判断结果为一致,则所述第一端确认所述第二端安全认证通过;
    若所述判断结果为不一致,则所述第一端确认所述第二端安全认证失败。
  6. 根据权利要求4所述的方法,其中,所述MAC算法为CMAC算法或HMAC算 法。
  7. 根据权利要求1所述的方法,其中,所述方法还包括:
    所述第一端使用所述临时密钥对业务数据进行加密,并传输给所述第二端。
  8. 一种安全认证装置,包括:
    获取模块,用于获取第一随机数和第二随机数;
    计算模块,用于根据所述第一随机数和所述第二随机数计算得到临时密钥;
    加密模块,用于使用所述临时密钥分别对所述第一随机数和所述第二随机数加密,得到第一密文和第二密文;
    发送模块,用于将所述第一密文发送给第二端,以供所述第二端根据所述第一密文对所述第一端进行安全认证;
    接收模块,用于获取来自所述第二端的第三密文;
    认证模块,用于根据所述第二密文和所述第三密文对所述第二端进行安全认证。
  9. 一种电子设备,包括如权利要求8所述的安全认证装置,或者,所述电子设备包括:
    存储器,用于存储可执行命令;
    处理器,用于在所述可执行命令的控制下,执行如权利要求1-7中任一项所述的安全认证方法。
  10. 一种计算机可读存储介质,存储有可执行指令,所述可执行指令被处理器执行时,执行如权利要求1-7中任一项所述的安全认证方法。
PCT/CN2020/114495 2019-12-03 2020-09-10 一种安全认证方法、装置及电子设备 WO2021109668A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911222212.3 2019-12-03
CN201911222212.3A CN111064577A (zh) 2019-12-03 2019-12-03 一种安全认证方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2021109668A1 true WO2021109668A1 (zh) 2021-06-10

Family

ID=70299482

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/114495 WO2021109668A1 (zh) 2019-12-03 2020-09-10 一种安全认证方法、装置及电子设备

Country Status (3)

Country Link
CN (1) CN111064577A (zh)
TW (1) TWI799702B (zh)
WO (1) WO2021109668A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111064577A (zh) * 2019-12-03 2020-04-24 支付宝(杭州)信息技术有限公司 一种安全认证方法、装置及电子设备
CN115118527B (zh) * 2022-08-26 2022-11-25 深圳市成为信息股份有限公司 超高频模组与pda的双向认证方法及相关设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933119A (zh) * 2015-12-24 2016-09-07 中国银联股份有限公司 一种认证方法及设备
CN106845304A (zh) * 2017-01-22 2017-06-13 国网江苏省电力公司电力科学研究院 一种实现rfid系统中阅读器与标签认证的方法与系统
CN107197427A (zh) * 2017-07-20 2017-09-22 深圳市微盾科技有限公司 一种新型蓝牙智能ic卡及其交易方法
US20180183772A1 (en) * 2016-12-22 2018-06-28 Samsung Electronics Co., Ltd. Method of performing secure communication and secure communication system
CN111064577A (zh) * 2019-12-03 2020-04-24 支付宝(杭州)信息技术有限公司 一种安全认证方法、装置及电子设备

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070005966A1 (en) * 2005-06-30 2007-01-04 Selim Aissi Derivation of a shared keystream from a shared secret
US8892887B2 (en) * 2006-10-10 2014-11-18 Qualcomm Incorporated Method and apparatus for mutual authentication
CN101242323B (zh) * 2007-02-06 2010-12-08 华为技术有限公司 设备间管道的建立方法和家庭网络系统
CN101511083B (zh) * 2008-12-25 2011-02-16 北京握奇数据系统有限公司 电信智能卡的认证鉴权方法和终端
CN101895877B (zh) * 2009-05-21 2014-09-17 华为技术有限公司 密钥协商方法、设备及系统
CN102571702B (zh) * 2010-12-22 2014-11-05 中兴通讯股份有限公司 物联网中的密钥生成方法、系统和设备
TWI465128B (zh) * 2012-11-05 2014-12-11 Ke Hsi Hsiang 伺服器認證方法、系統與一電腦可讀取媒體
US20140199963A1 (en) * 2013-01-16 2014-07-17 Behzad Mohebbi Methods and apparatus for a network-agnostic wireless router
CN103164738B (zh) * 2013-02-06 2015-09-30 厦门盛华电子科技有限公司 一种基于移动支付多通道数字认证的手机用户识别卡
US20150229475A1 (en) * 2014-02-10 2015-08-13 Qualcomm Incorporated Assisted device provisioning in a network
CN103955739B (zh) * 2014-05-20 2017-03-15 北京智联安科技有限公司 一种蓝牙薄膜sim卡和访问手机sim卡的方法
CN106557681A (zh) * 2015-09-24 2017-04-05 国民技术股份有限公司 一种安全智能卡及其使用方法
CN108989318B (zh) * 2018-07-26 2020-12-29 中国电子科技集团公司第三十研究所 一种面向窄带物联网的轻量化安全认证及密钥交换方法
CN109194794B (zh) * 2018-11-09 2024-08-16 四川科道芯国智能技术股份有限公司 Sim卡及移动终端

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933119A (zh) * 2015-12-24 2016-09-07 中国银联股份有限公司 一种认证方法及设备
US20180183772A1 (en) * 2016-12-22 2018-06-28 Samsung Electronics Co., Ltd. Method of performing secure communication and secure communication system
CN106845304A (zh) * 2017-01-22 2017-06-13 国网江苏省电力公司电力科学研究院 一种实现rfid系统中阅读器与标签认证的方法与系统
CN107197427A (zh) * 2017-07-20 2017-09-22 深圳市微盾科技有限公司 一种新型蓝牙智能ic卡及其交易方法
CN111064577A (zh) * 2019-12-03 2020-04-24 支付宝(杭州)信息技术有限公司 一种安全认证方法、装置及电子设备

Also Published As

Publication number Publication date
TW202123051A (zh) 2021-06-16
TWI799702B (zh) 2023-04-21
CN111064577A (zh) 2020-04-24

Similar Documents

Publication Publication Date Title
US10003966B2 (en) Key configuration method and apparatus
JP6803326B2 (ja) 非対称暗号方式を使用してワンタイムパスワードを実装するためのシステム及び方法
US8745392B2 (en) Two-way authentication between two communication endpoints using a one-way out-of band (OOB) channel
US8644515B2 (en) Display authenticated security association
US10999260B1 (en) Secure messaging between cryptographic hardware modules
CN110476399B (zh) 相互认证系统
CN104144049A (zh) 一种加密通信方法、系统和装置
WO2015100675A1 (zh) 一种网络配置方法、相关装置及系统
WO2021109668A1 (zh) 一种安全认证方法、装置及电子设备
CN105141629A (zh) 一种基于WPA/WPA2 PSK多密码提升公用Wi-Fi网络安全性的方法
CN114553590A (zh) 数据传输方法及相关设备
KR20160111244A (ko) 전자 장치 및 그의 통신 방법
WO2018047132A1 (en) A system and method for authentication and secure communication
CN115315968A (zh) 应用于短距离通信系统的配对方法和无线设备
CN103441854A (zh) 链路保护方法及系统
WO2015124798A2 (en) Method &amp; system for enabling authenticated operation of a data processing device
WO2016003310A1 (en) Bootstrapping a device to a wireless network
CN104080080B (zh) 一种语音通话的数据处理系统
CN104065650B (zh) 一种语音通话的数据处理系统
KR101785382B1 (ko) 클라이언트 인증 방법, 클라이언트의 동작 방법, 서버, 및 통신 소프트웨어
Berchtold et al. Secure communication protocol for a low-bandwidth audio channel
Bertels Design of a pairing protocol for the AR. Drone 2.0
CN104066081B (zh) 一种语音通话的数据处理系统
KR20210126944A (ko) 비밀정보의 공유 방법
CN118785153A (zh) 安全校验方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20897558

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20897558

Country of ref document: EP

Kind code of ref document: A1