WO2019109640A1 - Method and device for locking sim card - Google Patents

Method and device for locking sim card Download PDF

Info

Publication number
WO2019109640A1
WO2019109640A1 PCT/CN2018/095194 CN2018095194W WO2019109640A1 WO 2019109640 A1 WO2019109640 A1 WO 2019109640A1 CN 2018095194 W CN2018095194 W CN 2018095194W WO 2019109640 A1 WO2019109640 A1 WO 2019109640A1
Authority
WO
WIPO (PCT)
Prior art keywords
sim card
pin code
user equipment
verification
encrypted
Prior art date
Application number
PCT/CN2018/095194
Other languages
French (fr)
Chinese (zh)
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 WO2019109640A1 publication Critical patent/WO2019109640A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data
    • H04W8/183Processing at user equipment or user record carrier
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and apparatus for locking a SIM card.
  • SIM cards Subscriber Identification Modules
  • the prior art generally uses a specified Personal Identification Number (PIN) to lock the SIM card.
  • PIN Personal Identification Number
  • the embodiment of the invention provides a method and a device for locking a SIM card, which are used to solve the technical problem that the prior art locking SIM card method has low security.
  • a first aspect of the embodiments of the present invention provides a method for locking a SIM card, which is applied to a user equipment, where the method includes:
  • the encrypted verification parameter is stored in a storage unit of the user equipment.
  • the user equipment generates a random PIN code for the SIM card to replace the original PIN code of the SIM card, and encrypts and generates the generated random PIN code and the attribute parameters of the SIM card in the user equipment.
  • the confidentiality of the SIM card PIN code is improved, and the difficulty of deciphering the SIM card by the illegal user equipment is increased, thereby improving the security of the user equipment locking the SIM card.
  • the attribute parameters of the SIM card include an integrated circuit card identity (ICCID), an International Mobile Equipment Identity (IMEI), and an International Mobile Subscriber Identification (International Mobile Subscriber Identification). Number, IMSI), Medium Access Control (MAC) address, and Serial Number (SN).
  • ICCID integrated circuit card identity
  • IMEI International Mobile Equipment Identity
  • SN Serial Number
  • the encrypting the verification parameter of the SIM card to generate the encrypted verification parameter including: the random PIN code
  • the ICCID is concatenated into a string, and the string is encrypted, and the encrypted string is generated, and the encrypted string is used as the encrypted verification parameter.
  • the complexity of the verification parameters can be increased, the difficulty of cracking the random PIN code can be improved, and the security of locking the SIM card by the user equipment can be further improved.
  • the encrypting the verification parameter of the SIM card to generate the encrypted verification parameter includes: separately encrypting the random PIN code and the attribute parameter, and generating an encrypted verification parameter,
  • the encrypted verification parameter includes an encrypted random PIN code and an encrypted attribute parameter.
  • the complexity of the verification parameters can be increased, the difficulty of cracking the random PIN code can be improved, and the security of locking the SIM card by the user equipment can be further improved.
  • a second aspect of the embodiments of the present invention provides a method for unlocking a SIM card, which is applied to a user equipment, the method comprising: receiving an instruction to release a lock on a SIM card on the user equipment; and a storage unit from the user equipment Obtaining the encrypted verification parameter, where the verification parameter includes a random PIN code, and an attribute parameter of the locked SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; and verifying the verification parameter by using the verification parameter a SIM card on the user device; upon determining that the verification is passed, unlocking the SIM card to enable the user device to use the service provided by the SIM card.
  • the user uses the verification parameter to verify the SIM card, which improves the security of the user equipment to verify the SIM card.
  • the verifying the SIM card on the user equipment by using the verification parameter includes: verifying the random PIN code and the location Whether the PIN code of the SIM card on the user equipment is consistent, and whether the ICCID of the locked SIM card is consistent with the ICCID of the SIM card on the user equipment.
  • the complexity of the verification parameters can be increased, the difficulty of cracking the random PIN code can be improved, and the security of verifying the SIM card by the user equipment can be further improved.
  • a third aspect of the embodiments of the present invention provides a method for closing a verification function of a SIM card, which is applied to a user equipment, the method comprising: receiving an instruction to close a verification function of the SIM card; generating a user input to close the SIM card according to the instruction a prompt for verifying the password of the function; if the password is correct, obtaining the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and the encrypted parameter
  • the verification parameter performs a decryption process to obtain the verification parameter; the verification parameter is used to verify the SIM card on the user equipment; and when it is determined that the verification is passed, the PIN code verification function of the SIM card is closed.
  • the PIN code verification function of the user equipment can be disabled, so that the user can adjust the state of the user equipment and the SIM card according to the usage scenario, thereby improving the user experience.
  • a fourth aspect of the embodiments of the present invention provides a device for locking a SIM card, including: a receiving unit, configured to receive an instruction for locking a SIM card on the user equipment; and a processing unit, configured to generate a random a PIN code, and updating the original PIN code of the SIM card by using the random PIN code; performing encryption processing on the verification parameter of the SIM card to generate an encrypted verification parameter, where the verification parameter includes the random PIN code, An attribute parameter of the SIM card, and a storage unit, configured to store the encrypted verification parameter in a storage unit of the user equipment.
  • the attribute parameter of the SIM card includes at least one of an ICCID, an IMEI, an MSI, a MAC address, and an SN.
  • the processing unit is configured to: splicing the random PIN code and the ICCID into a character string, performing encryption processing on the character string, generating an encrypted character string, and using the encrypted character
  • the string is used as the encrypted verification parameter.
  • the processing unit is configured to: perform encryption processing on the random PIN code and the attribute parameter respectively, and generate an encrypted verification parameter, where the encrypted verification parameter includes an encrypted random PIN code and encryption. After the property parameters.
  • a fifth aspect of the embodiments of the present invention provides an apparatus for unlocking a SIM card, including: a receiving unit, configured to receive an instruction for releasing a lock on a SIM card on the user equipment; and a processing unit, configured to be used by the user equipment Obtaining the encrypted verification parameter in the storage unit, the verification parameter includes a random PIN code, and an attribute parameter of the locked SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; and verifying by using the verification parameter a SIM card on the user equipment; when it is determined that the verification is passed, the locking of the SIM card is released, so that the user equipment can use the service provided by the SIM card.
  • the processing unit is configured to: verify whether the random PIN code is consistent with a PIN code of a SIM card on the user equipment, and verify an ICCID of the locked SIM card and a SIM card on the user equipment. Is the ICCID consistent?
  • a sixth aspect of the embodiments of the present invention provides an apparatus for turning off a verification function of a SIM card, comprising: a receiving unit, configured to receive an instruction to close a verification function of the SIM card; and a processing unit, configured to generate a user input to close the SIM according to the instruction
  • the prompt of the password of the verification function of the card if the password is correct, the encrypted verification parameter is obtained from the storage unit of the user equipment, the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and the encryption
  • the verification parameter is subjected to a decryption process to obtain the verification parameter; the verification parameter is used to verify the SIM card on the user equipment; and when it is determined that the verification is passed, the PIN code verification function of the SIM card is closed.
  • a seventh aspect of the embodiments of the present invention further provides an electronic device, including: at least one processor, and a memory communicably coupled to the at least one processor; wherein the memory is stored for execution by the at least one processor And the at least one processor implements the method according to the first aspect or the second aspect or the third aspect of the embodiment of the present invention by executing the instruction stored in the memory.
  • the eighth aspect of the embodiments of the present invention further provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, when the computer instructions are run on a computer, causing the computer to perform the present invention Embodiments of the first or second aspect or the method of the third aspect.
  • FIG. 1 is a schematic flowchart of a method for locking a SIM card according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a method for unlocking a SIM card according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a method for turning off a SIM card verification function according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of an apparatus for locking a SIM card according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for unlocking a SIM card according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an apparatus for turning off a SIM card verification function according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
  • association relationship describing an association object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and A and B, there are three cases of B alone.
  • character "/" in this article generally indicates that the contextual object is an "or" relationship.
  • the SIM card according to the embodiment of the present invention may also be referred to as a telephone card, a smart card, etc., and is actually a smart card containing a large-scale integrated circuit, which is mainly used to register important data and information of the user, such as a digital mobile phone customer.
  • the information, the encrypted key, and the user's phone book can be authenticated by the Global System for Mobile Communication (GSM) network client identity and the voice information of the customer during the call.
  • GSM Global System for Mobile Communication
  • a user equipment may be a device capable of installing a SIM card and connecting to a mobile communication network through a SIM card and providing voice and/or data connectivity to the user.
  • the user equipment can communicate with one or more core networks via a Radio Access Network (RAN).
  • RAN Radio Access Network
  • the user equipment may be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal, for example, a portable, pocket, handheld, computer built-in or in-vehicle mobile device that is wireless with The access network exchanges languages and/or data.
  • the PIN code involved in the embodiment of the present invention is a secret identification code for protecting the SIM card from misuse.
  • the PIN code verification is a security measure for protecting the SIM card. If the PIN code verification function of the SIM card is enabled, the user needs to perform PIN code verification on the SIM card on the user equipment after the device is turned on or when the SIM card is inserted. If the wrong PIN code is entered multiple times, the user equipment will ask for the PIN Unlocking Key (PUK) code of the PIN code.
  • PKI PIN Unlocking Key
  • the embodiment of the invention provides a method for locking a SIM card, which is used to solve the technical problem that the method for locking a SIM card by a user equipment in the prior art is low.
  • the method mainly includes the following steps:
  • Step 101 Receive an instruction to lock a SIM card on the user equipment, generate a random PIN code for the SIM card, and update an original PIN code of the SIM card by using the random PIN code.
  • the implementation of the instruction for locking the SIM card on the user equipment includes, but is not limited to, the following two types: 1) when the device and the SIM card are factory-set, the vendor technician inputs the SIM on the user equipment. The card is instructed to lock; 2) after the user equipment unlocks the SIM card by using the original PIN code of the SIM card, the user equipment automatically generates an instruction to lock the SIM card on the user equipment.
  • the specific scenario of the second type may include: after the user equipment detects that the SIM card is successfully unlocked by using the original PIN code of the SIM card, the user equipment generates an instruction for locking the SIM card on the user equipment.
  • the PIN code status of the SIM card may be determined first, and the PIN code verification function of the SIM card is determined to be enabled and the PIN code of the SIM card is activated.
  • the original PIN code of the SIM card is replaced.
  • the PIN code verification function of the SIM card is enabled. If the PIN code verification function of the SIM card is not enabled, the PIN code verification function of the SIM card is enabled. After determining that the PIN code verification function of the SIM card is enabled, further determining whether the PIN code error input number of the SIM card is greater than a predetermined number of times, and replacing the PIN code error input number of the SIM card when the number of PIN codes is greater than a predetermined number of times The original PIN code of the SIM card.
  • Step 102 Perform encryption processing on the verification parameter of the SIM card to generate an encrypted verification parameter, where the verification parameter includes the random PIN code and an attribute parameter of the SIM card.
  • the user equipment encrypts the verification parameters of the SIM card by using a reversible encryption algorithm, so that the encrypted verification parameters can be decrypted by the user equipment.
  • the reversible encryption algorithm may be a Base64 encryption algorithm, a Tiny Encryption Algorithm (TEA), a Data Encryption Algorithm (DEA), a Triple Data Encryption Algorithm (TDEA), or an advanced encryption standard (The combination of any one or more of the Advanced Encryption Standard (AES) algorithm, the SMS4 encryption algorithm, and the like is not specifically limited in the embodiment of the present invention.
  • the attribute parameter of the SIM card may be any combination of the ICCID, the IMEI, the MSI, the media access control MAC address, the SN, and the like, and is not specifically limited in the embodiment of the present invention.
  • Step 103 Store the encrypted verification parameter in a storage unit of the user equipment.
  • the storage unit may be a flash memory, a random access memory (RAM), an Erasable Programmable Read Only Memory (EPROM), etc., which is not in the embodiment of the present invention. Make specific restrictions.
  • the user equipment generates a random PIN code for the SIM card to replace the original PIN code of the SIM card, and encrypts the generated random PIN code and the attribute parameters of the SIM card, and stores the attribute parameters in the user equipment, thereby improving the SIM card.
  • the confidentiality of the PIN code increases the difficulty of the illegal user device to decrypt the SIM card, thereby improving the security of the user device locking the SIM card.
  • the authentication parameter of the SIM card is encrypted, and the encrypted verification parameter is generated.
  • the specific implementation manner includes but is not limited to the following two types:
  • Method 1 splicing all the parameters included in the verification parameter into a character string, encrypting the character string, generating an encrypted character string, and using the encrypted character string as the encrypted verification parameter.
  • the verification parameter is the random PIN code and the ICCID
  • the generated random PIN code and the ICCID of the SIM card are concatenated into a character string, and the character string is encrypted to generate an encrypted character.
  • the string is used as the encrypted verification parameter.
  • Manner 2 Perform encryption processing on each parameter included in the verification parameter, and generate an encrypted parameter corresponding to each parameter, where the encrypted verification parameter includes each encrypted parameter generated.
  • the verification parameter is the random PIN code and the ICCID
  • the generated random PIN code and the ICCID of the SIM card are respectively encrypted to generate an encrypted verification parameter
  • the encrypted verification parameter includes The encrypted random PIN code and the encrypted ICCID.
  • the SIM card that is locked by the user terminal may be one or multiple, and is not specifically limited in this embodiment of the present invention.
  • the user terminal may separately configure a random PIN code for the above two SIM cards, and use the above-mentioned reversible encryption method to verify the verification parameters corresponding to the above two SIM cards. It is stored in the storage unit of the user terminal, so that the user terminal can decrypt any one of the above two SIM cards, thereby implementing the call accessing the Internet.
  • the user terminal can lock multiple SIM cards at the same time, thereby improving the user experience.
  • an embodiment of the present invention further provides a method for unlocking a SIM card.
  • the method includes:
  • Step 201 Receive an instruction to release the lock on the SIM card on the user equipment.
  • the detecting module in the user equipment detects that a card is inserted in the card slot
  • the detecting module generates an unlocking instruction and sends the command to the receiving module
  • the receiving module receives the command.
  • Step 202 Obtain an encrypted verification parameter from a storage unit of the user equipment, where the verification parameter includes a random PIN code and an attribute parameter of the locked SIM card.
  • the attribute parameters of the SIM card are one or more of an ICCID, an IMEI, an MSI, a media access control MAC address, and an SN.
  • Step 203 Perform decryption processing on the encrypted verification parameter to obtain the verification parameter.
  • the implementation manner of decrypting the encrypted verification parameter includes: adopting one or more encryption methods of Base64, TEA, DEA, TDEA, AES, and SMS4.
  • the decryption method decrypts the encrypted verification parameters.
  • Step 204 Verify the SIM card on the user equipment by using the verification parameter; when it is determined that the verification is passed, unlock the SIM card.
  • the attribute parameter includes the IMEI
  • verifying that the IMEI of the user equipment and the IMEI saved by the SIM card on the user equipment are
  • the attribute parameter includes the IMEI
  • verifying that the SIM card on the SN user equipment of the user equipment is saved Whether the SN is consistent.
  • the verification If it is determined that the verification is passed, it indicates that the SIM card in the SIM card slot of the user equipment is the SIM card previously locked by the user equipment, and the user equipment can use the services provided by the SIM card, such as calling, surfing, and the like.
  • the SIM card on the user equipment may be verified by using the stored verification parameter, if the verified SIM card is originally locked by the user equipment.
  • the SIM card can decrypt the SIM card by using the saved verification parameter, so that the user equipment can use the service provided by the SIM card, thereby improving the security and confidentiality of the unlocking.
  • the specific implementation manners of the steps 203 and 204 include the following two types:
  • the first type when the user equipment encrypts the authentication parameters of the SIM card in the manner of the foregoing mode 1, the user equipment uses the stored verification parameters to verify the SIM card on the user equipment, and the user equipment includes the user equipment from the storage unit. Obtaining the encrypted character string, and performing decryption processing on the encrypted character string to obtain the random PIN code and the ICCID; and then determining the random PIN code obtained from the storage unit of the user equipment and the verified SIM Whether the PIN code stored by the card is consistent; when the random PIN code obtained from the storage unit of the user equipment is consistent with the PIN code stored by the verified SIM card, it is determined that the verification is passed.
  • the second type when the user equipment encrypts the authentication parameters of the SIM card in the manner of the foregoing mode 2, the user equipment uses the stored verification parameters to verify the SIM card on the user equipment, and the user equipment includes the user equipment from the storage unit. Obtaining the encrypted random PIN code and the encrypted ICCID, and performing decryption processing on the encrypted random PIN code and the encrypted ICCID to obtain the random PIN code and the ICCID; and then determining the storage unit from the user equipment Whether the obtained random PIN code is consistent with the PIN code stored by the verified SIM card; when the random PIN code obtained from the storage unit of the user equipment is consistent with the PIN code stored by the verified SIM card, it is determined that the verification is passed. .
  • the SIM card is verified by using the encrypted verification parameter stored in the user equipment, which improves the security of the user equipment to unlock the SIM card.
  • the verification ICCID program can also be added, which can further improve the security of the user equipment to unlock the SIM card.
  • the method before the verifying the SIM card in the SIM card slot of the user equipment by using the verification parameter, the method further includes: determining that the SIM card in the SIM card slot of the user equipment is not required to be verified by using the PUK code. .
  • the method for determining that the SIM card in the SIM card slot of the user equipment is not required to be verified by using the PUK code may be: determining that the PIN code error input number of the SIM card is greater than a preset number of times, the preset number of times Greater than or equal to 0. This is because after the PIN code of the existing SIM card is input a certain number of times, the SIM card is locked, and the SIM card can no longer be decrypted by using the PIN code, and the SIM card can only be decrypted by using the PUK code.
  • an embodiment of the present invention further provides a method for turning off the verification function of the SIM card.
  • the method includes:
  • Step 301 Receive an instruction to close the verification function of the SIM card.
  • Step 302 Generate, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card;
  • Step 303 If the password is correct, obtain the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code and an attribute parameter of the locked SIM card.
  • Step 304 Perform decryption processing on the encrypted verification parameter to obtain the verification parameter.
  • Step 305 Verify the SIM card on the user equipment by using the verification parameter; when determining that the verification is passed, turn off the PIN code verification function of the SIM card.
  • the instruction to disable the verification function of the SIM card in step 301 may be an instruction input by the user, or an application generated by the user equipment may be triggered by the application on the user equipment, which is not specifically limited in the embodiment of the present invention. For example, on the setting interface of the user device, click to close the menu of the verification function of the SIM card.
  • step 202 in the method for unlocking the SIM in the embodiment of the present invention.
  • step 203 is not described here.
  • the verification function of the SIM card can be turned off, so that the SIM card can be used by other user equipments, which improves the user experience.
  • the encrypted random PIN code is stored in a storage unit of the user equipment.
  • the user equipment When the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, it is determined that the user equipment needs to unlock the SIM card;
  • the encrypted random PIN code is obtained from a storage unit of the user equipment;
  • the user equipment In the first solution, the user equipment generates a random PIN code for the SIM card and replaces the original PIN code of the SIM card, and then encrypts the random PIN code by using the Base64 encryption algorithm; and the user equipment needs to decrypt the encrypted PIN code after verifying the SIM card.
  • An illegal user device that cannot be used but does not have a random PIN code and an encryption method that does not know the random PIN code cannot decrypt the SIM card.
  • the PIN code has higher confidentiality, and the user equipment locks the SIM card more securely.
  • the encrypted ICCID and the encrypted random PIN code are stored in a storage unit of the user equipment.
  • the user equipment When the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, it is determined that the user equipment needs to unlock the SIM card;
  • step 225 Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, step 225 is further performed;
  • step 235 Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, it is closed; if yes, step 235 is further performed;
  • the scheme 2 further increases the verification procedure of the ICCID, that is, after the user equipment successfully verifies the SIM card by using the random PIN code, it is also required to determine that the ICCID saved by the user equipment is consistent with the ICCID of the verified SIM card, and further The security of the user equipment to lock the SIM card is improved.
  • the encrypted string is stored in a storage unit of the user device.
  • the user equipment When the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, it is determined that the user equipment needs to unlock the SIM card;
  • step 325 Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, step 325 is further performed;
  • the encrypted character string is obtained from a storage unit of the user equipment
  • step 335 Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, the shutdown fails; if they are consistent, step 335 is further performed;
  • scheme 3 not only adds the ICCID parameter to the verification parameters, but also splices the ICCID and the random PIN code into a string for encryption, which increases the complexity of the verification parameters and further improves the confidentiality of the PIN code. The security of the user equipment to lock the SIM card is improved.
  • an embodiment of the present invention further provides an apparatus for locking a SIM card, including:
  • the receiving unit 401 is configured to receive an instruction to lock the SIM card on the user equipment
  • the processing unit 402 is configured to generate a random PIN code for the SIM card, and update the original PIN code of the SIM card by using the random PIN code; encrypt the verification parameter of the SIM card, and generate an encrypted Verifying parameters, the verification parameters including the random PIN code, attribute parameters of the SIM card;
  • the storage unit 403 is configured to store the encrypted verification parameter in the storage unit 403 of the user equipment.
  • the attribute parameter of the SIM card includes at least one of an ICCID, an IMEI, an MSI, a MAC address, and an SN.
  • the processing unit 402 is configured to: concatenate the random PIN code and the ICCID into a character string, perform encryption processing on the character string, generate an encrypted character string, and perform the encrypted A string is used as the encrypted verification parameter.
  • the processing unit 402 is configured to: perform encryption processing on the random PIN code and the attribute parameter, respectively, to generate an encrypted verification parameter, where the encrypted verification parameter includes an encrypted random PIN code, Encrypted attribute parameters.
  • an embodiment of the present invention further provides an apparatus for unlocking a SIM card, including:
  • the receiving unit 501 is configured to receive an instruction to release the locking of the SIM card on the user equipment;
  • the processing unit 502 is configured to obtain the encrypted verification parameter from the storage unit 403 of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and decryption of the encrypted verification parameter. Obtaining the verification parameter, verifying the SIM card on the user equipment by using the verification parameter, and releasing the locking of the SIM card when determining that the verification is passed, so that the user equipment can use the SIM card service provided.
  • the processing unit 502 is configured to: verify whether the random PIN code is consistent with a PIN code of a SIM card on the user equipment, and verify an ICCID of the locked SIM card and a SIM on the user equipment. Whether the card's ICCID is consistent.
  • an embodiment of the present invention further provides an apparatus for turning off a verification function of a SIM card, including:
  • the receiving unit 601 is configured to receive an instruction to close the verification function of the SIM card
  • the processing unit 602 is configured to generate, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card; if the password is correct, obtain the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; verifying the SIM card on the user equipment by using the verification parameter; Turn off the PIN code verification function of the SIM card.
  • an embodiment of the present invention further provides an electronic device, including: at least one processor 701, and a memory 702 communicably connected to the at least one processor 701; wherein the memory 702 is stored There are instructions executable by the at least one processor 701, and the at least one processor 701 implements the above method in accordance with an embodiment of the present invention by executing instructions stored by the memory 702.
  • an embodiment of the present invention further provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, when the computer instructions are run on a computer, causing the computer
  • the above method as in the embodiment of the present invention is performed.
  • the user equipment generates a random PIN code for the SIM card to replace the original PIN code of the SIM card, and encrypts the generated random PIN code and the attribute parameters of the SIM card, and stores the attribute parameters in the user equipment, thereby improving the SIM card PIN code.
  • the confidentiality increases the difficulty of the illegal user device to decipher the SIM card, thereby improving the security of the user device locking the SIM card.
  • the user equipment saves the ICCID of the SIM card locked by the user equipment in addition to the random PIN code of the SIM card locked by the user equipment; the user equipment only needs to pass the PIN code verification and the ICCID verification when verifying the SIM card.
  • the SIM card can be used for online calls, which further improves the security of the user device locking the SIM card.
  • the SIM card verification function can be turned off, so that the SIM card can be used by other user equipments, which improves the user experience.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Abstract

Embodiments of the present invention provide a method and a device for locking a SIM card. The invention solves a technical problem in which existing methods for locking a SIM card adopted by user equipment in the prior art have low security. The method comprises: receiving an instruction to lock a SIM card in a user equipment unit; generating a random PIN code for the SIM card, and using the random PIN code to update an original PIN code of the SIM card; and encrypting an authentication parameter of the SIM card, and generating an encrypted authentication parameter comprising the random PIN code and an attribute parameter of the SIM card; and storing the encrypted authentication parameter in a memory unit of the user equipment unit.

Description

一种锁定SIM卡的方法及装置Method and device for locking SIM card
本申请要求在2017年12月08日提交中国专利局、申请号为201711297770.7、发明名称为“一种锁定SIM卡的方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. JP-A No. No. No. No. No. No. No. No. No. No. No. No. No. No. No. In the application.
技术领域Technical field
本发明涉及通信领域,特别涉及一种锁定SIM卡的方法及装置。The present invention relates to the field of communications, and in particular, to a method and apparatus for locking a SIM card.
背景技术Background technique
移动运营商为了争取到更多的用户、尽可能多地给自己带来语音和数据流量,为用户定制了一些差异化、个性化的服务和资费标准,如无线公话、监控终端等。为了维护自身的权益,运营商规定一些专用的用户身份识别卡(Subscriber Identification Module,SIM卡)只能在指定的用户设备上使用,因此用户设备需要对SIM卡进行锁定。In order to gain more users and bring as much voice and data traffic as possible to the mobile operators, mobile operators have customized differentiated and personalized services and tariffs, such as wireless public telephones and monitoring terminals. In order to protect its own rights and interests, the operator stipulates that some dedicated Subscriber Identification Modules (SIM cards) can only be used on designated user equipments, so the user equipment needs to lock the SIM card.
现有技术一般是利用指定的个人识别密码(Personal Identification Number,PIN)对SIM卡锁定。但是,这种锁定机制安全性较低。The prior art generally uses a specified Personal Identification Number (PIN) to lock the SIM card. However, this locking mechanism is less secure.
发明内容Summary of the invention
本发明实施例提供一种锁定SIM卡的方法及装置,用于解决现有技术锁定SIM卡方法安全性低的技术问题。The embodiment of the invention provides a method and a device for locking a SIM card, which are used to solve the technical problem that the prior art locking SIM card method has low security.
本发明实施例第一方面提供一种锁定SIM卡的方法,应用于用户设备,所述方法包括:A first aspect of the embodiments of the present invention provides a method for locking a SIM card, which is applied to a user equipment, where the method includes:
接收对所述用户设备上SIM卡进行锁定的指令;Receiving an instruction to lock a SIM card on the user equipment;
为所述SIM卡生成一个随机PIN码,并采用所述随机PIN码更新所述SIM卡的原PIN码;Generating a random PIN code for the SIM card, and updating the original PIN code of the SIM card by using the random PIN code;
对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,所述 验证参数包括所述随机PIN码、所述SIM卡的属性参数;Encrypting the verification parameter of the SIM card to generate an encrypted verification parameter, where the verification parameter includes the random PIN code and an attribute parameter of the SIM card;
将所述加密后的验证参数存储在所述用户设备的存储单元中。The encrypted verification parameter is stored in a storage unit of the user equipment.
在上述方案中,用户设备为SIM卡生成一随机PIN码替换SIM卡的原PIN码,并将生成的随机PIN码、所述SIM卡的属性参数进行和加密后存储在所述用户设备中,提高了SIM卡PIN码的保密性,增加了非法用户设备破译SIM卡的难度,进而提高了用户设备对SIM卡进行锁定的安全性。In the above solution, the user equipment generates a random PIN code for the SIM card to replace the original PIN code of the SIM card, and encrypts and generates the generated random PIN code and the attribute parameters of the SIM card in the user equipment. The confidentiality of the SIM card PIN code is improved, and the difficulty of deciphering the SIM card by the illegal user equipment is increased, thereby improving the security of the user equipment locking the SIM card.
可选的,所述SIM卡的属性参数包括集成电路卡识别码(Integrate circuit card identity,ICCID)、国际移动设备身份码(International Mobile Equipment Identity,IMEI)、国际移动用户识别码(International Mobile Subscriber Identification Number,IMSI)、媒体访问控制(Medium Access Control,MAC)地址、产品序列号(Serial Number,SN)中的至少一项。Optionally, the attribute parameters of the SIM card include an integrated circuit card identity (ICCID), an International Mobile Equipment Identity (IMEI), and an International Mobile Subscriber Identification (International Mobile Subscriber Identification). Number, IMSI), Medium Access Control (MAC) address, and Serial Number (SN).
通过本方式,可以进一步增大验证参数的复杂程度,进一步提高用户设备对SIM卡进行锁定的安全性。In this manner, the complexity of the verification parameters can be further increased, and the security of locking the SIM card by the user equipment is further improved.
可选的,当所述验证参数为所述随机PIN码和所述ICCID时,所述对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,包括:将所述随机PIN码、所述ICCID拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为所述加密后的验证参数。Optionally, when the verification parameter is the random PIN code and the ICCID, the encrypting the verification parameter of the SIM card to generate the encrypted verification parameter, including: the random PIN code The ICCID is concatenated into a string, and the string is encrypted, and the encrypted string is generated, and the encrypted string is used as the encrypted verification parameter.
通过本方式,可以增大验证参数的复杂程度,提高随机PIN码被破解的难度,进一步提高用户设备对SIM卡进行锁定的安全性。In this manner, the complexity of the verification parameters can be increased, the difficulty of cracking the random PIN code can be improved, and the security of locking the SIM card by the user equipment can be further improved.
可选的,所述对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,包括:分别对所述随机PIN码、所述属性参数进行加密处理,生成加密后的验证参数,所述加密后的验证参数包括加密后的随机PIN码、加密后的属性参数。Optionally, the encrypting the verification parameter of the SIM card to generate the encrypted verification parameter includes: separately encrypting the random PIN code and the attribute parameter, and generating an encrypted verification parameter, The encrypted verification parameter includes an encrypted random PIN code and an encrypted attribute parameter.
通过本方式,可以增大验证参数的复杂程度,提高随机PIN码被破解的难度,进一步提高用户设备对SIM卡进行锁定的安全性。In this manner, the complexity of the verification parameters can be increased, the difficulty of cracking the random PIN code can be improved, and the security of locking the SIM card by the user equipment can be further improved.
本发明实施例第二方面提供一种解锁SIM卡的方法,应用于用户设备,所述方法包括:接收解除对所述用户设备上的SIM卡的锁定的指令;从所述 用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,解除对所述SIM卡的锁定,以使所述用户设备可使用所述SIM卡所提供的服务。A second aspect of the embodiments of the present invention provides a method for unlocking a SIM card, which is applied to a user equipment, the method comprising: receiving an instruction to release a lock on a SIM card on the user equipment; and a storage unit from the user equipment Obtaining the encrypted verification parameter, where the verification parameter includes a random PIN code, and an attribute parameter of the locked SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; and verifying the verification parameter by using the verification parameter a SIM card on the user device; upon determining that the verification is passed, unlocking the SIM card to enable the user device to use the service provided by the SIM card.
通过本方式,在用户时设备接收到解除对所述用户设备上的SIM卡的锁定的指令时,使用验证参数对SIM卡进行验证,提高了用户设备对SIM卡进行验证的安全性。In this manner, when the user receives the instruction to release the lock on the SIM card on the user equipment, the user uses the verification parameter to verify the SIM card, which improves the security of the user equipment to verify the SIM card.
可选的,当所述验证参数为所述随机PIN码、锁定SIM卡的ICCID时;所述采用所述验证参数验证所述用户设备上的SIM卡,包括:验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致,以及验证所述锁定SIM卡的ICCID与所述用户设备上的SIM卡的ICCID是否一致。Optionally, when the verification parameter is the random PIN code and the ICCID of the SIM card is locked, the verifying the SIM card on the user equipment by using the verification parameter includes: verifying the random PIN code and the location Whether the PIN code of the SIM card on the user equipment is consistent, and whether the ICCID of the locked SIM card is consistent with the ICCID of the SIM card on the user equipment.
通过本方式,可以增大验证参数的复杂程度,提高随机PIN码被破解的难度,进一步提高用户设备对SIM卡进行验证的安全性。In this manner, the complexity of the verification parameters can be increased, the difficulty of cracking the random PIN code can be improved, and the security of verifying the SIM card by the user equipment can be further improved.
本发明实施例第三方面提供一种关闭SIM卡的验证功能的方法,应用于用户设备,所述方法包括:接收关闭SIM卡的验证功能的指令;根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;若密码正确,则从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,关闭所述SIM卡的PIN码验证功能。A third aspect of the embodiments of the present invention provides a method for closing a verification function of a SIM card, which is applied to a user equipment, the method comprising: receiving an instruction to close a verification function of the SIM card; generating a user input to close the SIM card according to the instruction a prompt for verifying the password of the function; if the password is correct, obtaining the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and the encrypted parameter The verification parameter performs a decryption process to obtain the verification parameter; the verification parameter is used to verify the SIM card on the user equipment; and when it is determined that the verification is passed, the PIN code verification function of the SIM card is closed.
通过本方式,可以实现关闭用户设备的PIN码验证功能,以使用户可以根据使用场景对用户设备与SIM卡的状态进行调整,提高用户体验。In this manner, the PIN code verification function of the user equipment can be disabled, so that the user can adjust the state of the user equipment and the SIM card according to the usage scenario, thereby improving the user experience.
本发明实施例第四方面提供一种锁定SIM卡的装置,包括:接收单元,用于接收对所述用户设备上SIM卡进行锁定的指令;处理单元,用于为所述SIM卡生成一个随机PIN码,并采用所述随机PIN码更新所述SIM卡的原PIN码;对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,所述 验证参数包括所述随机PIN码、所述SIM卡的属性参数;存储单元,用于将所述加密后的验证参数存储在所述用户设备的存储单元中。A fourth aspect of the embodiments of the present invention provides a device for locking a SIM card, including: a receiving unit, configured to receive an instruction for locking a SIM card on the user equipment; and a processing unit, configured to generate a random a PIN code, and updating the original PIN code of the SIM card by using the random PIN code; performing encryption processing on the verification parameter of the SIM card to generate an encrypted verification parameter, where the verification parameter includes the random PIN code, An attribute parameter of the SIM card, and a storage unit, configured to store the encrypted verification parameter in a storage unit of the user equipment.
可选的,所述SIM卡的属性参数包括ICCID、IMEI、MSI、MAC地址、SN中的至少一项。Optionally, the attribute parameter of the SIM card includes at least one of an ICCID, an IMEI, an MSI, a MAC address, and an SN.
可选的,所述处理单元用于:将所述随机PIN码、所述ICCID拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为所述加密后的验证参数。Optionally, the processing unit is configured to: splicing the random PIN code and the ICCID into a character string, performing encryption processing on the character string, generating an encrypted character string, and using the encrypted character The string is used as the encrypted verification parameter.
可选的,所述处理单元用于:分别对所述随机PIN码、所述属性参数进行加密处理,生成加密后的验证参数,所述加密后的验证参数包括加密后的随机PIN码、加密后的属性参数。Optionally, the processing unit is configured to: perform encryption processing on the random PIN code and the attribute parameter respectively, and generate an encrypted verification parameter, where the encrypted verification parameter includes an encrypted random PIN code and encryption. After the property parameters.
本发明实施例第五方面提供一种解锁SIM卡的装置,包括:接收单元,用于接收解除对所述用户设备上的SIM卡的锁定的指令;处理单元,用于从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,解除对所述SIM卡的锁定,以使所述用户设备可使用所述SIM卡所提供的服务。A fifth aspect of the embodiments of the present invention provides an apparatus for unlocking a SIM card, including: a receiving unit, configured to receive an instruction for releasing a lock on a SIM card on the user equipment; and a processing unit, configured to be used by the user equipment Obtaining the encrypted verification parameter in the storage unit, the verification parameter includes a random PIN code, and an attribute parameter of the locked SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; and verifying by using the verification parameter a SIM card on the user equipment; when it is determined that the verification is passed, the locking of the SIM card is released, so that the user equipment can use the service provided by the SIM card.
可选的,所述处理单元用于:验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致,以及验证所述锁定SIM卡的ICCID与所述用户设备上的SIM卡的ICCID是否一致。Optionally, the processing unit is configured to: verify whether the random PIN code is consistent with a PIN code of a SIM card on the user equipment, and verify an ICCID of the locked SIM card and a SIM card on the user equipment. Is the ICCID consistent?
本发明实施例第六方面提供一种关闭SIM卡的验证功能的装置,包括:接收单元,用于接收关闭SIM卡的验证功能的指令;处理单元,用于根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;若密码正确,则从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,关闭所述SIM卡的PIN码验证功能。A sixth aspect of the embodiments of the present invention provides an apparatus for turning off a verification function of a SIM card, comprising: a receiving unit, configured to receive an instruction to close a verification function of the SIM card; and a processing unit, configured to generate a user input to close the SIM according to the instruction The prompt of the password of the verification function of the card; if the password is correct, the encrypted verification parameter is obtained from the storage unit of the user equipment, the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and the encryption The verification parameter is subjected to a decryption process to obtain the verification parameter; the verification parameter is used to verify the SIM card on the user equipment; and when it is determined that the verification is passed, the PIN code verification function of the SIM card is closed.
本发明实施例第七方面还提供一种电子设备,包括:至少一个处理器,以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述至少一个处理器通过执行所述存储器存储的指令实现如本发明实施例第一方面或第二方面或第三方面所述方法。A seventh aspect of the embodiments of the present invention further provides an electronic device, including: at least one processor, and a memory communicably coupled to the at least one processor; wherein the memory is stored for execution by the at least one processor And the at least one processor implements the method according to the first aspect or the second aspect or the third aspect of the embodiment of the present invention by executing the instruction stored in the memory.
本发明实施例第八方面还提供一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如本发明实施例第一方面或第二方面或第三方面所述方法。The eighth aspect of the embodiments of the present invention further provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, when the computer instructions are run on a computer, causing the computer to perform the present invention Embodiments of the first or second aspect or the method of the third aspect.
附图说明DRAWINGS
图1为本发明实施例中锁定SIM卡的方法的流程示意图;1 is a schematic flowchart of a method for locking a SIM card according to an embodiment of the present invention;
图2为本发明实施例中解锁SIM卡的方法的流程示意图;2 is a schematic flowchart of a method for unlocking a SIM card according to an embodiment of the present invention;
图3为本发明实施例中关闭SIM卡验证功能的方法的流程示意图;3 is a schematic flowchart of a method for turning off a SIM card verification function according to an embodiment of the present invention;
图4为本发明实施例中锁定SIM卡的装置的结构示意图;4 is a schematic structural diagram of an apparatus for locking a SIM card according to an embodiment of the present invention;
图5为本发明实施例中解锁SIM卡的装置的结构示意图;FIG. 5 is a schematic structural diagram of an apparatus for unlocking a SIM card according to an embodiment of the present invention; FIG.
图6为本发明实施例中关闭SIM卡验证功能的装置的结构示意图;6 is a schematic structural diagram of an apparatus for turning off a SIM card verification function according to an embodiment of the present invention;
图7为本发明实施例中电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面通过附图以及具体实施例对本发明技术方案做详细的说明,应当理解本发明实施例以及实施例中的具体特征是对本发明技术方案的详细的说明,而不是对本发明技术方案的限定,在不冲突的情况下,本发明实施例以及实施例中的技术特征可以相互组合。The technical solutions of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments. It is understood that the specific features of the embodiments and the embodiments of the present invention are the detailed description of the technical solutions of the present invention, and are not limited to the technical solutions of the present invention. In the case of no conflict, the technical features of the embodiments of the present invention and the embodiments may be combined with each other.
需要理解的是,在本发明实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。在本发明实施例的描述中“多个”,是指两个或两个以上。It should be understood that in the description of the embodiments of the present invention, the terms "first", "second" and the like are used only to distinguish the purpose of description, and are not to be understood as indicating or implying relative importance, nor can it be understood as an indication. Or suggest the order. In the description of the embodiments of the present invention, "a plurality" means two or more.
本发明实施例中的术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。The term “and/or” in the embodiment of the present invention is merely an association relationship describing an association object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and A and B, there are three cases of B alone. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
本发明实施例所涉及的SIM卡,也可称为电话卡、智能卡等,实际上是一张内含大规模集成电路的智能卡片,主要用来登记用户的重要数据和信息,例如数字移动电话客户的信息,加密的密钥以及用户的电话簿等,可供全球移动通信系统(Global System for Mobile Communication,GSM)网络客户身份进行鉴别,并对客户通话时的语音信息进行加密。The SIM card according to the embodiment of the present invention may also be referred to as a telephone card, a smart card, etc., and is actually a smart card containing a large-scale integrated circuit, which is mainly used to register important data and information of the user, such as a digital mobile phone customer. The information, the encrypted key, and the user's phone book can be authenticated by the Global System for Mobile Communication (GSM) network client identity and the voice information of the customer during the call.
本发明实施例涉及的用户设备,可以是指能够安装SIM卡并通过SIM卡连接到移动通信网络并向用户提供语音和/或数据连通性的设备。用户设备可以经无线接入网(Radio Access Network,RAN)与一个或多个核心网进行通信。用户设备可以是移动终端,如移动电话(或称为“蜂窝”电话)和具有移动终端的计算机,例如,可以是便携式、袖珍式、手持式、计算机内置的或者车载的移动装置,它们与无线接入网交换语言和/或数据。A user equipment according to an embodiment of the present invention may be a device capable of installing a SIM card and connecting to a mobile communication network through a SIM card and providing voice and/or data connectivity to the user. The user equipment can communicate with one or more core networks via a Radio Access Network (RAN). The user equipment may be a mobile terminal, such as a mobile phone (or "cellular" phone) and a computer with a mobile terminal, for example, a portable, pocket, handheld, computer built-in or in-vehicle mobile device that is wireless with The access network exchanges languages and/or data.
本发明实施例所涉及的PIN码,是用于保护SIM卡免受误用的秘密标识代码,PIN码校验是保护SIM卡的一种安全措施。如果启用了SIM卡的PIN码校验功能,那么用户时设备在开机后或者有SIM卡插入时,需要对用户设备上的SIM卡进行PIN码校验。如果多次输入错误的PIN码,则用户设备会要求输入PIN码的解锁码(PIN Unlocking Key,PUK)码。The PIN code involved in the embodiment of the present invention is a secret identification code for protecting the SIM card from misuse. The PIN code verification is a security measure for protecting the SIM card. If the PIN code verification function of the SIM card is enabled, the user needs to perform PIN code verification on the SIM card on the user equipment after the device is turned on or when the SIM card is inserted. If the wrong PIN code is entered multiple times, the user equipment will ask for the PIN Unlocking Key (PUK) code of the PIN code.
本发明实施例提供一种锁定SIM卡的方法,用于解决现有技术中用户设备对SIM卡进行锁定的方法安全性低的技术问题。参照图1,所述方法主要包括以下步骤:The embodiment of the invention provides a method for locking a SIM card, which is used to solve the technical problem that the method for locking a SIM card by a user equipment in the prior art is low. Referring to FIG. 1, the method mainly includes the following steps:
步骤101:接收对所述用户设备上SIM卡进行锁定的指令;为所述SIM卡生成一个随机PIN码,并采用所述随机PIN码更新所述SIM卡的原PIN码。Step 101: Receive an instruction to lock a SIM card on the user equipment, generate a random PIN code for the SIM card, and update an original PIN code of the SIM card by using the random PIN code.
其中,对所述用户设备上SIM卡进行锁定的指令的实现方式有包括但不限于以下两种:1)在对设备和SIM卡进行出厂设置时,厂商技术人员输入对 所述用户设备上SIM卡进行锁定的指令;2)用户设备在采用所述SIM卡的原PIN码对所述SIM卡解锁成功后,用户设备自动生成对所述用户设备上SIM卡进行锁定的指令。其中第2)种的具体场景可以包括:用户设备在每次开机时,检测到使用SIM卡的原PIN码成功解锁SIM卡后,用户设备生成对所述用户设备上SIM卡进行锁定的指令。The implementation of the instruction for locking the SIM card on the user equipment includes, but is not limited to, the following two types: 1) when the device and the SIM card are factory-set, the vendor technician inputs the SIM on the user equipment. The card is instructed to lock; 2) after the user equipment unlocks the SIM card by using the original PIN code of the SIM card, the user equipment automatically generates an instruction to lock the SIM card on the user equipment. The specific scenario of the second type may include: after the user equipment detects that the SIM card is successfully unlocked by using the original PIN code of the SIM card, the user equipment generates an instruction for locking the SIM card on the user equipment.
在具体实施过程中,在更新所述SIM卡的原PIN码之前,可以先对所述SIM卡的PIN码状态进行判定,在确定所述SIM卡的PIN码验证功能开启并且SIM卡的PIN码被解密时,替换所述SIM卡的原PIN码。In a specific implementation process, before updating the original PIN code of the SIM card, the PIN code status of the SIM card may be determined first, and the PIN code verification function of the SIM card is determined to be enabled and the PIN code of the SIM card is activated. When decrypted, the original PIN code of the SIM card is replaced.
具体的,首先可以判断所述SIM卡的PIN码验证功能是否开启,如果所述SIM卡的PIN码验证功能未开启,则开启所述SIM卡的PIN码验证功能。在确定所述SIM卡的PIN码验证功能开启后,进一步判断所述SIM卡的PIN码错误输入次数是否大于预定次数,在所述SIM卡的PIN码错误输入次数大于预定次数时才可以替换所述SIM卡的原PIN码。这是因为现有的SIM卡的PIN码的错误输入次数达到一定次数后,SIM卡就会被锁死,无法再使用PIN码解密SIM卡,通过判断所述SIM卡的PIN码错误输入次数是否大于预定次数,避免SIM卡被锁死的风险。Specifically, first, it can be determined whether the PIN code verification function of the SIM card is enabled. If the PIN code verification function of the SIM card is not enabled, the PIN code verification function of the SIM card is enabled. After determining that the PIN code verification function of the SIM card is enabled, further determining whether the PIN code error input number of the SIM card is greater than a predetermined number of times, and replacing the PIN code error input number of the SIM card when the number of PIN codes is greater than a predetermined number of times The original PIN code of the SIM card. This is because after the PIN code of the existing SIM card is input a certain number of times, the SIM card is locked, and the PIN code can no longer be used to decrypt the SIM card, and it is determined whether the PIN code of the SIM card is incorrectly input. More than a predetermined number of times, the risk of the SIM card being locked out is avoided.
步骤102:对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,所述验证参数包括所述随机PIN码、所述SIM卡的属性参数。Step 102: Perform encryption processing on the verification parameter of the SIM card to generate an encrypted verification parameter, where the verification parameter includes the random PIN code and an attribute parameter of the SIM card.
具体的,用户设备采用可逆加密算法对所述SIM卡的验证参数进行加密处理,以使加密后的验证参数可以被用户设备解密。其中,可逆加密算法可以为Base64加密算法、微型加密算法(Tiny Encryption Algorithm,TEA)、数据加密算法(Data Encryption Algorithm,DEA)、三重数据加密算法(Triple Data Encryption Algorithm,TDEA)、高级加密标准(Advanced Encryption Standard,AES)算法、SMS4加密算法等中的任意一种或者多种的结合,本发明实施例不做具体限制。Specifically, the user equipment encrypts the verification parameters of the SIM card by using a reversible encryption algorithm, so that the encrypted verification parameters can be decrypted by the user equipment. The reversible encryption algorithm may be a Base64 encryption algorithm, a Tiny Encryption Algorithm (TEA), a Data Encryption Algorithm (DEA), a Triple Data Encryption Algorithm (TDEA), or an advanced encryption standard ( The combination of any one or more of the Advanced Encryption Standard (AES) algorithm, the SMS4 encryption algorithm, and the like is not specifically limited in the embodiment of the present invention.
所述SIM卡的属性参数可以为ICCID、IMEI、MSI、媒体访问控制MAC地址、SN等中的任意一种或者多种的结合,本发明实施例不做具体限制。The attribute parameter of the SIM card may be any combination of the ICCID, the IMEI, the MSI, the media access control MAC address, the SN, and the like, and is not specifically limited in the embodiment of the present invention.
步骤103:将所述加密后的验证参数存储在所述用户设备的存储单元中。Step 103: Store the encrypted verification parameter in a storage unit of the user equipment.
其中,所述存储单元可以为闪存(Flash Memory)、随机存取存储器(random access memory,RAM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)等,本发明实施例不做具体限制。The storage unit may be a flash memory, a random access memory (RAM), an Erasable Programmable Read Only Memory (EPROM), etc., which is not in the embodiment of the present invention. Make specific restrictions.
在上述方案中,用户设备为SIM卡生成一随机PIN码替换SIM卡的原PIN码,并将生成的随机PIN码、SIM卡的属性参数加密后存储在所述用户设备中,提高了SIM卡PIN码的保密性,增加了非法用户设备破译SIM卡的难度,进而提高了用户设备对SIM卡进行锁定的安全性。In the above solution, the user equipment generates a random PIN code for the SIM card to replace the original PIN code of the SIM card, and encrypts the generated random PIN code and the attribute parameters of the SIM card, and stores the attribute parameters in the user equipment, thereby improving the SIM card. The confidentiality of the PIN code increases the difficulty of the illegal user device to decrypt the SIM card, thereby improving the security of the user device locking the SIM card.
可选的,所述对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,具体实现方式包括但不限于以下两种:Optionally, the authentication parameter of the SIM card is encrypted, and the encrypted verification parameter is generated. The specific implementation manner includes but is not limited to the following two types:
方式1:将所述验证参数包括的所有参数拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为加密后的验证参数。Method 1: splicing all the parameters included in the verification parameter into a character string, encrypting the character string, generating an encrypted character string, and using the encrypted character string as the encrypted verification parameter.
例如,当所述验证参数为所述随机PIN码和所述ICCID时,将生成的随机PIN码、SIM卡的ICCID拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为加密后的验证参数。For example, when the verification parameter is the random PIN code and the ICCID, the generated random PIN code and the ICCID of the SIM card are concatenated into a character string, and the character string is encrypted to generate an encrypted character. The string is used as the encrypted verification parameter.
方式2:分别对所述验证参数包括的每一个参数进行加密处理,对应每一个参数都生成一个加密后的参数,所述加密后的验证参数包括生成的每一个加密后的参数。Manner 2: Perform encryption processing on each parameter included in the verification parameter, and generate an encrypted parameter corresponding to each parameter, where the encrypted verification parameter includes each encrypted parameter generated.
例如,当所述验证参数为所述随机PIN码和所述ICCID时,分别对生成的随机PIN码、SIM卡的ICCID进行加密处理,生成加密后的验证参数,所述加密后的验证参数包括加密后的随机PIN码和加密后的ICCID。For example, when the verification parameter is the random PIN code and the ICCID, the generated random PIN code and the ICCID of the SIM card are respectively encrypted to generate an encrypted verification parameter, and the encrypted verification parameter includes The encrypted random PIN code and the encrypted ICCID.
通过本方式,可以增大验证参数的复杂程度,进一步提高用户设备对SIM卡进行锁定的安全性。In this manner, the complexity of the verification parameters can be increased, and the security of locking the SIM card by the user equipment is further improved.
可选的,在具体实施过程中,用户终端锁定的SIM卡可以是一个,也可以是多个,本发明实施例不做具体限制。Optionally, in a specific implementation process, the SIM card that is locked by the user terminal may be one or multiple, and is not specifically limited in this embodiment of the present invention.
例如,当用户终端锁定的SIM卡为两个不同SIM卡时,用户终端可以为 以上两个SIM卡分别配置一个随机PIN码,并采用上述可逆加密方式将以上两个SIM卡对应的验证参数都保存在用户终端的存储单元中,以使该用户终端对以上两个SIM卡中任意一个SIM卡都可以进行解密,进而实现通话上网。For example, when the SIM card locked by the user terminal is two different SIM cards, the user terminal may separately configure a random PIN code for the above two SIM cards, and use the above-mentioned reversible encryption method to verify the verification parameters corresponding to the above two SIM cards. It is stored in the storage unit of the user terminal, so that the user terminal can decrypt any one of the above two SIM cards, thereby implementing the call accessing the Internet.
通过本方式,用户终端可以同时对多个SIM卡进行锁定,提高了用户体验。In this manner, the user terminal can lock multiple SIM cards at the same time, thereby improving the user experience.
基于同一发明构思,本发明实施例还提供一种解锁SIM卡的方法。参照图2,该方法包括:Based on the same inventive concept, an embodiment of the present invention further provides a method for unlocking a SIM card. Referring to Figure 2, the method includes:
步骤201:接收解除对所述用户设备上的SIM卡的锁定的指令。Step 201: Receive an instruction to release the lock on the SIM card on the user equipment.
具体的,用户设备中的检测模块在检测到卡槽中有卡插入时,检测模块就生成解除锁定的指令,并发送给接收模块,接收模块接收该指令。Specifically, when the detecting module in the user equipment detects that a card is inserted in the card slot, the detecting module generates an unlocking instruction and sends the command to the receiving module, and the receiving module receives the command.
步骤202:从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数。Step 202: Obtain an encrypted verification parameter from a storage unit of the user equipment, where the verification parameter includes a random PIN code and an attribute parameter of the locked SIM card.
对应本发明实施例上述锁定SIM卡的方法,此处SIM卡的属性参数为ICCID、IMEI、MSI、媒体访问控制MAC地址、SN中的一项或多项。Corresponding to the foregoing method for locking a SIM card according to an embodiment of the present invention, where the attribute parameters of the SIM card are one or more of an ICCID, an IMEI, an MSI, a media access control MAC address, and an SN.
步骤203:对所述加密后的验证参数进行解密处理,获得所述验证参数。Step 203: Perform decryption processing on the encrypted verification parameter to obtain the verification parameter.
对应本发明实施例上述锁定SIM卡的方法,此处对加密后的验证参数进行解密的实现方式包括:采用Base64、TEA、DEA、TDEA、AES、SMS4中的一种或者多种加密方法对应的解密方法对所述加密后的验证参数进行解密。Corresponding to the method for locking a SIM card in the embodiment of the present invention, the implementation manner of decrypting the encrypted verification parameter includes: adopting one or more encryption methods of Base64, TEA, DEA, TDEA, AES, and SMS4. The decryption method decrypts the encrypted verification parameters.
步骤204:采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,解除对所述SIM卡的锁定。Step 204: Verify the SIM card on the user equipment by using the verification parameter; when it is determined that the verification is passed, unlock the SIM card.
具体的,判断从用户设备的存储单元中获取的的随机PIN码与被验证的SIM卡存储的PIN码是否一致;当从用户设备的存储单元中获取的的随机PIN码与被验证的SIM卡存储的PIN码一致时,确定验证通过。Specifically, determining whether the random PIN code obtained from the storage unit of the user equipment is consistent with the PIN code stored by the verified SIM card; when the random PIN code obtained from the storage unit of the user equipment and the verified SIM card When the stored PIN codes are the same, it is determined that the verification is passed.
进一步地,在确定PIN码一致时,还可以进一步验证属性参数是否一致。例如,对应本发明实施例上述锁定SIM卡的方法,当属性参数包括IMEI时,在确定定PIN码一致之后、确定验证通过之前,验证用户设备的IMEI和用户设备上的SIM卡保存的IMEI是否一致;又例如,对应本发明实施例上述锁 定SIM卡的方法,当属性参数包括IMEI时,在确定定PIN码一致之后、确定验证通过之前,验证用户设备的SN用户设备上的SIM卡保存的SN是否一致。Further, when it is determined that the PIN codes are consistent, it is further possible to further verify whether the attribute parameters are consistent. For example, in the method for locking a SIM card according to the embodiment of the present invention, when the attribute parameter includes the IMEI, after determining that the PIN code is consistent, and determining that the verification is passed, verifying that the IMEI of the user equipment and the IMEI saved by the SIM card on the user equipment are For example, in the method for locking a SIM card according to the embodiment of the present invention, when the attribute parameter includes the IMEI, after determining that the PIN code is consistent, and after determining that the verification is passed, verifying that the SIM card on the SN user equipment of the user equipment is saved Whether the SN is consistent.
如果确定验证通过,则说明用户设备的SIM卡槽中的SIM卡是该用户设备先前锁定的SIM卡,则所述用户设备可以使用所述SIM卡所提供的服务,比如通话、上网等。If it is determined that the verification is passed, it indicates that the SIM card in the SIM card slot of the user equipment is the SIM card previously locked by the user equipment, and the user equipment can use the services provided by the SIM card, such as calling, surfing, and the like.
在上述方案中,在用户设备检测到用户设备的SIM卡槽有SIM卡插入时,可以采用存储的验证参数对用户设备上的SIM卡进行验证,若被验证的SIM卡为用户设备原来锁定的SIM卡,则用户设备能够使用其保存的验证参数对该SIM卡解密,进而使得用户设备可使用该SIM卡所提供的服务,提高了解锁的安全性、保密性。In the above solution, when the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, the SIM card on the user equipment may be verified by using the stored verification parameter, if the verified SIM card is originally locked by the user equipment. The SIM card can decrypt the SIM card by using the saved verification parameter, so that the user equipment can use the service provided by the SIM card, thereby improving the security and confidentiality of the unlocking.
可选的,对应本发明实施例上述锁定SIM卡的方法,当所述验证参数为所述随机PIN码、锁定SIM卡的ICCID时,步骤203、步骤204的具体实现方式包括以下两种:Optionally, corresponding to the method for locking the SIM card in the embodiment of the present invention, when the verification parameter is the random PIN code and the ICCID of the SIM card is locked, the specific implementation manners of the steps 203 and 204 include the following two types:
第1种:当用户设备对所述SIM卡的验证参数进行加密处理的方式为上述方式1时,用户设备采用存储的验证参数对用户设备上的SIM卡进行验证具体包括:用户设备从存储单元中获取加密后的字符串,并对加密后的字符串进行解密处理,获得所述随机PIN码、所述ICCID;然后判断从用户设备的存储单元中获取的的随机PIN码与被验证的SIM卡存储的PIN码是否一致;当从用户设备的存储单元中获取的的随机PIN码与被验证的SIM卡存储的PIN码一致时,确定验证通过。The first type: when the user equipment encrypts the authentication parameters of the SIM card in the manner of the foregoing mode 1, the user equipment uses the stored verification parameters to verify the SIM card on the user equipment, and the user equipment includes the user equipment from the storage unit. Obtaining the encrypted character string, and performing decryption processing on the encrypted character string to obtain the random PIN code and the ICCID; and then determining the random PIN code obtained from the storage unit of the user equipment and the verified SIM Whether the PIN code stored by the card is consistent; when the random PIN code obtained from the storage unit of the user equipment is consistent with the PIN code stored by the verified SIM card, it is determined that the verification is passed.
第2种:当用户设备对所述SIM卡的验证参数进行加密处理的方式为上述方式2时,用户设备采用存储的验证参数对用户设备上的SIM卡进行验证具体包括:用户设备从存储单元中获取加密后的随机PIN码以及加密后的ICCID,并对加密后的随机PIN码以及加密后的ICCID进行解密处理,获得所述随机PIN码、所述ICCID;然后判断从用户设备的存储单元中获取的的随机PIN码与被验证的SIM卡存储的PIN码是否一致;当从用户设备的存储 单元中获取的的随机PIN码与被验证的SIM卡存储的PIN码一致时,确定验证通过。The second type: when the user equipment encrypts the authentication parameters of the SIM card in the manner of the foregoing mode 2, the user equipment uses the stored verification parameters to verify the SIM card on the user equipment, and the user equipment includes the user equipment from the storage unit. Obtaining the encrypted random PIN code and the encrypted ICCID, and performing decryption processing on the encrypted random PIN code and the encrypted ICCID to obtain the random PIN code and the ICCID; and then determining the storage unit from the user equipment Whether the obtained random PIN code is consistent with the PIN code stored by the verified SIM card; when the random PIN code obtained from the storage unit of the user equipment is consistent with the PIN code stored by the verified SIM card, it is determined that the verification is passed. .
另外,在采用上述任意一种方式对该设备上的SIM卡进行验证的过程中,当确定用户设备的存储单元中存储的随机PIN码与被验证的SIM卡存储的PIN码一致后,还可以进一步判断用户设备的存储单元中存储的随机ICCID与被验证的SIM卡ICCID是否一致,在用户设备的存储单元中存储的随机ICCID与被验证的SIM卡ICCID一致时,再确定验证通过。In addition, in the process of verifying the SIM card on the device in any of the above manners, when it is determined that the random PIN code stored in the storage unit of the user device is consistent with the PIN code stored in the verified SIM card, It is further determined whether the random ICCID stored in the storage unit of the user equipment is consistent with the verified SIM card ICCID, and when the random ICCID stored in the storage unit of the user equipment is consistent with the verified SIM card ICCID, the verification is determined to pass.
通过本方式,采用用户设备中存储的加密的验证参数验证SIM卡,提高了用户设备对SIM卡进行解锁的安全性。在使用验证参数对SIM卡进行验证的过程中,还可以增加验证ICCID程序,可进一步提高用户设备对SIM卡进行解锁的安全性。In this manner, the SIM card is verified by using the encrypted verification parameter stored in the user equipment, which improves the security of the user equipment to unlock the SIM card. In the process of verifying the SIM card by using the verification parameter, the verification ICCID program can also be added, which can further improve the security of the user equipment to unlock the SIM card.
可选的,在采用所述验证参数对用户设备的SIM卡槽中的SIM卡进行验证之前,所述方法还包括:确定不需要采用PUK码对用户设备的SIM卡槽中的SIM卡进行验证。Optionally, before the verifying the SIM card in the SIM card slot of the user equipment by using the verification parameter, the method further includes: determining that the SIM card in the SIM card slot of the user equipment is not required to be verified by using the PUK code. .
其中,确定不需要采用PUK码对用户设备的SIM卡槽中的SIM卡进行验证的一种实现方式可以为:确定所述SIM卡的PIN码错误输入次数大于预设次数,所述预设次数大于等于0。这是因为现有的SIM卡的PIN码的错误输入次数达到一定次数后,SIM卡就会被锁死,无法再使用PIN码解密SIM卡,只能采用PUK码解密SIM卡。The method for determining that the SIM card in the SIM card slot of the user equipment is not required to be verified by using the PUK code may be: determining that the PIN code error input number of the SIM card is greater than a preset number of times, the preset number of times Greater than or equal to 0. This is because after the PIN code of the existing SIM card is input a certain number of times, the SIM card is locked, and the SIM card can no longer be decrypted by using the PIN code, and the SIM card can only be decrypted by using the PUK code.
通过本方式,进一步完善了对被用户设备锁定的SIM卡进行解锁的方案,进一步提高了用户设备解锁的SIM卡的安全性。In this manner, the solution for unlocking the SIM card locked by the user equipment is further improved, and the security of the SIM card unlocked by the user equipment is further improved.
基于同一发明构思,本发明实施例还提供一种关闭SIM卡的验证功能的方法。参照图3,该方法包括:Based on the same inventive concept, an embodiment of the present invention further provides a method for turning off the verification function of the SIM card. Referring to Figure 3, the method includes:
步骤301:接收关闭SIM卡的验证功能的指令;Step 301: Receive an instruction to close the verification function of the SIM card.
步骤302:根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;Step 302: Generate, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card;
步骤303:若密码正确,则从所述用户设备的存储单元中获取加密后的验 证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;Step 303: If the password is correct, obtain the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code and an attribute parameter of the locked SIM card.
步骤304:对所述加密后的验证参数进行解密处理,获得所述验证参数;Step 304: Perform decryption processing on the encrypted verification parameter to obtain the verification parameter.
步骤305:采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,关闭所述SIM卡的PIN码验证功能。Step 305: Verify the SIM card on the user equipment by using the verification parameter; when determining that the verification is passed, turn off the PIN code verification function of the SIM card.
其中,步骤301中关闭SIM卡的验证功能的指令可以是用户输入的指令,也可以用户设备上的应用程序触发用户设备生成的指令,本发明实施例不做具体限制。比如,在用户设备的设置界面上点击关闭SIM卡的验证功能的菜单,The instruction to disable the verification function of the SIM card in step 301 may be an instruction input by the user, or an application generated by the user equipment may be triggered by the application on the user equipment, which is not specifically limited in the embodiment of the present invention. For example, on the setting interface of the user device, click to close the menu of the verification function of the SIM card.
其中,步骤303至步骤305中的获取加密后的验证参数、解密验证参数、采用验证参数验证SIM卡等操作步骤的具体实现方式可以参照本发明实施例中上述解锁SIM的方法中的步骤202至步骤203的实现方式,此处不再进行赘述。The specific implementation manners of the steps of obtaining the encrypted verification parameter, the decryption verification parameter, and the verification parameter verification SIM card in steps 303 to 305 may refer to step 202 in the method for unlocking the SIM in the embodiment of the present invention. The implementation of step 203 is not described here.
在上述方案中,可以关闭SIM卡的验证功能,以使得该SIM卡可以被其他用户设备使用,提高了用户体验。In the above solution, the verification function of the SIM card can be turned off, so that the SIM card can be used by other user equipments, which improves the user experience.
在具体实施过程中,本领域的技术人员可以对本发明实施例提供上述各种技术方案进行组合、改动和变型,生成多种对SIM卡进行锁定、解锁以及关闭SIM卡验证功能的技术方案,接下来列举本发明实施例列的几种可能实现的方案。In the specific implementation process, those skilled in the art can provide combinations, modifications, and variations of the foregoing various technical solutions to the embodiments of the present invention, and generate various technical solutions for locking, unlocking, and closing the SIM card verification function of the SIM card. Several possible implementations of the embodiments of the present invention are listed below.
方案一:Option One:
1)对SIM卡进行锁定:1) Lock the SIM card:
为用户设备上的SIM卡配置一个随机PIN码,以替换所述SIM卡的原PIN码;Configuring a SIM card for the SIM card on the user equipment to replace the original PIN code of the SIM card;
采用Base64加密算法对所述随机PIN码进行加密处理;Encrypting the random PIN code by using a Base64 encryption algorithm;
将加密后的随机PIN码存储在所述用户设备的存储单元中。The encrypted random PIN code is stored in a storage unit of the user equipment.
2)对SIM卡进行解锁:2) Unlock the SIM card:
当用户设备检测到用户设备的SIM卡槽有SIM卡插入时,确定用户设备需要解锁SIM卡;When the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, it is determined that the user equipment needs to unlock the SIM card;
从所述用户设备的存储单元中获取所述加密后的随机PIN码;Obtaining the encrypted random PIN code from a storage unit of the user equipment;
对所述加密后的随机PIN码进行解密处理,获得所述随机PIN码;Decrypting the encrypted random PIN code to obtain the random PIN code;
验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致;如果不一致,则解锁失败;如果一致,则解锁成功。Verifying that the random PIN code is consistent with the PIN code of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, the unlocking is successful.
3)关闭SIM卡的验证功能:3) Turn off the SIM card verification function:
接收关闭SIM卡的验证功能的指令;Receiving an instruction to turn off the verification function of the SIM card;
根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;Generating, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card;
若密码正确,从所述用户设备的存储单元中获取所述加密后的随机PIN码;If the password is correct, the encrypted random PIN code is obtained from a storage unit of the user equipment;
对所述加密后的随机PIN码进行解密处理,获得所述随机PIN码;Decrypting the encrypted random PIN code to obtain the random PIN code;
验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致;如果不一致,则关闭失败;如果一致,则关闭成功。Verifying that the random PIN code is consistent with the PIN code of the SIM card on the user equipment; if not, the shutdown fails; if they are consistent, the shutdown is successful.
上述方案一,用户设备为SIM卡生成随机PIN码并替换SIM卡的原PIN码,采用Base64加密算法对随机PIN码加密后再保存;用户设备验证SIM卡时需要将加密后的PIN码解密后才能使用,而未保存有随机PIN码以及未知晓随机PIN码的加密方式的非法用户设备无法对SIM卡解密。本方案相对于现有技术,PIN码的保密性更高,用户设备对SIM卡的锁定更加安全。In the first solution, the user equipment generates a random PIN code for the SIM card and replaces the original PIN code of the SIM card, and then encrypts the random PIN code by using the Base64 encryption algorithm; and the user equipment needs to decrypt the encrypted PIN code after verifying the SIM card. An illegal user device that cannot be used but does not have a random PIN code and an encryption method that does not know the random PIN code cannot decrypt the SIM card. Compared with the prior art, the PIN code has higher confidentiality, and the user equipment locks the SIM card more securely.
方案二:Option II:
1)对SIM卡进行锁定:1) Lock the SIM card:
获取用户设备上的SIM卡的ICCID,并为用户设备上的SIM卡配置一个随机PIN码,以替换所述SIM卡的原PIN码;Obtaining an ICCID of the SIM card on the user equipment, and configuring a SIM card with a random PIN code on the user equipment to replace the original PIN code of the SIM card;
采用Base64加密算法对所述ICCID、所述随机PIN码进行加密处理;Encrypting the ICCID and the random PIN code by using a Base64 encryption algorithm;
将加密后的ICCID、加密后的随机PIN码存储在所述用户设备的存储单元中。The encrypted ICCID and the encrypted random PIN code are stored in a storage unit of the user equipment.
2)对SIM卡进行解锁:2) Unlock the SIM card:
当用户设备检测到用户设备的SIM卡槽有SIM卡插入时,确定用户设备需要解锁SIM卡;When the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, it is determined that the user equipment needs to unlock the SIM card;
从所述用户设备的存储单元中获取所述加密后的ICCID、所述加密后的随机PIN码;Obtaining the encrypted ICCID and the encrypted random PIN code from a storage unit of the user equipment;
分别对所述加密后的ICCID、所述加密后的随机PIN码进行解密处理,获得所述ICCID、所述随机PIN码;Decrypting the encrypted ICCID and the encrypted random PIN code respectively to obtain the ICCID and the random PIN code;
验证从存储单元中获取的随机PIN码与所述用户设备上的SIM卡的PIN码是否一致;如果不一致,则解锁失败;如果一致,则进一步执行步骤225;Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, step 225 is further performed;
验证从存储单元中获取的ICCID与所述用户设备上的SIM卡的ICCID是否一致;如果不一致,则解锁失败;如果一致,则确定解锁成功。Verify that the ICCID obtained from the storage unit is consistent with the ICCID of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, it is determined that the unlocking is successful.
3)关闭SIM卡的验证功能:3) Turn off the SIM card verification function:
接收关闭SIM卡的验证功能的指令;Receiving an instruction to turn off the verification function of the SIM card;
根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;Generating, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card;
若密码正确,从所述用户设备的存储单元中获取所述加密后的ICCID、所述加密后的随机PIN码;Obtaining the encrypted ICCID and the encrypted random PIN code from a storage unit of the user equipment if the password is correct;
分别对所述加密后的ICCID、所述加密后的随机PIN码进行解密处理,获得所述ICCID、所述随机PIN码;Decrypting the encrypted ICCID and the encrypted random PIN code respectively to obtain the ICCID and the random PIN code;
验证从存储单元中获取的随机PIN码与所述用户设备上的SIM卡的PIN码是否一致;如果不一致,则关闭败;如果一致,则进一步执行步骤235;Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, it is closed; if yes, step 235 is further performed;
验证从存储单元中获取的ICCID与所述用户设备上的SIM卡的ICCID是否一致;如果不一致,则关闭失败;如果一致,则关闭成功。Verify that the ICCID obtained from the storage unit is consistent with the ICCID of the SIM card on the user equipment; if not, the shutdown fails; if they are consistent, the shutdown is successful.
方案二在方案一的基础上,进一步增加了ICCID的验证程序,即用户设备在采用随机PIN码对SIM卡验证成功后还需要确定用户设备保存的ICCID和被验证的SIM卡的ICCID一致,进一步提高了用户设备对SIM卡锁定的安全性。On the basis of the first scheme, the scheme 2 further increases the verification procedure of the ICCID, that is, after the user equipment successfully verifies the SIM card by using the random PIN code, it is also required to determine that the ICCID saved by the user equipment is consistent with the ICCID of the verified SIM card, and further The security of the user equipment to lock the SIM card is improved.
方案三:third solution:
1)对SIM卡进行锁定:1) Lock the SIM card:
获取用户设备上的SIM卡的ICCID,并为用户设备上的SIM卡配置一个随机PIN码,以替换所述SIM卡的原PIN码;Obtaining an ICCID of the SIM card on the user equipment, and configuring a SIM card with a random PIN code on the user equipment to replace the original PIN code of the SIM card;
将所述ICCID、所述随机PIN码拼接成一个字符串;Splicing the ICCID and the random PIN code into a string;
采用Base64加密算法对所述字符串进行加密处理;Encrypting the character string by using a Base64 encryption algorithm;
将加密后的字符串存储在所述用户设备的存储单元中。The encrypted string is stored in a storage unit of the user device.
2)对SIM卡进行解锁:2) Unlock the SIM card:
当用户设备检测到用户设备的SIM卡槽有SIM卡插入时,确定用户设备需要解锁SIM卡;When the user equipment detects that the SIM card slot of the user equipment has a SIM card inserted, it is determined that the user equipment needs to unlock the SIM card;
从所述用户设备的存储单元中获取所述加密后的字符串;Obtaining the encrypted character string from a storage unit of the user equipment;
对所述加密后的字符串进行解密处理,获得所述ICCID、所述随机PIN码;Decrypting the encrypted character string to obtain the ICCID and the random PIN code;
验证从存储单元中获取的随机PIN码与所述用户设备上的SIM卡的PIN码是否一致;如果不一致,则解锁失败;如果一致,则进一步执行步骤325;Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, step 325 is further performed;
验证从存储单元中获取的ICCID与所述用户设备上的SIM卡的ICCID是否一致;如果不一致,则解锁失败;如果一致,则确定解锁成功。Verify that the ICCID obtained from the storage unit is consistent with the ICCID of the SIM card on the user equipment; if not, the unlocking fails; if they are consistent, it is determined that the unlocking is successful.
3)关闭SIM卡的验证功能:3) Turn off the SIM card verification function:
接收关闭SIM卡的验证功能的指令;Receiving an instruction to turn off the verification function of the SIM card;
根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;Generating, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card;
若密码正确,从所述用户设备的存储单元中获取所述加密后的字符串;If the password is correct, the encrypted character string is obtained from a storage unit of the user equipment;
对所述加密后的字符串进行解密处理,获得所述ICCID、所述随机PIN码;Decrypting the encrypted character string to obtain the ICCID and the random PIN code;
验证从存储单元中获取的随机PIN码与所述用户设备上的SIM卡的PIN码是否一致;如果不一致,则关闭失败;如果一致,则进一步执行步骤335;Verifying that the random PIN code obtained from the storage unit is consistent with the PIN code of the SIM card on the user equipment; if not, the shutdown fails; if they are consistent, step 335 is further performed;
验证从存储单元中获取的ICCID与所述用户设备上的SIM卡的ICCID是否一致;如果不一致,则关闭失败;如果一致,则关闭成功。Verify that the ICCID obtained from the storage unit is consistent with the ICCID of the SIM card on the user equipment; if not, the shutdown fails; if they are consistent, the shutdown is successful.
方案三在方案一的基础上,不只在验证参数中增加了ICCID参数,还将ICCID与随机PIN码拼接成一个字符串进行加密,增加了验证参数的复杂度,进一步提高了PIN码的保密性,提高了用户设备对SIM卡锁定的安全性。On the basis of the first scheme, scheme 3 not only adds the ICCID parameter to the verification parameters, but also splices the ICCID and the random PIN code into a string for encryption, which increases the complexity of the verification parameters and further improves the confidentiality of the PIN code. The security of the user equipment to lock the SIM card is improved.
基于同一发明构思,参照图4,本发明实施例还提供一种锁定SIM卡的 装置,包括:Based on the same inventive concept, with reference to FIG. 4, an embodiment of the present invention further provides an apparatus for locking a SIM card, including:
接收单元401,用于接收对所述用户设备上SIM卡进行锁定的指令;The receiving unit 401 is configured to receive an instruction to lock the SIM card on the user equipment;
处理单元402,用于为所述SIM卡生成一个随机PIN码,并采用所述随机PIN码更新所述SIM卡的原PIN码;对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,所述验证参数包括所述随机PIN码、所述SIM卡的属性参数;The processing unit 402 is configured to generate a random PIN code for the SIM card, and update the original PIN code of the SIM card by using the random PIN code; encrypt the verification parameter of the SIM card, and generate an encrypted Verifying parameters, the verification parameters including the random PIN code, attribute parameters of the SIM card;
存储单元403,用于将所述加密后的验证参数存储在所述用户设备的存储单元403中。The storage unit 403 is configured to store the encrypted verification parameter in the storage unit 403 of the user equipment.
可选的,所述SIM卡的属性参数包括ICCID、IMEI、MSI、MAC地址、SN中的至少一项。Optionally, the attribute parameter of the SIM card includes at least one of an ICCID, an IMEI, an MSI, a MAC address, and an SN.
可选的,所述处理单元402用于:将所述随机PIN码、所述ICCID拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为所述加密后的验证参数。Optionally, the processing unit 402 is configured to: concatenate the random PIN code and the ICCID into a character string, perform encryption processing on the character string, generate an encrypted character string, and perform the encrypted A string is used as the encrypted verification parameter.
可选的,所述处理单元402用于:分别对所述随机PIN码、所述属性参数进行加密处理,生成加密后的验证参数,所述加密后的验证参数包括加密后的随机PIN码、加密后的属性参数。Optionally, the processing unit 402 is configured to: perform encryption processing on the random PIN code and the attribute parameter, respectively, to generate an encrypted verification parameter, where the encrypted verification parameter includes an encrypted random PIN code, Encrypted attribute parameters.
基于同一发明构思,参照图5,本发明实施例还提供一种解锁SIM卡的装置,包括:Based on the same inventive concept, with reference to FIG. 5, an embodiment of the present invention further provides an apparatus for unlocking a SIM card, including:
接收单元501,用于接收解除对所述用户设备上的SIM卡的锁定的指令;The receiving unit 501 is configured to receive an instruction to release the locking of the SIM card on the user equipment;
处理单元502,用于从所述用户设备的存储单元403中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,解除对所述SIM卡的锁定,以使所述用户设备可使用所述SIM卡所提供的服务。The processing unit 502 is configured to obtain the encrypted verification parameter from the storage unit 403 of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and decryption of the encrypted verification parameter. Obtaining the verification parameter, verifying the SIM card on the user equipment by using the verification parameter, and releasing the locking of the SIM card when determining that the verification is passed, so that the user equipment can use the SIM card service provided.
可选的,所述处理单元502用于:验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致,以及验证所述锁定SIM卡的ICCID与所述用户设备上的SIM卡的ICCID是否一致。Optionally, the processing unit 502 is configured to: verify whether the random PIN code is consistent with a PIN code of a SIM card on the user equipment, and verify an ICCID of the locked SIM card and a SIM on the user equipment. Whether the card's ICCID is consistent.
基于同一发明构思,参照图6,本发明实施例还提供一种关闭SIM卡的验证功能的装置,包括:Based on the same inventive concept, with reference to FIG. 6, an embodiment of the present invention further provides an apparatus for turning off a verification function of a SIM card, including:
接收单元601,用于接收关闭SIM卡的验证功能的指令;The receiving unit 601 is configured to receive an instruction to close the verification function of the SIM card;
处理单元602,用于根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;若密码正确,则从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,关闭所述SIM卡的PIN码验证功能。The processing unit 602 is configured to generate, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card; if the password is correct, obtain the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; verifying the SIM card on the user equipment by using the verification parameter; Turn off the PIN code verification function of the SIM card.
基于同一发明构思,参照图7,本发明实施例还提供一种电子设备,包括:至少一个处理器701,以及与所述至少一个处理器701通信连接的存储器702;其中,所述存储器702存储有可被所述至少一个处理器701执行的指令,所述至少一个处理器701通过执行所述存储器702存储的指令实现如本发明实施例上述方法。Based on the same inventive concept, with reference to FIG. 7, an embodiment of the present invention further provides an electronic device, including: at least one processor 701, and a memory 702 communicably connected to the at least one processor 701; wherein the memory 702 is stored There are instructions executable by the at least one processor 701, and the at least one processor 701 implements the above method in accordance with an embodiment of the present invention by executing instructions stored by the memory 702.
基于同一发明构思,本发明实施例还提供一种一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行如本发明实施例上述方法。Based on the same inventive concept, an embodiment of the present invention further provides a computer readable storage medium, wherein the computer readable storage medium stores computer instructions, when the computer instructions are run on a computer, causing the computer The above method as in the embodiment of the present invention is performed.
本发明实施例中提供的一个或多个技术方案,至少具有如下技术效果或优点:One or more technical solutions provided in the embodiments of the present invention have at least the following technical effects or advantages:
1、用户设备为SIM卡生成一随机PIN码替换SIM卡的原PIN码,并将生成的随机PIN码、SIM卡的属性参数加密后存储在所述用户设备中,提高了SIM卡PIN码的保密性,增加了非法用户设备破译SIM卡的难度,进而提高了用户设备对SIM卡进行锁定的安全性。1. The user equipment generates a random PIN code for the SIM card to replace the original PIN code of the SIM card, and encrypts the generated random PIN code and the attribute parameters of the SIM card, and stores the attribute parameters in the user equipment, thereby improving the SIM card PIN code. The confidentiality increases the difficulty of the illegal user device to decipher the SIM card, thereby improving the security of the user device locking the SIM card.
2、用户设备除了保存被用户设备锁定的SIM卡的随机PIN码,还保存有被用户设备锁定的SIM卡的ICCID;在验证SIM卡时需要PIN码验证和ICCID验证全部通过后,用户设备才可使用SIM卡进行上网通话,进一步提高用户设备对SIM卡进行锁定的安全性。2. The user equipment saves the ICCID of the SIM card locked by the user equipment in addition to the random PIN code of the SIM card locked by the user equipment; the user equipment only needs to pass the PIN code verification and the ICCID verification when verifying the SIM card. The SIM card can be used for online calls, which further improves the security of the user device locking the SIM card.
3、可以关闭SIM卡的验证功能,以使得该SIM卡可以被其他用户设备使用,提高了用户体验。3. The SIM card verification function can be turned off, so that the SIM card can be used by other user equipments, which improves the user experience.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It is apparent that those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. Thus, it is intended that the present invention cover the modifications and modifications of the invention

