Invention content
The embodiment of the present invention provides a kind of method and device of locking SIM card, for solving prior art lock SIM card
The technical issues of method security is low.
First aspect of the embodiment of the present invention provides a kind of method of locking SIM card, applied to user equipment, the method packet
It includes:
It receives to SIM card on the user equipment into line-locked instruction;
A random PIN is generated for the SIM card, and the former PIN of the SIM cards is updated using the random PIN
Code;
The certificate parameter of the SIM card is encrypted, generates encrypted certificate parameter, the certificate parameter packet
Include the random PIN, the SIM card property parameters;
The encrypted certificate parameter is stored in the storage unit of the user equipment.
In said program, user equipment generates the former PIN codes of random PIN replacement SIM card for SIM card, and will be raw
Into random PIN, the SIM card property parameters carry out and encryption after be stored in the user equipment, improve SIM card
The confidentiality of PIN code, increase illegitimate user equipment decode SIM cards difficulty, and then improve user equipment to SIM card into
Line-locked safety.
Optionally, the property parameters of the SIM card include integrated circuit card identification code (Integrate circuit card
Identity, ICCID), International Mobile Equipment Identity code (International Mobile Equipment Identity,
IMEI), international mobile subscriber identity (International Mobile Subscriber Identification
Number, IMSI), media access control (Medium Access Control, MAC) address, product ID (Serial
At least one of Number, SN) in.
By the method, it can further increase the complexity of certificate parameter, further improve user equipment to SIM card
Into line-locked safety.
Optionally, it is described that the SIM card is tested when the certificate parameter is the random PIN and the ICCID
Card parameter is encrypted, and generates encrypted certificate parameter, including:The random PIN, the ICCID are spliced into
One character string, is encrypted the character string, generates encrypted character string, and the encrypted character string is made
For the encrypted certificate parameter.
By the method, the complexity of certificate parameter can be increased, the difficulty that random PIN is cracked is improved, into one
Step improves user equipment to SIM card into line-locked safety.
Optionally, the certificate parameter to the SIM card is encrypted, and generates encrypted certificate parameter, packet
It includes:The random PIN, the property parameters are encrypted respectively, generate encrypted certificate parameter, the encryption
Certificate parameter afterwards includes encrypted random PIN, encrypted property parameters.
By the method, the complexity of certificate parameter can be increased, the difficulty that random PIN is cracked is improved, into one
Step improves user equipment to SIM card into line-locked safety.
Second aspect of the embodiment of the present invention provides a kind of method for unlocking SIM card, applied to user equipment, the method packet
It includes:Receive the instruction for releasing the locking to the SIM card on the user equipment;It is obtained from the storage unit of the user equipment
Encrypted certificate parameter, the certificate parameter include the property parameters of random PIN, locking SIM card;To described encrypted
Certificate parameter is decrypted, and obtains the certificate parameter;SIM on the user equipment is verified using the certificate parameter
Card;When determining to be verified, the locking to the SIM card is released, so that the SIM card can be used to be carried for the user equipment
The service of confession.
By the method, in user, equipment receives the instruction for releasing the locking to the SIM card on the user equipment
When, SIM card is verified using certificate parameter, improves the safety that user equipment verifies SIM card.
Optionally, when the certificate parameter is the ICCID of the random PIN, locking SIM card;Described in the use
Certificate parameter verifies the SIM card on the user equipment, including:It verifies on the random PIN and the user equipment
Whether the PIN code of SIM card is consistent and verifies the ICCID of the locking SIM card and the SIM card on the user equipment
Whether ICCID is consistent.
By the method, the complexity of certificate parameter can be increased, the difficulty that random PIN is cracked is improved, into one
Step improves the safety that user equipment verifies SIM card.
The third aspect of the embodiment of the present invention provides a kind of method for the authentication function for closing SIM card, applied to user equipment,
The method includes:Receive the instruction for the authentication function for closing SIM card;User is generated according to described instruction and inputs closing SIM card
Authentication function password prompting;If password is correct, encrypted test is obtained from the storage unit of the user equipment
Parameter is demonstrate,proved, the certificate parameter includes the property parameters of random PIN, locking SIM card;To the encrypted certificate parameter into
Row decryption processing obtains the certificate parameter;SIM card on the user equipment is verified using the certificate parameter;It is determining
When being verified, the PIN code authentication function of the SIM card is closed.
By the method, the PIN code authentication function for closing user equipment can be realized, so that user can be according to using field
Scape is adjusted the state of user equipment and SIM card, improves user experience.
Fourth aspect of the embodiment of the present invention provides a kind of device of locking SIM card, including:Receiving unit, for reception pair
SIM card is into line-locked instruction on the user equipment;Processing unit, for generating a random PIN for the SIM cards,
And the former PIN code of the SIM card is updated using the random PIN;The certificate parameter of the SIM card is encrypted,
Generate encrypted certificate parameter, property parameters of the certificate parameter including the random PIN, the SIM card;Storage is single
Member, for the encrypted certificate parameter to be stored in the storage unit of the user equipment.
Optionally, the property parameters of the SIM card include at least one in ICCID, IMEI, MSI, MAC Address, SN.
Optionally, the processing unit is used for:The random PIN, the ICCID are spliced into a character string, it is right
The character string is encrypted, and generates encrypted character string, using the encrypted character string as the encryption after
Certificate parameter.
Optionally, the processing unit is used for:The random PIN, the property parameters are encrypted respectively,
Encrypted certificate parameter is generated, the encrypted certificate parameter includes encrypted random PIN, encrypted attribute
Parameter.
The 5th aspect of the embodiment of the present invention provides a kind of device for unlocking SIM card, including:Receiving unit solves for receiving
Except the instruction of the locking to the SIM card on the user equipment;Processing unit, for from the storage unit of the user equipment
Encrypted certificate parameter is obtained, the certificate parameter includes the property parameters of random PIN codes, locking SIM card;Add to described
Certificate parameter after close is decrypted, and obtains the certificate parameter;The user equipment is verified using the certificate parameter
On SIM card;When determining to be verified, release the locking to the SIM card so that the user equipment can be used it is described
The service that SIM card is provided.
Optionally, the processing unit is used for:Verify the random PIN and the SIM card on the user equipment
Whether PIN code consistent and whether the ICCID of the ICCID of the verification locking SIM card and the SIM card on the user equipment
Unanimously.
The 6th aspect of the embodiment of the present invention provides a kind of device for the authentication function for closing SIM card, including:Receiving unit,
For receiving the instruction for the authentication function for closing SIM card;Processing unit inputs closing for generating user according to described instruction
The prompting of the password of the authentication function of SIM card;If password is correct, after obtaining encryption from the storage unit of the user equipment
Certificate parameter, the certificate parameter include random PIN codes, locking SIM card property parameters;To the encrypted verification
Parameter is decrypted, and obtains the certificate parameter;SIM card on the user equipment is verified using the certificate parameter;
When determining to be verified, the PIN code authentication function of the SIM card is closed.
The 7th aspect of the embodiment of the present invention also provides a kind of electronic equipment, including:At least one processor and with it is described
The memory of at least one processor communication connection;Wherein, the memory, which is stored with, to be held by least one processor
Capable instruction, at least one processor realize such as the embodiment of the present invention first by performing the instruction that the memory stores
Aspect or second aspect or third aspect the method.
Eighth aspect of the embodiment of the present invention also provides a kind of computer readable storage medium, which is characterized in that the calculating
Machine readable storage medium storing program for executing is stored with computer instruction, when the computer instruction is run on computers so that computer is held
Row such as first aspect of the embodiment of the present invention or second aspect or third aspect the method.
Specific embodiment
Technical solution of the present invention is described in detail below by attached drawing and specific embodiment, it should be understood that the present invention
Specific features in embodiment and embodiment are to the detailed description of technical solution of the present invention rather than to the technology of the present invention
The restriction of scheme, in the absence of conflict, the technical characteristic in the embodiment of the present invention and embodiment can be combined with each other.
It is to be appreciated that in the description of the embodiment of the present invention, the vocabulary such as " first ", " second " are only used for distinguishing and retouch
The purpose stated, and it is not intended that instruction or imply relative importance, can not be interpreted as indicating or hint sequence.In the present invention
In the description of embodiment " multiple ", refer to two or more.
Term "and/or" in the embodiment of the present invention, a kind of only incidence relation for describing affiliated partner, expression can be with
There are three kinds of relationships, for example, A and/or B, can represent:Individualism A exists simultaneously A and B, these three feelings of individualism B
Condition.In addition, character "/" herein, it is a kind of relationship of "or" to typically represent forward-backward correlation object.
SIM card involved by the embodiment of the present invention, alternatively referred to as phonecard, smart card etc., actually one includes greatly
The intelligent cards of scale integrated circuit are mainly used to register the significant data and information of user, such as digital mobile phone client
Information, the telephone directory of encrypted key and user etc., for global system for mobile communications (Global System for
Mobile Communication, GSM) network client identity differentiated, and voice messaging when conversing client adds
It is close.
The present embodiments relate to user equipment, can refer to installation SIM card and pass through SIM card and be connected to movement
Communication network and the equipment for providing a user voice and/or data connectivity.User equipment can be through wireless access network (Radio
Access Network, RAN) it communicates with one or more core nets.User equipment can be mobile terminal, such as mobile electricity
Words (or being " honeycomb " phone) and the computer with mobile terminal, for example, it may be portable, pocket, hand-held, meter
Built in calculation machine or vehicle-mounted mobile device, they exchange language and/or data with wireless access network.
PIN code involved by the embodiment of the present invention is for protecting SIM card from the secret identification code of misuse, PIN code
Verification is to protect a kind of safety measure of SIM card.If enable the PIN code check functions of SIM card, then equipment during user
When after powering or having SIM card insertion, need to carry out PIN code verification to the SIM card on user equipment.If repeatedly input is wrong
Accidentally PIN code, then user equipment may require that input PIN code unlock code (PIN Unlocking Key, PUK) code.
The embodiment of the present invention provides a kind of method of locking SIM card, for solve in the prior art user equipment to SIM card
Into line-locked method security it is low the technical issues of.With reference to Fig. 1, the method mainly includes the following steps that:
Step 101:It receives to SIM card on the user equipment into line-locked instruction;For the SIM card generate one with
Machine PIN code, and using the former PIN code of the random PIN update SIM card.
Wherein, have to the realization method of SIM card into line-locked instruction on the user equipment including but not limited to following
Two kinds:1) when carrying out default setting to equipment and SIM card, manufacturer technical staff input to SIM card on the user equipment into
Line-locked instruction;2) user equipment is after the SIM card is unlocked successfully using the former PIN code of the SIM card, Yong Hushe
Standby automatically generate sticks into line-locked instruction to SIM on the user equipment.The concrete scene of wherein the 2) kind can include:
User equipment is in each booting, and after detecting that the former PIN code using SIM card successfully unlocks SIM card, user equipment is generated to institute
SIM card is stated on user equipment into line-locked instruction.
It, can be first to the PIN of the SIM card before the former PIN code for updating the SIM card in specific implementation process
Code state is judged, when the PIN code authentication function for determining the SIM card is opened and the PIN code of SIM card is decrypted, is replaced
Change the former PIN code of the SIM card.
Specifically, may determine that whether the PIN code authentication function of the SIM card is opened first, if the SIM card
PIN code authentication function is not opened, then opens the PIN code authentication function of the SIM card.In the PIN code verification for determining the SIM card
After function is opened, further judge whether the PIN codes mistake input number of the SIM card is more than pre-determined number, in the SIM
The PIN code mistake input number of card can just replace the former PIN code of the SIM card when being more than pre-determined number.It is this is because existing
SIM card PIN code mistake input number reach certain number after, SIM card will be locked, and can not reuse PIN codes
SIM card is decrypted, inputs whether number is more than pre-determined number by the PIN code mistake for judging the SIM card, SIM card is avoided to be locked
Dead risk.
Step 102:The certificate parameter of the SIM card is encrypted, generates encrypted certificate parameter, it is described to test
Demonstrate,prove property parameters of the parameter including the random PIN, the SIM card.
Specifically, user equipment is encrypted the certificate parameter of the SIM card using irreversible cryptographic algorithm, so that
Encrypted certificate parameter can be decrypted by user equipment.Wherein, irreversible cryptographic algorithm can be Base64 Encryption Algorithm, miniature
Encryption Algorithm (Tiny Encryption Algorithm, TEA), data encryption algorithm (Data Encryption
Algorithm, DEA), triple data encryption algorithm (Triple Data Encryption Algorithm, TDEA), it is advanced plus
In Data Encryption Standard (Advanced Encryption Standard, AES) algorithm, SMS4 Encryption Algorithm etc. any one or
A variety of combinations, the embodiment of the present invention are not particularly limited.
The property parameters of the SIM card can be in ICCID, IMEI, MSI, media access control MAC addresses, SN etc.
Any one or a variety of combinations, the embodiment of the present invention are not particularly limited.
Step 103:The encrypted certificate parameter is stored in the storage unit of the user equipment.
Wherein, the storage unit can be flash memory (Flash Memory), random access memory (random
Access memory, RAM), Erasable Programmable Read Only Memory EPROM (Erasable Programmable Read Only
Memory, EPROM) etc., the embodiment of the present invention is not particularly limited.
In said program, user equipment generates the former PIN codes of random PIN replacement SIM card for SIM card, and will be raw
Into random PIN, SIM card property parameters encryption after be stored in the user equipment, improve the guarantor of SIM card PIN code
Close property increases illegitimate user equipment and decodes the difficulty of SIM card, and then improves user equipment to SIM card into line-locked peace
Quan Xing.
Optionally, the certificate parameter to the SIM card is encrypted, and generates encrypted certificate parameter, tool
Body realization method is including but not limited to following two:
Mode 1:All parameters that the certificate parameter includes are spliced into a character string, the character string is added
Close processing generates encrypted character string, using the encrypted character string as encrypted certificate parameter.
For example, when the certificate parameter is the random PIN and the ICCID, by the random PIN of generation, SIM
The ICCID of card is spliced into a character string, and the character string is encrypted, and generates encrypted character string, by described in
Encrypted character string is as encrypted certificate parameter.
Mode 2:Each parameter that the certificate parameter includes is encrypted respectively, each corresponding parameter
An encrypted parameter is generated, the encrypted certificate parameter includes each encrypted parameter of generation.
For example, when the certificate parameter is the random PIN and the ICCID, respectively to the random PIN of generation
Code, SIM card ICCID be encrypted, generate encrypted certificate parameter, the encrypted certificate parameter includes encryption
Random PIN and encrypted ICCID afterwards.
By the method, the complexity of certificate parameter can be increased, user equipment is further improved and SIM cards are carried out
The safety of locking.
Optionally, in specific implementation process, the SIM card of user terminal locking can be one or multiple, sheet
Inventive embodiments are not particularly limited.
For example, when the SIM card of user terminal locking is two different SIM cards, user terminal can be two above SIM
Card is respectively configured a random PIN, and using above-mentioned reversible encryption mode by the corresponding certificate parameter of two above SIM card all
It is stored in the storage unit of user terminal, so that the user terminal can to any one SIM card in two above SIM card
It is decrypted, and then realizes call online.
By the method, user terminal can simultaneously lock multiple SIM cards, improve user experience.
Based on same inventive concept, the embodiment of the present invention also provides a kind of method for unlocking SIM card.With reference to Fig. 2, the party
Method includes:
Step 201:Receive the instruction for releasing the locking to the SIM card on the user equipment.
Specifically, the detection module in user equipment has card insertion fashionable in card slot is detected, detection module just generates solution
Except the instruction of locking, and receiving module is sent to, receiving module receives the instruction.
Step 202:Encrypted certificate parameter, the certificate parameter packet are obtained from the storage unit of the user equipment
Include the property parameters of random PIN, locking SIM card.
The method of the corresponding above-mentioned locking SIM card of the embodiment of the present invention, herein the property parameters of SIM card be ICCID, IMEI,
It is one or more in MSI, MAC address, SN.
Step 203:The encrypted certificate parameter is decrypted, obtains the certificate parameter.
The method of the above-mentioned locking SIM card of the corresponding embodiment of the present invention, is herein decrypted encrypted certificate parameter
Realization method includes:Using the corresponding solution of one or more of Base64, TEA, DEA, TDEA, AES, SMS4 encryption method
The encrypted certificate parameter is decrypted in decryption method.
Step 204:SIM card on the user equipment is verified using the certificate parameter;When determining to be verified, solution
Except the locking to the SIM card.
Specifically, the SIM card for judging the random PIN obtained from the storage unit of user equipment and being verified stores
PIN code it is whether consistent;It is stored when the random PIN codes obtained in the storage unit from user equipment and the SIM card being verified
When PIN code is consistent, determine to be verified.
Further, when determining that PIN code is consistent, it can also further verify whether property parameters are consistent.It is for example, corresponding
The method of the above-mentioned locking SIM card of the embodiment of the present invention, when property parameters include IMEI, determine PIN code it is consistent after, it is true
Surely before being verified, whether the IMEI of verifying user equipment and the IMEI preserved of the SIM card on user equipment are consistent;Example again
Such as, the method for the above-mentioned locking SIM card of the corresponding embodiment of the present invention when property parameters include IMEI, is determining PIN code one
After cause, determine to be verified before, whether the SN that SIM card on the SN user equipmenies of verifying user equipment preserves consistent.
If it is determined that being verified, then it is that the user equipment previously locked to illustrate the SIM card in the sim card slot of user equipment
SIM card, then the user equipment service that be provided of the SIM card, such as call, online etc. can be provided.
In said program, when user equipment detects that the sim card slot of user equipment has SIM card insertion, it may be used
The certificate parameter of storage verifies the SIM card on user equipment, if the SIM cards being verified locked originally for user equipment
SIM card, then user equipment can use its preservation certificate parameter to the SIM card decrypt so that user equipment can make
The service provided with the SIM card improves safety, the confidentiality of unlock.
Optionally, the method for the above-mentioned locking SIM card of the corresponding embodiment of the present invention, when the certificate parameter is described random
PIN code, locking SIM card ICCID when, step 203, the specific implementation of step 204 include it is following two:
1st kind:When the mode that the certificate parameter of the SIM card is encrypted in user equipment is aforesaid way 1,
User equipment carries out the SIM card on user equipment verification using the certificate parameter of storage and specifically includes:User equipment is from storage
Encrypted character string is obtained in unit, and encrypted character string is decrypted, obtains the random PIN, institute
State ICCID;Then the PIN of SIM card storage for judging the random PIN obtained from the storage unit of user equipment and being verified
Whether code is consistent;When the random PIN obtained in the storage unit from user equipment and the PIN code of the SIM card being verified storage
When consistent, determine to be verified.
2nd kind:When the mode that the certificate parameter of the SIM card is encrypted in user equipment is aforesaid way 2,
User equipment carries out the SIM card on user equipment verification using the certificate parameter of storage and specifically includes:User equipment is from storage
Encrypted random PIN and encrypted ICCID are obtained in unit, and to encrypted random PIN and after encrypting
ICCID be decrypted, obtain the random PIN, the ICCID;Then judge the storage unit from user equipment
Whether the random PIN of middle acquisition and the PIN code of SIM card storage being verified are consistent;When in the storage unit from user equipment
When the random PIN of acquisition is consistent with the PIN code of SIM card storage being verified, determine to be verified.
In addition, during being verified using any one above-mentioned mode to the SIM card in the equipment, used when determining
It, can also be into one after the random PIN stored in the storage unit of family equipment and the PIN codes of the SIM card being verified storage are consistent
Step judges whether the random ICCID stored in the storage unit of user equipment and the SIM card ICCID being verified are consistent, in user
When the random ICCID stored in the storage unit of equipment is consistent with the SIM card ICCID being verified, then determine to be verified.
By the method, SIM card is verified using the encrypted certificate parameter stored in user equipment, improves user equipment
The safety being unlocked to SIM card.During certificate parameter is used to verify SIM card, verification can also be increased
ICCID programs can further improve the safety that user equipment is unlocked SIM card.
Optionally, before being verified using the certificate parameter to the SIM card in the sim card slot of user equipment, institute
The method of stating further includes:It determines not needing to verify the SIM card in the sim card slot of user equipment using PUK code.
Wherein it is determined that a kind of reality verified using PUK code to the SIM card in the sim card slot of user equipment is not needed to
Now mode can be:The PIN code mistake input number of the SIM card is determined more than preset times, the preset times are more than etc.
In 0.This is because after the mistake input number of the PIN code of existing SIM card reaches certain number, SIM card will be locked, nothing
Method reuses PIN code decryption SIM card, PUK code can only be used to decrypt SIM card.
By the method, the further perfect scheme to being unlocked by the SIM card that user equipment locks further carries
The high safety of the SIM card of user equipment unlock.
Based on same inventive concept, the embodiment of the present invention also provides a kind of method for the authentication function for closing SIM card.Reference
Fig. 3, this method include:
Step 301:Receive the instruction for the authentication function for closing SIM card;
Step 302:The prompting of the password of the authentication function of user's input closing SIM card is generated according to described instruction;
Step 303:If password is correct, encrypted certificate parameter is obtained from the storage unit of the user equipment,
The certificate parameter includes the property parameters of random PIN, locking SIM card;
Step 304:The encrypted certificate parameter is decrypted, obtains the certificate parameter;
Step 305:SIM card on the user equipment is verified using the certificate parameter;When determining to be verified, close
Close the PIN code authentication function of the SIM card.
Wherein, the instruction that the authentication function of SIM card is closed in step 301 can be instruction input by user, can also use
The instruction of application triggers user equipment generation in the equipment of family, the embodiment of the present invention are not particularly limited.For example, in user
The menu for the authentication function for closing SIM card is clicked on the setting interface of equipment,
Wherein, the encrypted certificate parameter of acquisition, decryption verification parameter in step 303 to step 305 are joined using verification
The specific implementation of the operating procedures such as number verification SIM card is referred in the embodiment of the present invention in the method for above-mentioned unlock SIM
Step 202 to the realization method of step 203, no longer repeated herein.
In said program, the authentication function of SIM card can be closed, so that the SIM card can be by other users equipment
It uses, improves user experience.
In specific implementation process, those skilled in the art can provide above-mentioned various technical sides to the embodiment of the present invention
Case is combined, modification and variation, generates a variety of skills that SIM card authentication function is locked, unlocked and closed to SIM card
Next art scheme enumerates several schemes in the cards of row of the embodiment of the present invention.
Scheme one:
1) SIM card is locked:
A random PIN is configured for the SIM card on user equipment, to replace the former PIN codes of the SIM card;
The random PIN is encrypted using Base64 Encryption Algorithm;
Encrypted random PIN is stored in the storage unit of the user equipment.
2) SIM card is unlocked:
When user equipment detects that the sim card slot of user equipment has SIM card insertion, determine that user equipment needs to unlock
SIM card;
The encrypted random PIN is obtained from the storage unit of the user equipment;
The encrypted random PIN is decrypted, obtains the random PIN;
Verify whether the random PIN is consistent with the PIN code of the SIM card on the user equipment;If it is inconsistent,
Unlock failure;If consistent, success is unlocked.
3) authentication function of SIM card is closed:
Receive the instruction for the authentication function for closing SIM card;
The prompting of the password of the authentication function of user's input closing SIM card is generated according to described instruction;
If password is correct, the encrypted random PIN codes are obtained from the storage unit of the user equipment;
The encrypted random PIN is decrypted, obtains the random PIN;
Verify whether the random PIN is consistent with the PIN code of the SIM card on the user equipment;If it is inconsistent,
Fail-closed;If consistent, success is closed.
Said program one, user equipment generate random PIN for SIM card and replace the former PIN codes of SIM card, use
Base64 Encryption Algorithm preserves again after being encrypted to random PIN;It is needed during user equipment authentication SIM card by encrypted PIN code
It could be used after decryption, and not preserve random PIN and do not know the illegitimate user equipment of the cipher mode of random PIN
SIM card can not be decrypted.This programme is relative to the prior art, the confidentiality higher of PIN code, locking of the user equipment to SIM card
It is safer.
Scheme two:
1) SIM card is locked:
The ICCID of the SIM card on user equipment is obtained, and a random PIN is configured for the SIM card on user equipment,
To replace the former PIN code of the SIM card;
The ICCID, the random PIN are encrypted using Base64 Encryption Algorithm;
Encrypted ICCID, encrypted random PIN are stored in the storage unit of the user equipment.
2) SIM card is unlocked:
When user equipment detects that the sim card slot of user equipment has SIM card insertion, determine that user equipment needs to unlock
SIM card;
The encrypted ICCID, the encrypted random PIN are obtained from the storage unit of the user equipment
Code;
The encrypted ICCID, the encrypted random PIN are decrypted respectively, described in acquisition
ICCID, the random PIN;
Verify the random PIN that is obtained from storage unit and the SIM card on the user equipment PIN codes whether one
It causes;If it is inconsistent, unlock failure;If consistent, step 225 is further performed;
Verify whether the ICCID obtained from storage unit is consistent with the ICCID of the SIM card on the user equipment;Such as
Fruit is inconsistent, then unlocks failure;It is if consistent, it is determined that unlock successfully.
3) authentication function of SIM card is closed:
Receive the instruction for the authentication function for closing SIM card;
The prompting of the password of the authentication function of user's input closing SIM card is generated according to described instruction;
If password is correct, after the encrypted ICCID, the encryption are obtained from the storage unit of the user equipment
Random PIN;
The encrypted ICCID, the encrypted random PIN are decrypted respectively, described in acquisition
ICCID, the random PIN;
Verify the random PIN that is obtained from storage unit and the SIM card on the user equipment PIN codes whether one
It causes;It is lost if it is inconsistent, closing;If consistent, step 235 is further performed;
Verify whether the ICCID obtained from storage unit is consistent with the ICCID of the SIM card on the user equipment;Such as
Fruit is inconsistent, then Fail-closed;If consistent, success is closed.
Scheme two further increases the proving program of ICCID on the basis of scheme one, i.e., user equipment using with
Machine PIN code also needs to determine the ICCID that user equipment preserves and the ICCID mono- of SIM card being verified after being proved to be successful SIM card
It causes, further improves the safety that user equipment locks SIM card.
Scheme three:
1) SIM card is locked:
The ICCID of the SIM card on user equipment is obtained, and a random PIN is configured for the SIM card on user equipment,
To replace the former PIN code of the SIM card;
The ICCID, the random PIN are spliced into a character string;
The character string is encrypted using Base64 Encryption Algorithm;
Encrypted character string is stored in the storage unit of the user equipment.
2) SIM card is unlocked:
When user equipment detects that the sim card slot of user equipment has SIM card insertion, determine that user equipment needs to unlock
SIM card;
The encrypted character string is obtained from the storage unit of the user equipment;
The encrypted character string is decrypted, obtains the ICCID, the random PIN;
Verify the random PIN that is obtained from storage unit and the SIM card on the user equipment PIN codes whether one
It causes;If it is inconsistent, unlock failure;If consistent, step 325 is further performed;
Verify whether the ICCID obtained from storage unit is consistent with the ICCID of the SIM card on the user equipment;Such as
Fruit is inconsistent, then unlocks failure;It is if consistent, it is determined that unlock successfully.
3) authentication function of SIM card is closed:
Receive the instruction for the authentication function for closing SIM card;
The prompting of the password of the authentication function of user's input closing SIM card is generated according to described instruction;
If password is correct, the encrypted character string is obtained from the storage unit of the user equipment;
The encrypted character string is decrypted, obtains the ICCID, the random PIN;
Verify the random PIN that is obtained from storage unit and the SIM card on the user equipment PIN codes whether one
It causes;If it is inconsistent, Fail-closed;If consistent, step 335 is further performed;
Verify whether the ICCID obtained from storage unit is consistent with the ICCID of the SIM card on the user equipment;Such as
Fruit is inconsistent, then Fail-closed;If consistent, success is closed.
Scheme three increases ICCID parameters on the basis of scheme one, not only in certificate parameter, also by ICCID with
Machine PIN code is spliced into a character string and is encrypted, and increases the complexity of certificate parameter, further improves the guarantor of PIN code
Close property improves the safety that user equipment locks SIM card.
Based on same inventive concept, with reference to Fig. 4, the embodiment of the present invention also provides a kind of device of locking SIM card, including:
Receiving unit 401, for receiving to SIM card on the user equipment into line-locked instruction;
Processing unit 402 for generating a random PIN for the SIM card, and is updated using the random PIN
The former PIN code of the SIM card;The certificate parameter of the SIM card is encrypted, generates encrypted certificate parameter, institute
State property parameters of the certificate parameter including the random PIN, the SIM card;
Storage unit 403, for the encrypted certificate parameter to be stored in the storage unit 403 of the user equipment
In.
Optionally, the property parameters of the SIM card include at least one in ICCID, IMEI, MSI, MAC Address, SN.
Optionally, the processing unit 402 is used for:The random PIN, the ICCID are spliced into a character string,
The character string is encrypted, generates encrypted character string, using the encrypted character string as the encryption
Certificate parameter afterwards.
Optionally, the processing unit 402 is used for:Place is encrypted to the random PIN, the property parameters respectively
Reason, generates encrypted certificate parameter, and the encrypted certificate parameter includes encrypted random PIN, encrypted category
Property parameter.
Based on same inventive concept, with reference to Fig. 5, the embodiment of the present invention also provides a kind of device for unlocking SIM card, including:
Receiving unit 501, for receiving the instruction for releasing the locking to the SIM card on the user equipment;
Processing unit 502, for obtaining encrypted certificate parameter, institute from the storage unit 403 of the user equipment
State the property parameters that certificate parameter includes random PIN, locking SIM card;Place is decrypted to the encrypted certificate parameter
Reason, obtains the certificate parameter;SIM card on the user equipment is verified using the certificate parameter;It is determining to be verified
When, the locking to the SIM card is released, so that the service that the SIM card is provided can be used in the user equipment.
Optionally, the processing unit 502 is used for:Verify the random PIN and the SIM card on the user equipment
Whether PIN code consistent and whether the ICCID of the ICCID of the verification locking SIM card and the SIM card on the user equipment
Unanimously.s
Based on same inventive concept, with reference to Fig. 6, the embodiment of the present invention also provides a kind of authentication function for closing SIM card
Device, including:
Receiving unit 601, for receiving the instruction for the authentication function for closing SIM card;
Processing unit 602, for generating carrying for the password of the authentication function of user's input closing SIM card according to described instruction
Show;If password is correct, encrypted certificate parameter, the certificate parameter packet are obtained from the storage unit of the user equipment
Include the property parameters of random PIN, locking SIM card;The encrypted certificate parameter is decrypted, is tested described in acquisition
Demonstrate,prove parameter;SIM card on the user equipment is verified using the certificate parameter;When determining to be verified, the SIM is closed
The PIN code authentication function of card.
Based on same inventive concept, with reference to Fig. 7, the embodiment of the present invention also provides a kind of electronic equipment, including:It is at least one
Processor 701 and the memory 702 communicated to connect at least one processor 701;Wherein, the memory 702 is deposited
The instruction that can be performed by least one processor 701 is contained, at least one processor 701 is by performing the storage
Such as the above method of the embodiment of the present invention is realized in the instruction that device 702 stores.
Based on same inventive concept, the embodiment of the present invention also provides a kind of computer readable storage medium, feature
It is, the computer-readable recording medium storage has computer instruction, when the computer instruction is run on computers,
So that computer performs such as the above method of the embodiment of the present invention.
The one or more technical solutions provided in the embodiment of the present invention, have at least the following technical effects or advantages:
1st, user equipment generates the former PIN code that a random PIN replaces SIM card for SIM card, and by the random PIN of generation
Code, SIM card property parameters encryption after be stored in the user equipment, improve the confidentiality of SIM card PIN code, increase
Illegitimate user equipment decodes the difficulty of SIM card, and then improves user equipment to SIM card into line-locked safety.
2nd, user equipment is also preserved in addition to preserving the random PIN of SIM card locked by user equipment by user equipment
The ICCID of the SIM card of locking;PIN code verification and ICCID verifications are needed when verifying SIM card all by rear, user equipment
Just SIM card can be used to carry out speech communication, further improve user equipment to SIM card into line-locked safety.
3rd, the authentication function of SIM card can be closed, so that the SIM card can be used by other users equipment, is improved
User experience.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the present invention
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the present invention
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions each in flowchart and/or the block diagram
The combination of flow and/or box in flow and/or box and flowchart and/or the block diagram.These computers can be provided
Program instruction is to the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices
To generate a machine so that the instruction performed by computer or the processor of other programmable data processing devices generates use
In the dress of function that realization is specified in one flow of flow chart or multiple flows and/or one box of block diagram or multiple boxes
It puts.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.