Claims (14)

  1. 一种锁定用户身份识别卡SIM卡的方法,其特征在于,应用于用户设备,所述方法包括:A method for locking a SIM card of a user identity card is characterized in that it is applied to a user equipment, and the method includes:
    接收对所述用户设备上SIM卡进行锁定的指令;Receiving an instruction to lock a SIM card on the user equipment;
    为所述SIM卡生成一个随机PIN码,并采用所述随机PIN码更新所述SIM卡的原PIN码;Generating a random PIN code for the SIM card, and updating the original PIN code of the SIM card by using the random PIN code;
    对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,所述验证参数包括所述随机PIN码、所述SIM卡的属性参数;Performing an encryption process on the verification parameter of the SIM card to generate an encrypted verification parameter, where the verification parameter includes the random PIN code and an attribute parameter of the SIM card;
    将所述加密后的验证参数存储在所述用户设备的存储单元中。The encrypted verification parameter is stored in a storage unit of the user equipment.
  2. 如权利要求1所述的方法,其特征在于,所述SIM卡的属性参数包括集成电路卡识别码ICCID、国际移动设备身份码IMEI、国际移动用户识别码MSI、媒体访问控制MAC地址、产品序列号SN中的至少一项。The method according to claim 1, wherein the attribute parameters of the SIM card comprise an integrated circuit card identification code ICCID, an international mobile device identity code IMEI, an international mobile subscriber identity (MSI), a media access control MAC address, and a product sequence. At least one of the number SN.
  3. 如权利要求1或2所述的方法,其特征在于,当所述验证参数为所述随机PIN码和所述ICCID时,所述对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,包括:The method according to claim 1 or 2, wherein when the verification parameter is the random PIN code and the ICCID, the verification parameter of the SIM card is encrypted to generate an encrypted Verify parameters, including:
    将所述随机PIN码、所述ICCID拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为所述加密后的验证参数。The random PIN code and the ICCID are concatenated into a character string, and the character string is encrypted, and the encrypted character string is generated, and the encrypted character string is used as the encrypted verification parameter.
  4. 如权利要求1或2所述的方法,其特征在于,所述对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,包括:The method according to claim 1 or 2, wherein the encrypting the verification parameters of the SIM card to generate the encrypted verification parameters comprises:
    分别对所述随机PIN码、所述属性参数进行加密处理,生成加密后的验证参数,所述加密后的验证参数包括加密后的随机PIN码、加密后的属性参数。The random PIN code and the attribute parameter are respectively encrypted to generate an encrypted verification parameter, and the encrypted verification parameter includes an encrypted random PIN code and an encrypted attribute parameter.
  5. 一种解锁SIM卡的方法,其特征在于,应用于用户设备,所述方法包括:A method for unlocking a SIM card, which is applied to a user equipment, the method comprising:
    接收解除对所述用户设备上的SIM卡的锁定的指令;Receiving an instruction to release the lock on the SIM card on the user equipment;
    从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;Acquiring the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code and an attribute parameter of the locked SIM card;
    对所述加密后的验证参数进行解密处理,获得所述验证参数;Decrypting the encrypted verification parameter to obtain the verification parameter;
    采用所述验证参数验证所述用户设备上的SIM卡;Verifying the SIM card on the user equipment by using the verification parameter;
    在确定验证通过时,解除对所述SIM卡的锁定,以使所述用户设备可使用所述SIM卡所提供的服务。Upon determining that the verification is passed, the lock on the SIM card is released such that the user device can use the service provided by the SIM card.
  6. 如权利要求5所述的方法,其特征在于,当所述验证参数为所述随机PIN码、锁定SIM卡的ICCID时;The method according to claim 5, wherein when said verification parameter is said random PIN code, locking an ICCID of a SIM card;
    所述采用所述验证参数验证所述用户设备上的SIM卡,包括:The verifying the SIM card on the user equipment by using the verification parameter includes:
    验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致,以及验证所述锁定SIM卡的ICCID与所述用户设备上的SIM卡的ICCID是否一致。Verifying whether the random PIN code is consistent with the PIN code of the SIM card on the user equipment, and verifying whether the ICCID of the locked SIM card is consistent with the ICCID of the SIM card on the user equipment.
  7. 一种关闭SIM卡的验证功能的方法,其特征在于,应用于用户设备,所述方法包括:A method for turning off a verification function of a SIM card, which is characterized in that it is applied to a user equipment, and the method includes:
    接收关闭SIM卡的验证功能的指令;Receiving an instruction to turn off the verification function of the SIM card;
    根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;Generating, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card;
    若密码正确,则从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;If the password is correct, the encrypted verification parameter is obtained from the storage unit of the user equipment, where the verification parameter includes a random PIN code and an attribute parameter of the locked SIM card;
    对所述加密后的验证参数进行解密处理,获得所述验证参数;Decrypting the encrypted verification parameter to obtain the verification parameter;
    采用所述验证参数验证所述用户设备上的SIM卡;Verifying the SIM card on the user equipment by using the verification parameter;
    在确定验证通过时,关闭所述SIM卡的PIN码验证功能。When it is determined that the verification is passed, the PIN code verification function of the SIM card is turned off.
  8. 一种锁定SIM卡的装置,其特征在于,包括:A device for locking a SIM card, comprising:
    接收单元,用于接收对所述用户设备上SIM卡进行锁定的指令;a receiving unit, configured to receive an instruction to lock a SIM card on the user equipment;
    处理单元,用于为所述SIM卡生成一个随机PIN码,并采用所述随机PIN码更新所述SIM卡的原PIN码;对所述SIM卡的验证参数进行加密处理,生成加密后的验证参数,所述验证参数包括所述随机PIN码、所述SIM卡的属性参数;a processing unit, configured to generate a random PIN code for the SIM card, and update the original PIN code of the SIM card by using the random PIN code; encrypt the verification parameter of the SIM card to generate an encrypted verification a parameter, the verification parameter including the random PIN code, an attribute parameter of the SIM card;
    存储单元,用于将所述加密后的验证参数存储在所述用户设备的存储单元中。And a storage unit, configured to store the encrypted verification parameter in a storage unit of the user equipment.
  9. 如权利要求8所述的装置,其特征在于,所述SIM卡的属性参数包括ICCID、IMEI、MSI、MAC地址、SN中的至少一项。The apparatus according to claim 8, wherein the attribute parameter of the SIM card comprises at least one of an ICCID, an IMEI, an MSI, a MAC address, and an SN.
  10. 如权利要求8或9所述的装置,其特征在于,所述处理单元用于:The device according to claim 8 or 9, wherein the processing unit is configured to:
    将所述随机PIN码、所述ICCID拼接成一个字符串,对所述字符串进行加密处理,生成加密后的字符串,将所述加密后的字符串作为所述加密后的验证参数。The random PIN code and the ICCID are concatenated into a character string, and the character string is encrypted, and the encrypted character string is generated, and the encrypted character string is used as the encrypted verification parameter.
  11. 如权利要求8或9所述的装置,其特征在于,所述处理单元用于:The device according to claim 8 or 9, wherein the processing unit is configured to:
    分别对所述随机PIN码、所述属性参数进行加密处理,生成加密后的验证参数,所述加密后的验证参数包括加密后的随机PIN码、加密后的属性参数。The random PIN code and the attribute parameter are respectively encrypted to generate an encrypted verification parameter, and the encrypted verification parameter includes an encrypted random PIN code and an encrypted attribute parameter.
  12. 一种解锁SIM卡的装置,其特征在于,包括:An apparatus for unlocking a SIM card, comprising:
    接收单元,用于接收解除对所述用户设备上的SIM卡的锁定的指令;a receiving unit, configured to receive an instruction to release the locking of the SIM card on the user equipment;
    处理单元,用于从所述用户设备的存储单元中获取加密后的验证参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,解除对所述SIM卡的锁定,以使所述用户设备可使用所述SIM卡所提供的服务。a processing unit, configured to obtain an encrypted verification parameter from a storage unit of the user equipment, where the verification parameter includes a random PIN code, an attribute parameter of the locked SIM card, and decrypting the encrypted verification parameter to obtain The verification parameter is used to verify the SIM card on the user equipment by using the verification parameter; when it is determined that the verification is passed, the locking of the SIM card is released, so that the user equipment can use the SIM card to provide service.
  13. 如权利要求12所述的装置,其特征在于,所述处理单元用于:The apparatus of claim 12 wherein said processing unit is operative to:
    验证所述随机PIN码与所述用户设备上的SIM卡的PIN码是否一致,以及验证所述锁定SIM卡的ICCID与所述用户设备上的SIM卡的ICCID是否一致。Verifying whether the random PIN code is consistent with the PIN code of the SIM card on the user equipment, and verifying whether the ICCID of the locked SIM card is consistent with the ICCID of the SIM card on the user equipment.
  14. 一种关闭SIM卡的验证功能的装置,其特征在于,包括:An apparatus for turning off a verification function of a SIM card, comprising:
    接收单元,用于接收关闭SIM卡的验证功能的指令;a receiving unit, configured to receive an instruction to close the verification function of the SIM card;
    处理单元,用于根据所述指令生成用户输入关闭SIM卡的验证功能的密码的提示;若密码正确,则从所述用户设备的存储单元中获取加密后的验证 参数,所述验证参数包括随机PIN码、锁定SIM卡的属性参数;对所述加密后的验证参数进行解密处理,获得所述验证参数;采用所述验证参数验证所述用户设备上的SIM卡;在确定验证通过时,关闭所述SIM卡的PIN码验证功能。a processing unit, configured to generate, according to the instruction, a prompt for the user to input a password for closing the verification function of the SIM card; if the password is correct, obtain the encrypted verification parameter from the storage unit of the user equipment, where the verification parameter includes a random PIN code, locking attribute parameters of the SIM card; decrypting the encrypted verification parameter to obtain the verification parameter; verifying the SIM card on the user equipment by using the verification parameter; and closing when determining that the verification is passed The PIN code verification function of the SIM card.
PCT/CN2018/095194 2017-12-08 2018-07-10 Method and device for locking sim card WO2019109640A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711297770.7A CN108156601A (en) 2017-12-08 2017-12-08 A kind of method and device of locking SIM card
CN201711297770.7 2017-12-08

Publications (1)

Publication Number Publication Date
WO2019109640A1 true WO2019109640A1 (en) 2019-06-13

Family

ID=62466842

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/095194 WO2019109640A1 (en) 2017-12-08 2018-07-10 Method and device for locking sim card

Country Status (2)

Country Link
CN (1) CN108156601A (en)
WO (1) WO2019109640A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113038451A (en) * 2021-02-26 2021-06-25 西安广和通无线软件有限公司 Machine-card binding method and device, communication module and storage medium
CN114788321A (en) * 2019-12-09 2022-07-22 高通股份有限公司 Universal Integrated Circuit Card (UICC) activation
EP3909278A4 (en) * 2019-01-07 2022-08-10 Citrix Systems, Inc. Subscriber identity management

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108156601A (en) * 2017-12-08 2018-06-12 京信通信系统(中国)有限公司 A kind of method and device of locking SIM card
CN108901014A (en) * 2018-06-28 2018-11-27 深圳高新兴物联科技有限公司 A kind of SIM card locking means, device, terminal and computer readable storage medium
CN115623486A (en) * 2021-07-15 2023-01-17 华为技术有限公司 Method and device for processing Personal Identification Number (PIN) code

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102574A (en) * 2007-08-14 2008-01-09 华为技术有限公司 Terminal verification method and device
CN102694920A (en) * 2012-05-28 2012-09-26 广东欧珀移动通信有限公司 Mobile phone antitheft method
CN103167097A (en) * 2011-12-15 2013-06-19 富泰华工业(深圳)有限公司 Mobile phone with confidentiality function and confidentiality method thereof
CN103686706A (en) * 2012-09-14 2014-03-26 中兴通讯股份有限公司 User network information processing method and data card
US20160164673A1 (en) * 2013-06-28 2016-06-09 Orange Method for changing an authentication key
CN108156601A (en) * 2017-12-08 2018-06-12 京信通信系统(中国)有限公司 A kind of method and device of locking SIM card

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100735445B1 (en) * 2004-10-06 2007-07-04 삼성전자주식회사 Method for managing an individual identify information card of subcriber identify module inserted mobile phone
CN101437067B (en) * 2008-12-05 2012-05-09 中兴通讯股份有限公司 Mobile terminal and method for implementing network and card locking
CN105101178A (en) * 2015-06-25 2015-11-25 集怡嘉数码科技(深圳)有限公司 Business process method, device and system
CN105335634A (en) * 2015-10-14 2016-02-17 上海斐讯数据通信技术有限公司 User ID card safety management method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102574A (en) * 2007-08-14 2008-01-09 华为技术有限公司 Terminal verification method and device
CN103167097A (en) * 2011-12-15 2013-06-19 富泰华工业(深圳)有限公司 Mobile phone with confidentiality function and confidentiality method thereof
CN102694920A (en) * 2012-05-28 2012-09-26 广东欧珀移动通信有限公司 Mobile phone antitheft method
CN103686706A (en) * 2012-09-14 2014-03-26 中兴通讯股份有限公司 User network information processing method and data card
US20160164673A1 (en) * 2013-06-28 2016-06-09 Orange Method for changing an authentication key
CN108156601A (en) * 2017-12-08 2018-06-12 京信通信系统(中国)有限公司 A kind of method and device of locking SIM card

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3909278A4 (en) * 2019-01-07 2022-08-10 Citrix Systems, Inc. Subscriber identity management
CN114788321A (en) * 2019-12-09 2022-07-22 高通股份有限公司 Universal Integrated Circuit Card (UICC) activation
CN113038451A (en) * 2021-02-26 2021-06-25 西安广和通无线软件有限公司 Machine-card binding method and device, communication module and storage medium

Also Published As

Publication number Publication date
CN108156601A (en) 2018-06-12

Similar Documents

Publication Publication Date Title
WO2019109640A1 (en) Method and device for locking sim card
US9788209B2 (en) Apparatus and methods for controlling distribution of electronic access clients
KR102369847B1 (en) Subscriber identification module pooling
EP2905715B1 (en) Method, system and terminal for encrypting/decrypting application program on communication terminal
EP3099090B1 (en) Network locking or card locking method and device for a mobile terminal, terminal, sim card, storage media
EP2630816B1 (en) Authentication of access terminal identities in roaming networks
JP4263384B2 (en) Improved method for authentication of user subscription identification module
US8375454B2 (en) Method for locking an application program
KR102173534B1 (en) Methods for providing information of mobile network operator and apparatus for performing the same
US9686399B2 (en) Protection of a wireless communications device against unauthorized use
US20080003980A1 (en) Subsidy-controlled handset device via a sim card using asymmetric verification and method thereof
CN101641976A (en) An authentication method
JP2013529019A (en) Wireless network authentication device and method
WO2010075650A1 (en) Solutions for identifying legal user equipments in a communication network
EP3723400A1 (en) Method for unlocking sim card and mobile terminal
CN107733652B (en) Unlocking method and system for shared vehicle and vehicle lock
US7913096B2 (en) Method and system for the cipher key controlled exploitation of data resources, related network and computer program products
US20210256102A1 (en) Remote biometric identification
WO2013182103A2 (en) Encryption and decryption terminal and encryption and decryption method applied to same
WO2011130970A1 (en) Device and method for protecting data of mobile terminal
KR101358375B1 (en) Prevention security system and method for smishing
EP2985712B1 (en) Application encryption processing method, apparatus, and terminal
KR101482321B1 (en) Method for Substituting Password of Certificate by using Biometrics
US20060121882A1 (en) Desktop cellular phone having a SIM card with an encrypted SIM PIN
Vahidian Evolution of the SIM to eSIM

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: 18885755

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 14.10.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18885755

Country of ref document: EP

Kind code of ref document: A1